Update dependencies and refresh model pricing for 2026-05#15
Merged
mattgodbolt merged 1 commit intomainfrom May 6, 2026
Merged
Update dependencies and refresh model pricing for 2026-05#15mattgodbolt merged 1 commit intomainfrom
mattgodbolt merged 1 commit intomainfrom
Conversation
- Bump all runtime and dev dependencies to current latest, notably
anthropic 0.83 -> 0.100, fastapi 0.129 -> 0.136, pydantic 2.12 -> 2.13,
starlette 0.52 -> 1.0, boto3 1.42 -> 1.43.
- Refresh MODEL_FAMILIES against the current Anthropic price list:
- Add Opus 4.7 at the new $5/$25 tier with 1M context.
- Move Opus 4.5 and 4.6 to the same $5/$25 tier (previously $15/$75).
- Drop retired families (Opus 3, Haiku 3, Sonnet 3.5, Sonnet 3.7) from
the lookup; the regex normaliser still parses them so callers get a
clear "not found" error rather than a misleading price.
- Update tests to cover the new Opus 4.6/4.7 pricing and to assert that
retired families are explicitly rejected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mattgodbolt
approved these changes
May 6, 2026
There was a problem hiding this comment.
Pull request overview
Updates the project’s Python dependencies and refreshes Anthropic Claude model pricing metadata to match the current published price tiers, with corresponding test updates to validate the new pricing and retired-model behavior.
Changes:
- Bumped runtime/dev dependencies in
pyproject.tomlto newer versions (notably Anthropic SDK and FastAPI stack). - Updated
MODEL_FAMILIESpricing (Opus 4.5+ moved to $5/$25 tier; added Opus 4.7; removed retired families). - Updated tests to validate new Opus/Sonnet pricing and ensure retired families raise explicit “not found” errors.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pyproject.toml |
Updates dependency minimum versions for runtime and dev tooling. |
app/model_costs.py |
Refreshes the hand-maintained Claude model family pricing table and related notes. |
app/test_model_costs.py |
Updates/extends tests to cover new pricing tiers and retired model family rejection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # - Opus 4.5+ moved to a new lower price tier ($5/$25) and now bundle the 1M | ||
| # context window at flat rates. Opus 4.1 and earlier remain at the old | ||
| # $15/$75 pricing until retirement. | ||
| # - Sonnet 4.x stays at $3/$15 with 1M context included on 4.6. |
| get_model_cost("claude-3-opus-20240229") | ||
| with pytest.raises(ValueError, match=r"Model family 'haiku-3' not found"): | ||
| get_model_cost("claude-3-haiku-20240307") | ||
| with pytest.raises(ValueError, match=r"Model family 'sonnet-3.5' not found"): |
| with pytest.raises(ValueError, match=r"Model family 'haiku-3' not found"): | ||
| get_model_cost("claude-3-haiku-20240307") | ||
| with pytest.raises(ValueError, match=r"Model family 'sonnet-3.5' not found"): | ||
| get_model_cost("claude-3-5-sonnet-20241022") |
There was a problem hiding this comment.
This retired-model test omits Sonnet 3.7 even though the pricing table removes it and the normalizer still parses it. Add an assertion that looking up a Sonnet 3.7 model name raises the same “not found” error to fully cover the retired-family behavior.
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
anthropic 0.83 → 0.100,fastapi 0.129 → 0.136,pydantic 2.12 → 2.13,starlette 0.52 → 1.0,boto3 1.42 → 1.43).MODEL_FAMILIESagainst the current Anthropic price list (pricing docs):$5/$25tier (also 1M context).$5/$25tier — previously priced at the old$15/$75.Anthropic still does not publish a programmatic pricing endpoint, so the table remains hand-maintained. The
/v1/modelsendpoint exposes capabilities and display names but no prices; if we ever want to automate this, LiteLLM'smodel_prices_and_context_window_backup.jsonis the most actively-maintained third-party source.Test plan
uv run pytest(92 tests pass)uv run pre-commit run --all-files./test-explain.shafter merge🤖 Generated with Claude Code