# `mix compile.bb_inference`
[🔗](https://github.com/beam-bots/bb_inference/blob/main/lib/mix/tasks/compile.bb_inference.ex#L5)

Places every model artefact declared by a robot in this project under
`priv/bb_inference`, so it is part of the build and of any release.

Add it after the Elixir compiler, since it reads the compiled robots:

    compilers: Mix.compilers() ++ [:bb_inference]

`mix bb_inference.install` does that for you.

It finds robots by reading a persisted attribute from each `.beam` file in
the project's compile path, without loading the modules.

URLs are downloaded into a cache outside the project: the directory named
by `BB_INFERENCE_CACHE_DIR`, or the user cache directory
(`~/.cache/bb_inference` on Linux). See `BB.Inference.Artefact.Placement`
for what is cached and when a build warns or fails.

A failed download is a warning, and is retried on every build until it
succeeds. `--warnings-as-errors` does not turn it into an error.

---

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