Skip to content

Update dependencies and refresh model pricing for 2026-05#15

Merged
mattgodbolt merged 1 commit intomainfrom
update-deps-and-pricing-2026-05
May 6, 2026
Merged

Update dependencies and refresh model pricing for 2026-05#15
mattgodbolt merged 1 commit intomainfrom
update-deps-and-pricing-2026-05

Conversation

@mattgodbolt-molty
Copy link
Copy Markdown
Contributor

Summary

  • 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 (pricing docs):
    • Add Opus 4.7 at the new $5/$25 tier (also 1M context).
    • Move Opus 4.5 and Opus 4.6 to the same $5/$25 tier — previously priced at the old $15/$75.
    • Drop retired families (Opus 3, Haiku 3, Sonnet 3.5, Sonnet 3.7) from the price table. The regex normaliser still parses their names so callers get an explicit "not found" error rather than a stale price.
  • Update tests to cover the new Opus 4.6/4.7 pricing and to assert that retired families are explicitly rejected.

Anthropic still does not publish a programmatic pricing endpoint, so the table remains hand-maintained. The /v1/models endpoint exposes capabilities and display names but no prices; if we ever want to automate this, LiteLLM's model_prices_and_context_window_backup.json is the most actively-maintained third-party source.

Test plan

  • uv run pytest (92 tests pass)
  • uv run pre-commit run --all-files
  • Smoke-test against the live API with ./test-explain.sh after merge

🤖 Generated with Claude Code

- 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 mattgodbolt requested a review from Copilot May 6, 2026 18:29
@mattgodbolt mattgodbolt merged commit 703b046 into main May 6, 2026
4 checks passed
@mattgodbolt mattgodbolt deleted the update-deps-and-pricing-2026-05 branch May 6, 2026 18:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.toml to newer versions (notably Anthropic SDK and FastAPI stack).
  • Updated MODEL_FAMILIES pricing (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.

Comment thread app/model_costs.py
# - 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.
Comment thread app/test_model_costs.py
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"):
Comment thread app/test_model_costs.py
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")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

3 participants