Refreshing the bundled price table silently downgrades models LiteLLM has pruned
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
Línea de trabajo
Start with the pricegen generator and its Entries function, then read TestBundled_DistinguishesOpusVersions, TestBundled_LongContextThresholdIsCarried and TestBundled_MatchesSnapshot to see what the bundled table currently guarantees. The issue first needs a maintainer decision on how long a pruned rate is trusted and where a retained rate lives, so do not start on code yet. Done would be a settled policy plus a test that catches any pruned model, not just the two named ones.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The bundled price table is generated from a pinned LiteLLM commit. Moving that pin forward is currently not safe: upstream prunes rows, and every pruned model silently falls back to its family glob at the wrong rate.
Found while trying to bump the pin to pick up gpt-6-luna for Codex (#1365). The bump was abandoned — the trade was one OpenAI model gained against eight Anthropic models mispriced.
What happens
Regenerating at the newest upstream commit (314f1798) against the current pin (ee7c7e14):
- 21 previously-priced models lose their exact rows, including
claude-3-7-sonnet-20250219,claude-3-opus-20240229,claude-4-opus-20250514,claude-4-sonnet-20250514,claude-opus-4-1,claude-opus-4-1-20250805,claude-opus-4-20250514,claude-sonnet-4-20250514 claude-sonnet-4-5loses its long-context premium — upstream now reports noinput_cost_per_token_above_200k_tokens- 15 models are gained
With an exact row gone, the model resolves through its family glob, which carries the newest family member's rates. For claude-opus-4-1 that is $4/Mtok against its real $15/Mtok — a 3.75× under-charge.
That is precisely the error the exact rows were added to prevent. pricegen's own doc says so:
"the data already distinguishes claude-opus-4-1 ($15/Mtok input) from claude-opus-5 ($5/Mtok), which the three hand-measured family globs it replaces priced identically — a 3x error on every opus-4-1 request."
Two existing tests catch it, which is the only reason it was not shipped: TestBundled_DistinguishesOpusVersions and TestBundled_LongContextThresholdIsCarried. They are the current safety net, and they are incidental — they happen to name two affected models. A future pruning of a model neither test mentions would pass.
Why upstream does it, and why the old rate is still right
Not a bug on their side. claude-opus-4-1 still exists upstream, but only under resellers:
anthropic.claude-opus-4-1-20250805-v1:0 bedrock_converse $15/Mtok
us.anthropic.claude-opus-4-1-20250805-v1:0 bedrock_converse $15/Mtok
databricks/databricks-claude-opus-4-1 databricks $15/Mtok
The first-party anthropic row was removed; the remaining first-party opus rows are 4-5 through 4-8. So LiteLLM prunes first-party rows for models Anthropic has retired from its own API, and the mirrors stay because Bedrock and Databricks still serve them.
That tells us who is affected, and it is not nobody: a request to api.anthropic.com for a retired model gets an error rather than a mispriced bill, but the bundled table is Host: "*" — it prices on model name regardless of endpoint. So a Bedrock or Databricks user running claude-opus-4-1 keeps running it, at $15/Mtok, and would be charged $4.
It also means the pruned rate is still correct for whoever can still call the model. This is not stale data; it is data upstream stopped carrying for one endpoint.
Suggested fix
Have Entries union the new snapshot with the exact rows the table already carried, so an upstream pruning cannot downgrade a model to its family glob. "Never forget a rate we once knew."
The policy question that needs deciding first, and the reason this is an issue rather than a PR:
- How long is a retired rate trusted? It is right until the vendor reprices a model they no longer sell on that endpoint — unlikely, but unbounded. Options: keep forever; keep with the commit it was last seen in, so the table records its own staleness; or expire after N refreshes.
- Where does a kept row live? Carrying it in the generated file needs the generator to read its own previous output, which is a new input to a transform whose reproducibility is currently its selling point (
TestBundled_MatchesSnapshotre-runs it over the snapshot and compares). A separate checked-in "retained rates" file keeps the transform pure. - Should provenance distinguish them? A rate upstream no longer publishes is arguably weaker than one it does, and
Provenancealready exists to express that.
Meanwhile
- The pin stays where it is; the suite is green.
- Codex is priced by a
pricing:entry instead — documented indocs/agents/codex.md, verified end to end ($0.000335 on a real turn). - Anyone needing one of the 21 pruned models priced can do the same, and a configured entry always beats the bundled table.
Also worth knowing
The reverse hazard exists too: a bump also gains 15 models, and any that are dearer than ~$100/Mtok are dropped by pricing.BundleableRate — see #1406. So a refresh can change coverage in both directions, which strengthens the case for the diff being inspectable rather than trusted.
Refs #1365, #1406, #942.
Assisted-By: Claude (Anthropic AI) [email protected]
- Lenguaje dominante
- Go
- Estrellas
- 18
- Forks
- 42
- Merge medio
- 12 h 20 min
- PR fusionados (30 d)
- 229
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rossoctl/cortex
-
UI shows costs for all sessions even when drilled into a sessionPosiblemente ocupada @esnible la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rossoctl/cortex#1116 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
enhancement laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 40/100
Los mantenedores suelen responder en 1 día
-
Decouple plugins from Go pipeline internals: parser test data, session facts, serializable recordsAbiertoenhancement laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
enhancement laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Feed recording, sessions and cost through one input that does not depend on the Go listenersAbiertoenhancement laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
[flaky test] TestValidatorCommitterDropsEmptyStatusBatch: submits to the mock VC before its stream is registeredPosiblemente ocupada @liran-funaro la tomó hoy. Abiertocoordinator flaky-test race-condition testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
hyperledger/fabric-x-committer#876 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
garethgeorge/backrest#1426 ·
Los mantenedores suelen responder en 1 día
-
enhancement nav-pilot
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
valkey-io/valkey-operator#549 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
kind/features
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
TencentBlueKing/bk-nodemgr#3804 ·
Los mantenedores suelen responder en 1 día