Skip to content

feat: support claude-sonnet-4-5-20250929 - #1924

Merged
seefs001 merged 5 commits into
QuantumNous:alphafrom
prnake:claude-4-5
Sep 30, 2025
Merged

feat: support claude-sonnet-4-5-20250929#1924
seefs001 merged 5 commits into
QuantumNous:alphafrom
prnake:claude-4-5

Conversation

@prnake

@prnake prnake commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added support for Claude Sonnet 4.5 (20250929) and its Thinking variant.
    • Enabled on multiple providers, including AWS and Vertex AI.
    • Cross-region availability enabled in US, EU, and AP regions.
  • Chores

    • Updated default cache and create-cache ratios for the new models.
    • Updated model routing ratios to include the new models.

@coderabbitai

coderabbitai Bot commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds new Claude model identifiers (claude-sonnet-4-5-20250929 and its -thinking variant) across providers and settings: updates AWS and Vertex model mappings, extends AWS cross-region allowances, updates Claude channel model list, and adjusts cache/model ratio maps.

Changes

Cohort / File(s) Summary
AWS model mappings and regions
relay/channel/aws/constants.go
Mapped claude-sonnet-4-5-20250929 to anthropic.claude-sonnet-4-5-20250929-v1:0; allowed cross-region use in us, ap, eu.
Claude channel model list
relay/channel/claude/constants.go
Added claude-sonnet-4-5-20250929 and claude-sonnet-4-5-20250929-thinking to ModelList.
Vertex model mapping
relay/channel/vertex/adaptor.go
Added mapping: claude-sonnet-4-5-20250929claude-sonnet-4-5@20250929.
Cache ratios for new models
setting/ratio_setting/cache_ratio.go
Added default cache ratios and create-cache ratios for the two new models, matching existing peers.
Model ratio update
setting/ratio_setting/model_ratio.go
Added claude-sonnet-4-5-20250929 with ratio 1.5 to defaultModelRatio.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

New sonnets hop across the sky,
Mapped in clouds where regions lie.
Vertex hums, AWS replies—
Ratios set, the caches rise.
A rabbit stamps a tiny paw:
“New models in, no extra flaw.” 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change of the pull request, which is adding support for the new “claude-sonnet-4-5-20250929” model, and uses a conventional commit prefix to indicate it’s a feature addition.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bb4b64 and d7db30a.

📒 Files selected for processing (5)
  • relay/channel/aws/constants.go (2 hunks)
  • relay/channel/claude/constants.go (1 hunks)
  • relay/channel/vertex/adaptor.go (1 hunks)
  • setting/ratio_setting/cache_ratio.go (2 hunks)
  • setting/ratio_setting/model_ratio.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-05T17:14:17.246Z
Learnt from: neotf
PR: QuantumNous/new-api#1511
File: setting/ratio_setting/model_ratio.go:118-123
Timestamp: 2025-08-05T17:14:17.246Z
Learning: Claude models handle "-thinking" variants differently from Gemini models. For Claude models, only the base model (without "-thinking") gets an entry in defaultModelRatio map. The "-thinking" variants rely on the Claude relay handler stripping the suffix using strings.TrimSuffix(textRequest.Model, "-thinking") before looking up the ratio, so they automatically use the base model's ratio.

Applied to files:

  • setting/ratio_setting/model_ratio.go
🔇 Additional comments (7)
setting/ratio_setting/model_ratio.go (1)

144-144: LGTM! Correctly follows Claude model ratio pattern.

The addition of the base model entry without a separate "-thinking" variant is correct. Based on learnings, Claude's relay handler strips the "-thinking" suffix before lookup, so the thinking variant will automatically use this base ratio.

relay/channel/claude/constants.go (1)

22-23: LGTM! Model identifiers added correctly.

Both the base model and thinking variant are properly added to the ModelList, consistent with the existing pattern for Claude Sonnet 4 models.

relay/channel/vertex/adaptor.go (1)

40-40: LGTM! Vertex AI model mapping added correctly.

The mapping follows the established pattern, converting the model identifier to Vertex AI's naming convention (replacing date hyphens with @).

relay/channel/aws/constants.go (2)

19-19: LGTM! AWS model ID mapping added correctly.

The mapping follows the established naming pattern for Anthropic Claude models on AWS Bedrock.


73-77: LGTM! Cross-region configuration is appropriate.

The regional availability (us, ap, eu) matches other Claude Sonnet 4 models, providing consistent multi-region support.

setting/ratio_setting/cache_ratio.go (2)

55-56: LGTM! Cache ratio entries added correctly.

Both the base model and thinking variant entries are properly added with consistent ratios (0.1), matching the pattern of other Claude Sonnet 4 models.


74-75: LGTM! Create cache ratio entries added correctly.

Both entries use the standard 1.25 ratio, consistent with other Claude models in the create cache configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@neotf neotf left a comment

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.

LGTM

@seefs001
seefs001 changed the base branch from main to alpha September 30, 2025 01:25
@seefs001
seefs001 merged commit 3154440 into QuantumNous:alpha Sep 30, 2025
1 check passed
@coderabbitai coderabbitai Bot mentioned this pull request Feb 6, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Apr 16, 2026
11 tasks
x22x22 pushed a commit to x22x22/new-api that referenced this pull request Apr 24, 2026
feat: support claude-sonnet-4-5-20250929
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.

5 participants