feat(mistral): add mistral/mistral-ocr-2512 (OCR 3) to cost map - #31463
Conversation
Adds the OCR 3 model (mistral-ocr-2512) released 2025-12-18 to both the root and bundled backup cost maps at $2 / 1000 pages and $3 / 1000 annotated pages, mirroring the existing Mistral OCR entries. Regresses the pricing in both maps and verifies completion_cost scales per page.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is limited to two JSON cost map files and a test file, with no modifications to any production code paths. The change is additive-only: a new JSON entry in two cost map files that exactly mirrors the structure of the existing mistral-ocr-latest and mistral-ocr-4-0 entries. Tests confirm the entry is present and priced correctly in both files and that completion_cost scales linearly; the fixture correctly forces the local map to avoid CI network calls. No existing entries, tests, or logic were modified. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds mistral/mistral-ocr-2512 entry with ocr_cost_per_page: 0.002 and annotation_cost_per_page: 0.003, matching the schema of existing Mistral OCR entries. |
| litellm/model_prices_and_context_window_backup.json | Mirror of the main cost map change — adds the same mistral/mistral-ocr-2512 entry to the bundled backup used when LITELLM_LOCAL_MODEL_COST_MAP is set. |
| tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_cost.py | Adds three new test functions (raw JSON validation, get_model_info, and cost-scaling) for mistral-ocr-2512; uses a monkeypatched local cost map fixture to avoid network calls in CI. |
Reviews (1): Last reviewed commit: "feat(mistral): add mistral/mistral-ocr-2..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Resolves LIT-3882
Linear ticket
LIT-3882
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewScreenshots / Proof of Fix
Ran a live proxy with the new entry (registering
mistral/mistral-ocr-2512and forcing the in-repo cost map so the brand-new price resolves before it lands on main) and sent a real OCR request to the Mistral API.export LITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config ocr_2512_proof_config.yaml --port 4000config:
5-page OCR call, checking the cost header (5 pages x $0.002/page = $0.01):
The response came back from the real API with
model: mistral-ocr-2512andusage_info.pages_processed: 2on a 2-page call, and the 5-page call above billed exactly $0.01Type
🆕 New Feature
Changes
mistral/mistral-ocr-2512(Mistral OCR 3, Premier v25.12, released 2025-12-18) was missing from LiteLLM. This adds it to bothmodel_prices_and_context_window.jsonand the bundledlitellm/model_prices_and_context_window_backup.jsonat $2 / 1000 pages (ocr_cost_per_page: 0.002) and $3 / 1000 annotated pages (annotation_cost_per_page: 0.003), per the OCR 3 model card, mirroring the shape of the existing Mistral OCR entries. The Mistral OCR transformation is model-agnostic and passes the model name straight through, so no code changes were needed beyond the cost map.Regression tests in
tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_cost.pyassert the entry exists with the correct pricing in both cost maps and thatcompletion_costscales at $0.002/page. Mutating either pricing value fails the new tests.