Downloads and caches optional ONNX models that are too large to bundle in the Hex package.
Models are resolved in order:
- An explicit
:models_diroption. OCTOROOM_MODELS_DIRorconfig :octoroom_agents, :models_dir.priv/models/<filename>if present locally.- The OS user cache directory (
octoroom_agents/models).
On a cache miss, ensure/2 downloads the file over HTTPS with Req,
verifies its SHA-256 checksum, and atomically moves it into place. Set
config :octoroom_agents, auto_download_models: false (or pass
download: false) to disable runtime downloads and prefetch models ahead
of time with mix octoroom.models.download.
Summary
Functions
Ensures every managed model is present on disk.
Returns {:ok, path} for name, downloading and verifying it if missing.
Metadata (filename, url, sha256) for a managed model.
Directory where downloaded models are cached.
Names of all models managed by this module.
Path where name lives or will be cached.
Types
Functions
Ensures every managed model is present on disk.
Returns {:ok, path} for name, downloading and verifying it if missing.
Options:
:models_dir- override the cache directory:download- override:auto_download_models(defaulttrue):url,:sha256,:request_fun- overrides for tests
Metadata (filename, url, sha256) for a managed model.
Directory where downloaded models are cached.
Checks :models_dir in opts, then OCTOROOM_MODELS_DIR, then
:octoroom_agents's :models_dir config, then the OS user cache directory
(octoroom_agents/models).
@spec names() :: [name()]
Names of all models managed by this module.
Path where name lives or will be cached.
When no custom directory is configured, returns priv/models/<filename> if
the file is present locally, otherwise Path.join(models_dir(), filename).