Repository navigation
Conversation
Greptile SummaryAdds pricing, context-window, and capability metadata for six Snowflake and OpenRouter model routes so automatic cost tracking can resolve them
Confidence Score: 4/5The pricing additions appear safe to merge, with the non-blocking concern that the corrected model lookups lack focused regression coverage The added entries are structurally consistent with the pricing map, and no current pricing or capability defect was established; however, existing generic validation would not detect deletion or type-correct corruption of these exact entries Files Needing Attention: model_prices_and_context_window.json
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds six model metadata entries with plausible sibling-aligned prices, but the reported spend regression is not covered by a focused test |
Reviews (1): Last reviewed commit: "feat: add missing snowflake opus + openr..." | Re-trigger Greptile
| "max_input_tokens": 200000, | ||
| "max_output_tokens": 4096 | ||
| }, | ||
| "openrouter/inception/mercury-2": { | ||
| "cache_read_input_token_cost": 2.5e-08, | ||
| "input_cost_per_token": 2.5e-07, | ||
| "litellm_provider": "openrouter", | ||
| "max_input_tokens": 128000, | ||
| "max_output_tokens": 50000, | ||
| "max_tokens": 50000, | ||
| "mode": "chat", | ||
| "output_cost_per_token": 7.5e-07, | ||
| "supports_function_calling": true, | ||
| "supports_prompt_caching": true, | ||
| "supports_response_schema": true, |
There was a problem hiding this comment.
Pricing entries lack regression coverage
No focused test verifies that these six exact model keys resolve to the expected nonzero costs, so deleting an entry or introducing a type-correct pricing error would pass the existing schema and map-size checks and allow the silent spend-tracking regression to return.
Context Used: CLAUDE.md (source)
Knowledge Base Used: Cost Tracking and Budget Enforcement
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks - addressed the regression-coverage point, and it surfaced a second gap I'd missed. Test added:
Both verified locally as negative controls, not assumed. 12 pass clean; each mutation fails exactly 2 of the 12. It also asserts Second gap, found while writing the test: the six entries were only in the root map, not in I'd originally checked recent merged cost-map PRs (e.g. #18710) and saw root-only changes, which is why I submitted it that way - happy to drop the backup commit if it's meant to be generated rather than hand-edited. |
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
|
CI caught a real defect in my entry - That test is right and my entry was wrong. Opus 4.7/4.8 reject Fixed on I reproduced that invariant locally against both patched files before pushing - 30 matching variants, 0 missing - rather than pushing and waiting on CI to re-check. Also added the assertion to my own test file so the reason lives next to the entry, not only in an unrelated test. Worth noting this is the same fact we independently encode in our own proxy config as |
|
Good catch - confirmed and fixed. You're right that Root cause of my mistake: I mirrored Verified before pushing, not assumed - every provider mirror of gpt-5.5 with a 1.05M window already carries these ( Added to root + bundled backup with the exact canonical values (asserted equal to
Pinned in the regression test as you asked, plus a generalised |
The `Verify schema.d.ts matches the proxy OpenAPI spec` check was made required on 2026-08-07, after this PR last pushed on 2026-08-05, so it never ran here and sits permanently at "Expected - waiting for status to be reported". Empty commit (identical tree) purely to fire a synchronize event. This PR touches only the model price map, which the job's change detection treats as irrelevant, so it should pass without doing any work.
Updates the branch from 393 commits behind. Also clears the budget-ratchet red: that check compares the PR tree against the MERGE-BASE, and upstream raised the ruff-strict-budget limits (TID251 0 -> 1238, a newly banned import with existing violations grandfathered) after our fork point - so it read upstream own budget change as this PR loosening them. Moving the merge-base forward removes the diff.
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
What
Adds cost-map entries for six models that currently resolve to no price, so LiteLLM silently records
$0spend for them.snowflake/claude-opus-4-5snowflake/claude-4-opusentrysnowflake/claude-opus-4-6+ supports_adaptive_thinkingsnowflake/claude-opus-4-7+ supports_adaptive_thinkingopenrouter/inception/mercury-2inception/mercury-2entryopenrouter/openai/gpt-5.1openrouter/openai/gpt-5.2's shape + OpenAI list priceopenrouter/openai/gpt-5.5Why
A cost-map miss is silent. The request succeeds, the response is normal, and
LiteLLM_SpendLogsrecords ~$0— no warning, no metric, no exception. The only symptom is a cost dashboard that quietly under-reports.We hit this in production:
snowflake/claude-opus-4-7logged $1.16 across 365 calls / 37.4M tokens in 7 days, against a true cost near $185 — under-reported ~150x on that one route. It went unnoticed for weeks precisely because nothing surfaces it.The pattern behind each gap:
snowflake/claude-4-opus(Opus 4.0 era) but none of theclaude-opus-4-5/4-6/4-7names Cortex now serves. The sonnet and haiku lines are already current; only opus lagged.openrouter/inception/mercury-2—inception/mercury-2exists, but the OpenRouter-routed variant doesn't, so anyone reaching Mercury 2 through OpenRouter gets$0.openrouter/openai/gpt-5.1/-gpt-5.5—openrouter/openai/gpt-5.2is already present, so these two look like plain gaps rather than a deliberate omission.Notes on the values
snowflake/claude-*entry in the file.supports_adaptive_thinkingis set on 4-6 and 4-7 to match their canonical Anthropic entries, and omitted on 4-5, which is not adaptive.openrouter/openai/*entries use OpenAI's canonical context windows, matching how the existingopenrouter/openai/gpt-5.2entry is specified. Prices verified against OpenRouter's public/api/v1/modelsendpoint, which passes OpenAI list pricing through unchanged.model_prices_and_context_window.jsonis touched, matching recent merged cost-map PRs (e.g. [Feature]: Add amazon.nova-2-multimodal-embeddings-v1 to model_prices_and_context_window #18710); the backup copy is CI-synced.Verification
Diff is +6 keys, 0 removals, 0 modifications to existing entries — asserted programmatically by parsing both files and comparing the full key sets and every shared entry, not just by eyeballing the diff. The result parses as valid JSON.