mix mimir.pricing.refresh (Mimir v0.1.0)

Copy Markdown View Source

Refresh the vendored token-pricing DB used by Mimir.Pricing.

Pulls the community LiteLLM pricing table (model_prices_and_context_window.json — the same source ccusage uses) and writes it gzipped to priv/pricing/litellm_model_prices.json.gz (kept small; gunzipped on load).

Rates are vendored (no network on the hot path). Run this task manually when rates drift. The app reads the vendored copy at runtime via Mimir.Pricing.

mix mimir.pricing.refresh
mix mimir.pricing.refresh --url https://.../model_prices.json
mix mimir.pricing.refresh --dest priv/pricing/custom.json.gz

Options

  • --url <url> — override the source URL (default: the LiteLLM main raw JSON)
  • --dest <path> — override the destination .gz file (default: the vendored priv path)

When run inside an embedding app, pair --dest with the :mimir, :pricing_db_path config so Mimir.Pricing reads the refreshed file.