fix: claude-sonnet-5 intro pricing 2/10 (0.39.20) - #17
Merged
Conversation
Dashboard overstated Claude Sonnet 5 cost by 50%. Anthropic's official
intro price is 2/10 USD/MTok (cache_read 0.20, cache_write 2.50) through
2026-08-31; sticker is 3/15. The bundled LiteLLM seed already carries the
intro rate, but a curated exact pin + 5 edge-patch tables forced 3/15.
- Drop the curated exact `claude-sonnet-5` pin (+ its now-dead fuzzy rule):
the src path falls through to the seed's exact entry (matcher step 2) at
2/10 and will auto-track LiteLLM's revert to 3/15 after the intro window,
no manual edit needed.
- Update the 5 dashboard/edge-patches MODEL_PRICING tables to 2/10 (edge
patches don't read the seed). These are hardcoded and must be reverted
manually after 2026-08-31 — dated reminder added to curated-overrides
_meta.sonnet5_intro_price_expiry (mirrors the deepseek expiry convention).
- Regression tests: pricing.test.js asserts claude-sonnet-5 resolves to
2/10 (computeRowCost 3.725, not 5.5875); edge-patch-pricing-sync asserts
the parsed value equals 2/10/0.2/2.5 across all 5 tables.
- Version bump 0.39.19 -> 0.39.20 (source only; npm publish separate).
Verified: getModelPricing('claude-sonnet-5')=2/10 against real seed;
node --test 55/55, vitest 7/7, validators clean.
Closes #16
pitimon
pushed a commit
that referenced
this pull request
Jul 4, 2026
prepublishOnly regenerated the LiteLLM seed during npm publish; commit so the repo matches the published tarball (per npm-publish-checklist). Diff is timestamp-only (_meta.generated_at); 2471 models unchanged, no rate changes. claude-sonnet-5 stays at the intro 2/10 that PR #17 relies on.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude-sonnet-5pin (+ its now-dead fuzzy rule): the src path falls through to the seed's exact entry (matcher.jsstep 2) at 2/10 and auto-tracks LiteLLM's revert to 3/15 after the intro window — no manual edit needed for the runtime billing path.dashboard/edge-patchesMODEL_PRICING tables to 2/10 (edge patches don't read the seed). These are hardcoded → dated reminder added tocurated-overrides.json_meta.sonnet5_intro_price_expiry(mirrors the existing deepseek expiry convention) so the post-2026-08-31 manual revert isn't forgotten.Test plan
getModelPricing('claude-sonnet-5')→{input:2, output:10, cache_read:0.2, cache_write:2.5}against the real bundled seed (not just fixture)node --test test/pricing.test.js test/model-breakdown.test.js test/edge-patch-pricing-sync.test.js— 55/55 (new: sonnet-5 resolves 2/10, computeRowCost 3.725; edge-patch value assertion 2/10 across all 5 tables)npx vitest run UsageOverview DataDetails— 7/7validate:copy/validate:ui-hardcode/validate:guardrails— cleanKnown follow-up (tracked in-repo)
_meta.sonnet5_intro_price_expiryflags the 2026-08-31 cutover: src path self-reverts (reads seed), but the 5 edge patches must be reverted to 3/15 manually + seed re-vendored. Asymmetry is intentional (edge patches can't read the seed) and now documented.Closes #16