Skip to content

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

Closed
gambletan wants to merge 1 commit into
BerriAI:mainfrom
gambletan:fix/wandb-model-prices
Closed

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

Conversation

@gambletan

Copy link
Copy Markdown
Contributor

Summary

  • Fixes all 13 wandb model entries in model_prices_and_context_window_backup.json where input_cost_per_token and output_cost_per_token were ~100,000x too high
  • Prices were in per-1M-token format instead of per-token format (e.g., Llama-3.3-70B-Instruct was 0.071 instead of 7.1e-07)
  • wandb/moonshotai/Kimi-K2-Instruct was already correct and left unchanged

Fixes #23503

Affected models

Model Field Before After
Qwen3-235B-A22B-Instruct-2507 input/output 0.01 / 0.01 1e-07 / 1e-07
Qwen3-235B-A22B-Thinking-2507 input/output 0.01 / 0.01 1e-07 / 1e-07
Qwen3-Coder-480B-A35B-Instruct input/output 0.1 / 0.15 1e-06 / 1.5e-06
DeepSeek-R1-0528 input/output 0.135 / 0.54 1.35e-06 / 5.4e-06
DeepSeek-V3-0324 input/output 0.114 / 0.275 1.14e-06 / 2.75e-06
DeepSeek-V3.1 input/output 0.055 / 0.165 5.5e-07 / 1.65e-06
Llama-3.1-8B-Instruct input/output 0.022 / 0.022 2.2e-07 / 2.2e-07
Llama-3.3-70B-Instruct input/output 0.071 / 0.071 7.1e-07 / 7.1e-07
Llama-4-Scout-17B-16E-Instruct input/output 0.017 / 0.066 1.7e-07 / 6.6e-07
Phi-4-mini-instruct input/output 0.008 / 0.035 8e-08 / 3.5e-07
gpt-oss-120b input/output 0.015 / 0.06 1.5e-07 / 6e-07
gpt-oss-20b input/output 0.005 / 0.02 5e-08 / 2e-07
GLM-4.5 input/output 0.055 / 0.2 5.5e-07 / 2e-06

Test plan

  • Verified corrected prices match wandb pricing page (e.g., Llama-3.3-70B at $0.71/M tokens = 7.1e-07 per token)
  • Verified corrected prices align with same models on other providers (e.g., azure_ai/Llama-3.3-70B-Instruct at 7.1e-07)
  • Confirmed wandb/moonshotai/Kimi-K2-Instruct was already correct and unchanged

All 13 wandb model entries (except Kimi-K2-Instruct which was already
correct) had input_cost_per_token and output_cost_per_token values
that were ~100,000x too high. The prices appeared to be in
per-1M-token format rather than per-token format.

For example, Llama-3.3-70B-Instruct was listed at 0.071 per token
instead of 7.1e-07 per token ($0.71 per 1M tokens).

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:46am

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 pricing data for 13 WandB-hosted models in model_prices_and_context_window_backup.json, where input_cost_per_token and output_cost_per_token values were ~100,000x too large (stored as whole-dollar per-million-token amounts instead of fractional per-single-token amounts). The wandb corrections are mathematically consistent (each old value divided by exactly 100,000) and align with the prices shown on the WandB inference pricing page.

Key observations:

  • Wandb price fixes are correct: All 13 updated entries divide the old value by 100,000 consistently (e.g., 0.0717.1e-07 for Llama-3.3-70B-Instruct). wandb/moonshotai/Kimi-K2-Instruct is correctly left untouched.
  • Unrelated vertex_ai/gemini-embedding-2-preview changes: The diff also resolves a duplicate entry for this model, but in doing so silently drops multimodal cost fields (input_cost_per_audio_per_second, input_cost_per_image, input_cost_per_video_per_second) and replaces the Vertex AI pricing source with the Gemini API docs URL. This is unrelated to the stated PR goal and could affect multimodal billing calculations for Vertex AI embedding calls.
  • No source fields added: The wandb entries don't include a source URL. Adding a reference to https://wandb.ai/site/pricing/inference/ would help future maintainers verify these values.
  • Minor JSON formatting change: A supported_regions array for an unrelated model is reformatted from inline to multi-line — cosmetic only.

Confidence Score: 4/5

  • Safe to merge after confirming the unintended vertex_ai/gemini-embedding-2-preview multimodal pricing removal is intentional.
  • The wandb pricing corrections are mathematically accurate and well-verified by the author. The only concern is the unrelated removal of multimodal cost fields for vertex_ai/gemini-embedding-2-preview, which could silently cause zero-cost billing for multimodal embedding calls on Vertex AI. Once that is addressed or confirmed intentional, the PR is safe to merge.
  • litellm/model_prices_and_context_window_backup.json — specifically the vertex_ai/gemini-embedding-2-preview entry around line 14529.

Important Files Changed

Filename Overview
litellm/model_prices_and_context_window_backup.json Correctly divides all 13 wandb model prices by 100,000 to fix per-token amounts; also contains unrelated changes to vertex_ai/gemini-embedding-2-preview (deduplication + removal of multimodal pricing fields) and a JSON formatting tweak.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WandB Pricing Page<br/>$/M tokens] -->|÷ 1,000,000| B[Correct per-token price<br/>e.g. 7.1e-07]
    C[Old entries<br/>e.g. 0.071] -->|Were 100,000x too high| D[Wrong: interpreted as<br/>dollars per token]
    B --> E[Updated 13 wandb entries<br/>in model_prices_and_context_window_backup.json]
    F[wandb/moonshotai/Kimi-K2-Instruct] -->|Already correct — unchanged| E
    E --> G[LiteLLM cost calculation<br/>input_cost_per_token × n_tokens]
Loading

Last reviewed commit: 52cde5c

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.

Unrelated change removes multimodal pricing for vertex_ai/gemini-embedding-2-preview

This PR's stated purpose is to fix wandb model pricing, but this hunk also overwrites the vertex_ai/gemini-embedding-2-preview entry in a way that drops the multimodal cost fields that were present before:

"input_cost_per_audio_per_second": 0.00016,
"input_cost_per_image": 0.00012,
"input_cost_per_video_per_second": 0.00079,

It also changes the input_cost_per_token from 2e-07 (sourced from Google Cloud Vertex AI pricing) to 1.5e-07 (sourced from the Gemini API docs) and points the source URL to the Gemini API documentation instead of the Vertex AI pricing page. For a vertex_ai/-prefixed model entry, the Vertex AI pricing source is the authoritative reference. Removing the audio/image/video cost fields could silently cause zero-cost billing for multimodal embedding calls on Vertex AI.

Please confirm whether these changes are intentional and, if so, document the reasoning. If they were accidentally included (e.g. picked up from a rebase/merge), consider reverting them to keep this PR focused.

@MattFisher

Copy link
Copy Markdown

FYI the price for azure_ai/jais-30b-chat is also incorrect. It's listed as $0.00971/$0.0032 per token but the reference I found says Output is $0.00971 per 1000 tokens and Input is $0.0032 per 1000 tokens.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: wandb cost data is incorrect

3 participants