Remote source for models.dev metadata (https://models.dev/api.json).
pull/1fetches data via Req and caches locallyload/1reads from cached file (no network call)
Options
:url- API endpoint (default: "https://models.dev/api.json"):req_opts- Additional Req options for testing (e.g.,[plug: test_plug])
Configuration
Cache directory can be configured in application config:
config :llm_db,
models_dev_cache_dir: "priv/llm_db/remote"Default: "priv/llm_db/remote"
Usage
# Pull remote data and cache
mix llm_db.pull
# Load from cache
{:ok, data} = ModelsDev.load(%{})
Summary
Functions
Transforms models.dev JSON format to canonical Zoi format.
Functions
Transforms models.dev JSON format to canonical Zoi format.
Input Format (models.dev)
{
"provider_id": {
"id": "provider_id",
"name": "Provider Name",
"models": {
"model_id": {
"id": "model_id",
"name": "Model Name",
"limit": {"context": 128000, "output": 16384},
"cost": {"input": 2.50, "output": 10.00},
...
}
}
}
}Output Format (Canonical Zoi)
%{
"provider_id" => %{
id: :provider_id,
name: "Provider Name",
models: [
%{
id: "model_id",
provider: :provider_id,
name: "Model Name",
limits: %{context: 128000, output: 16384},
cost: %{input: 2.50, output: 10.00},
...
}
]
}
}Main transformations:
- Convert provider string IDs to atom keys
- Convert models map to models list
- Add provider field to each model
- Transform field names (limit → limits, etc.)
- Atomize known field keys