Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hirobf10
Copy link
Contributor

@hirobf10 hirobf10 commented May 23, 2025

User description

Added support for Claude Ops 4 and Claude Sonnet 4.
I updated the version of anthropic sdk to 0.52.0 because those models are available from the version.

Glad to any comments.


PR Type

Enhancement, Dependencies


Description

  • Added support for Claude 4 Opus and Sonnet models

    • Included new model keys for Vertex AI, Anthropic, and Bedrock
    • Updated token limits for new models
  • Upgraded Anthropics SDK to version 0.52.0


Changes walkthrough 📝

Relevant files
Enhancement
__init__.py
Add Claude 4 Opus and Sonnet model support with token limits

pr_agent/algo/init.py

  • Added Claude Opus 4 and Claude Sonnet 4 model keys for Vertex AI,
    Anthropic, and Bedrock
  • Set token limits for new models (200,000 tokens)
  • Ensured new models are included in model-token mapping
  • +6/-0     
    Dependencies
    requirements.txt
    Upgrade Anthropics SDK to version 0.52.0                                 

    requirements.txt

    • Updated Anthropics SDK version requirement to >=0.52.0
    +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-merge-for-open-source
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    @qodo-merge-for-open-source
    Copy link
    Contributor

    qodo-merge-for-open-source bot commented May 23, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix inconsistent token limit
    Suggestion Impact:The commit directly implemented the suggested change, updating the token limit for 'bedrock/anthropic.claude-opus-4-20250514-v1:0' from 100,000 to 200,000 tokens as recommended. The commit also added additional related model configurations with 200,000 token limits.

    code diff:

    -    'bedrock/anthropic.claude-opus-4-20250514-v1:0': 100000,
    +    'bedrock/anthropic.claude-opus-4-20250514-v1:0': 200000,

    The token limit for Claude Opus 4 on Bedrock is set to 100,000 tokens, but
    elsewhere in the code it's set to 200,000 tokens. This inconsistency could cause
    issues with token management. Update the token limit to match the 200,000 value
    used for other Claude 4 models.

    pr_agent/algo/init.py [90]

    -'bedrock/anthropic.claude-opus-4-20250514-v1:0': 100000,
    +'bedrock/anthropic.claude-opus-4-20250514-v1:0': 200000,

    [Suggestion processed]

    Suggestion importance[1-10]: 8

    __

    Why: The suggestion correctly identifies and resolves an inconsistency in the token limit for the bedrock/anthropic.claude-opus-4-20250514-v1:0 model, aligning it with the 200,000 token limit used for other Claude 4 models. This change is important for consistent model configuration and prevents potential issues with token management.

    Medium
    • Update
    • Author self-review: I have reviewed the PR code suggestions, and addressed the relevant ones.

    @KennyDizi
    Copy link
    Contributor

    @hirobf10, you should update litellm to v1.70.4, moreover.

    @hirobf10
    Copy link
    Contributor Author

    @KennyDizi
    Thank you for your comment! I updated litellm.

    @Wadu436
    Copy link

    Wadu436 commented May 23, 2025

    @hirobf10 you should add the bedrock/us.anthropic.claude-opus-4-20250514-v1:0 and bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 inference profiles. Also I believe Opus 4 on Bedrock can also take 200k tokens context? Right now it's 100k in your MR.

    @hirobf10
    Copy link
    Contributor Author

    hirobf10 commented May 24, 2025

    @Wadu436
    Thank you for the comment. Your are right.
    I will reflect your comment to this PR.

    @mrT23
    Copy link
    Collaborator

    mrT23 commented May 24, 2025

    thanks for the PR (and the QA :-) )

    @mrT23
    Copy link
    Collaborator

    mrT23 commented May 24, 2025

    p.s.
    Sonnet 4.0 is an improvement.
    The Opus one is a disappointment for reviewing code.

    https://www.linkedin.com/posts/activity-7331397694835372034-6Qp6?utm_source=share&utm_medium=member_desktop&rcm=ACoAAADfWaEBcq5zNjFdWTCE2n4ApCwveqK0I-4

    @mrT23 mrT23 merged commit f4a9bc3 into qodo-ai:main May 24, 2025
    2 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants