# `BB.Inference.Transformers.AddModelControllers`
[🔗](https://github.com/beam-bots/bb_inference/blob/main/lib/bb/inference/transformers/add_model_controllers.ex#L5)

Checks each `model` and lowers it into a `controller` of the same name
running `BB.Inference.ModelController`.

The checks:

- the name isn't already taken by another component, so the error points at
  the `model` rather than at the controller it would have become;
- a URL source declares a `sha256`;
- `archive_member` is given exactly when the source is an archive;
- the codec's options are valid against its `options_schema/0`. The model
  carries them forward with the codec's defaults applied.

It also records each model's artefact in a persisted module attribute,
which the `:bb_inference` compiler reads from the `.beam` file without
loading the module.

These are checks in a transformer rather than a verifier because Spark
reports verifier errors as warnings, and the module still compiles.

# `after_compile?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
