fix: correct wandb model prices (off by 100,000x) - #23517
Conversation
All 13 wandb model entries had input_cost_per_token and output_cost_per_token values that were 100,000x too high. For example, Llama-3.3-70B-Instruct was listed at 0.071 per token but should be 7.1e-07 (matching the wandb pricing page of $0.71/1M tokens). The one exception was wandb/moonshotai/Kimi-K2-Instruct which already had correct values. Fixes BerriAI#23503
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Greptile SummaryThis PR corrects a significant pricing bug where all 13 wandb model entries in However, the PR also contains changes beyond its stated scope:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| litellm/model_prices_and_context_window_backup.json | Corrects 13 wandb model prices (100,000× reduction), but also includes undocumented changes to vertex_ai/gemini-embedding-2-preview (removes multimodal pricing fields, changes token cost and source URL) and introduces floating-point precision artifacts in 4 of the 13 corrected wandb entries. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[model_prices_and_context_window_backup.json] --> B{Provider}
B -->|wandb - 13 models| C[Price Correction Applied\n÷ 100,000]
B -->|vertex_ai/gemini-embedding-2-preview| D[Deduplicated Entry\nUndocumented changes]
C --> E[Clean values\ne.g. 7.1e-07, 1.35e-06]
C --> F[⚠️ Precision artifacts\ne.g. 2.1999999999999998e-07]
D --> G[✅ Duplicate key resolved]
D --> H[⚠️ Multimodal pricing fields removed\ninput_cost_per_audio_per_second\ninput_cost_per_image\ninput_cost_per_video_per_second]
D --> I[⚠️ input_cost_per_token changed\n2e-07 → 1.5e-07]
Last reviewed commit: b1ba4c3
| "input_cost_per_token": 2.1999999999999998e-07, | ||
| "output_cost_per_token": 2.1999999999999998e-07, |
There was a problem hiding this comment.
Floating-point precision artifacts
Several corrected values contain floating-point representation artifacts rather than clean scientific notation. These arise from computing 0.022 / 100000, 0.275 / 100000, 0.017 / 100000, and 0.035 / 100000 in floating-point arithmetic. While technically equivalent, the noisy representations reduce readability and make future diffs harder to review.
The same issue also appears at:
litellm/model_prices_and_context_window_backup.json:31491–2.1999999999999998e-07(Llama-3.1-8B input)litellm/model_prices_and_context_window_backup.json:31492–2.1999999999999998e-07(Llama-3.1-8B output)litellm/model_prices_and_context_window_backup.json:31519–2.7500000000000004e-06(DeepSeek-V3-0324 output)litellm/model_prices_and_context_window_backup.json:31536–1.7000000000000001e-07(Llama-4-Scout input)litellm/model_prices_and_context_window_backup.json:31546–3.5000000000000004e-07(Phi-4-mini output)
These should be rounded to the same precision used in the PR description's table:
| "input_cost_per_token": 2.1999999999999998e-07, | |
| "output_cost_per_token": 2.1999999999999998e-07, | |
| "input_cost_per_token": 2.2e-07, | |
| "output_cost_per_token": 2.2e-07, |
| "vertex_ai/gemini-embedding-2-preview": { | ||
| "input_cost_per_audio_per_second": 0.00016, | ||
| "input_cost_per_image": 0.00012, | ||
| "input_cost_per_token": 2e-07, | ||
| "input_cost_per_video_per_second": 0.00079, | ||
| "input_cost_per_token": 1.5e-07, | ||
| "litellm_provider": "vertex_ai", | ||
| "max_input_tokens": 8192, | ||
| "max_tokens": 8192, | ||
| "mode": "embedding", | ||
| "output_cost_per_token": 0, | ||
| "output_vector_size": 3072, | ||
| "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", | ||
| "source": "https://ai.google.dev/gemini-api/docs/embeddings#multimodal", | ||
| "supports_multimodal": true, | ||
| "uses_embed_content": true | ||
| }, |
There was a problem hiding this comment.
Undocumented vertex_ai/gemini-embedding-2-preview changes
This PR fixes wandb prices, but it also silently modifies vertex_ai/gemini-embedding-2-preview in two ways that are not mentioned in the PR description or title:
-
Removes multimodal pricing fields —
input_cost_per_audio_per_second: 0.00016,input_cost_per_image: 0.00012, andinput_cost_per_video_per_second: 0.00079are dropped. Any code path that usesget_model_infoto calculate multimodal embedding costs for this model will silently returnNone/0instead of the correct cost. -
Changes
input_cost_per_tokenfrom2e-07to1.5e-07— a ~25% price reduction with no cited justification in the PR (the source URL also changes from the Vertex AI pricing page to the Gemini API docs).
These look like they may be side effects of resolving a duplicate-key situation in the JSON (there were previously two "vertex_ai/gemini-embedding-2-preview" entries). If the intent is to consolidate to the second entry's values, please document this in the PR description and confirm whether removing the multimodal pricing fields is intentional.
Summary
Fixes #23503
All 13 wandb model entries in
model_prices_and_context_window_backup.jsonhadinput_cost_per_tokenandoutput_cost_per_tokenvalues that were 100,000x too high. The prices appeared to be in dollars-per-million-tokens rather than dollars-per-token.For example,
wandb/meta-llama/Llama-3.3-70B-Instruct:input_cost_per_token: 0.071(= $71,000/1M tokens)input_cost_per_token: 7.1e-07(= $0.71/1M tokens, matching wandb pricing page)The one model that already had correct values (
wandb/moonshotai/Kimi-K2-Instructat6e-07) was left unchanged.Models fixed (13 total)
Test plan
wandb/moonshotai/Kimi-K2-Instructwas already correct and left unchanged