Skip to content

fix: correct wandb model prices (off by 100,000x) - #23517

Closed
gambletan wants to merge 1 commit into
BerriAI:mainfrom
gambletan:fix/wandb-pricing-100000x
Closed

fix: correct wandb model prices (off by 100,000x)#23517
gambletan wants to merge 1 commit into
BerriAI:mainfrom
gambletan:fix/wandb-pricing-100000x

Conversation

@gambletan

Copy link
Copy Markdown
Contributor

Summary

Fixes #23503

All 13 wandb model entries in model_prices_and_context_window_backup.json had input_cost_per_token and output_cost_per_token values 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:

  • Before: input_cost_per_token: 0.071 (= $71,000/1M tokens)
  • After: 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-Instruct at 6e-07) was left unchanged.

Models fixed (13 total)

Model Input (before → after) Output (before → after)
openai/gpt-oss-120b 0.015 → 1.5e-07 0.06 → 6e-07
openai/gpt-oss-20b 0.005 → 5e-08 0.02 → 2e-07
zai-org/GLM-4.5 0.055 → 5.5e-07 0.2 → 2e-06
Qwen/Qwen3-235B-A22B-Instruct-2507 0.01 → 1e-07 0.01 → 1e-07
Qwen/Qwen3-Coder-480B-A35B-Instruct 0.1 → 1e-06 0.15 → 1.5e-06
Qwen/Qwen3-235B-A22B-Thinking-2507 0.01 → 1e-07 0.01 → 1e-07
meta-llama/Llama-3.1-8B-Instruct 0.022 → 2.2e-07 0.022 → 2.2e-07
deepseek-ai/DeepSeek-V3.1 0.055 → 5.5e-07 0.165 → 1.65e-06
deepseek-ai/DeepSeek-R1-0528 0.135 → 1.35e-06 0.54 → 5.4e-06
deepseek-ai/DeepSeek-V3-0324 0.114 → 1.14e-06 0.275 → 2.75e-06
meta-llama/Llama-3.3-70B-Instruct 0.071 → 7.1e-07 0.071 → 7.1e-07
meta-llama/Llama-4-Scout-17B-16E-Instruct 0.017 → 1.7e-07 0.066 → 6.6e-07
microsoft/Phi-4-mini-instruct 0.008 → 8e-08 0.035 → 3.5e-07

Test plan

  • Verified corrected values match wandb pricing page
  • Confirmed wandb/moonshotai/Kimi-K2-Instruct was already correct and left unchanged
  • JSON file parses correctly after changes

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
@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 13, 2026 5:35am

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects a significant pricing bug where all 13 wandb model entries in model_prices_and_context_window_backup.json had input_cost_per_token and output_cost_per_token values that were 100,000× too high (stored as dollars-per-million-tokens instead of dollars-per-token). The wandb price corrections are directionally correct and verified against the wandb pricing page.

However, the PR also contains changes beyond its stated scope:

  • Undocumented vertex_ai/gemini-embedding-2-preview modifications: Multimodal pricing fields (input_cost_per_audio_per_second, input_cost_per_image, input_cost_per_video_per_second) are removed and the base token cost is changed from 2e-07 to 1.5e-07 with a new source URL. This is not mentioned in the PR description or title and could silently break multimodal cost calculations for users of this embedding model.

  • Floating-point precision artifacts: Four of the 13 corrected wandb values were computed via division rather than being written directly, resulting in imprecise representations like 2.1999999999999998e-07 (should be 2.2e-07), 2.7500000000000004e-06, 1.7000000000000001e-07, and 3.5000000000000004e-07. These should be rounded to clean values to match the precision stated in the PR table.

Confidence Score: 3/5

  • PR is safe to merge for the wandb price fixes, but the undocumented vertex_ai/gemini-embedding-2-preview changes warrant verification before merging.
  • The core wandb price corrections are correct and well-verified. However, the undocumented removal of multimodal pricing fields for vertex_ai/gemini-embedding-2-preview is a potentially breaking change for users computing multimodal embedding costs, and the floating-point artifacts in 4 values reduce data quality. These issues lower confidence from what would otherwise be a straightforward data fix.
  • Pay close attention to the vertex_ai/gemini-embedding-2-preview entry in litellm/model_prices_and_context_window_backup.json — the removal of multimodal pricing fields is undocumented and potentially breaking.

Important Files Changed

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]
Loading

Last reviewed commit: b1ba4c3

Comment on lines +31491 to +31492
"input_cost_per_token": 2.1999999999999998e-07,
"output_cost_per_token": 2.1999999999999998e-07,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:314912.1999999999999998e-07 (Llama-3.1-8B input)
  • litellm/model_prices_and_context_window_backup.json:314922.1999999999999998e-07 (Llama-3.1-8B output)
  • litellm/model_prices_and_context_window_backup.json:315192.7500000000000004e-06 (DeepSeek-V3-0324 output)
  • litellm/model_prices_and_context_window_backup.json:315361.7000000000000001e-07 (Llama-4-Scout input)
  • litellm/model_prices_and_context_window_backup.json:315463.5000000000000004e-07 (Phi-4-mini output)

These should be rounded to the same precision used in the PR description's table:

Suggested change
"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,

Comment on lines 14529 to 14540
"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
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Removes multimodal pricing fieldsinput_cost_per_audio_per_second: 0.00016, input_cost_per_image: 0.00012, and input_cost_per_video_per_second: 0.00079 are dropped. Any code path that uses get_model_info to calculate multimodal embedding costs for this model will silently return None/0 instead of the correct cost.

  2. Changes input_cost_per_token from 2e-07 to 1.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: wandb cost data is incorrect

2 participants