Skip to content

Conversation

@KevinZhao
Copy link

@KevinZhao KevinZhao commented Oct 21, 2025

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔀 Description of Change

Added support for the latest Claude 4.5 models on AWS Bedrock:

Model Bank (packages/model-bank/src/aiModels/bedrock.ts):

  • Claude Sonnet 4.5 (us.anthropic.claude-sonnet-4-5-20250929-v1:0)

    • 200K context window, 64K max output
    • Pricing: $3/$15 per million tokens (input/output)
    • Capabilities: Function calling, reasoning, structured output, vision
    • Released: 2025-09-29
  • Claude Haiku 4.5 (us.anthropic.claude-haiku-4-5-20251001-v1:0)

    • 200K context window, 64K max output
    • Pricing: $1/$5 per million tokens (input/output)
    • Capabilities: Function calling, reasoning, structured output, vision
    • Released: 2025-10-15

API Constants (packages/const/src/models.ts):

  • Added Bedrock model IDs to contextCachingModels set for cache support
  • Added Bedrock model IDs to thinkingWithToolClaudeModels set for reasoning capabilities

Parameter Resolver (packages/model-runtime/src/core/parameterResolver.ts):

  • Extended MODEL_PARAMETER_CONFLICTS to include the new model IDs

Note: As per reviewer feedback, removed the model provider configuration from src/config/modelProviders/bedrock.ts. The model definitions remain in the model bank and can be enabled once needed.

📝 Additional Information

These are the latest Claude 4.5 series models available on AWS Bedrock. The models are fully defined in the model bank with complete specifications, pricing, and capabilities. They can be activated in the provider configuration when ready for production use.

@vercel
Copy link

vercel bot commented Oct 21, 2025

Someone is attempting to deploy a commit to the LobeHub Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 21, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 21, 2025

Reviewer's Guide

Adds support for Anthropic’s Claude Sonnet 4.5 and Claude Haiku 4.5 by defining them in the model bank, exposing them through the Bedrock provider UI, and updating constant ID sets for caching, tooling, and parameter resolution.

ER diagram for updated model ID sets for caching and tooling

erDiagram
    CONTEXT_CACHING_MODELS {
        string id
    }
    THINKING_WITH_TOOL_CLAUDE_MODELS {
        string id
    }
    CONTEXT_CACHING_MODELS ||--o| "Claude Sonnet 4.5" : contains
    CONTEXT_CACHING_MODELS ||--o| "Claude Haiku 4.5" : contains
    THINKING_WITH_TOOL_CLAUDE_MODELS ||--o| "Claude Sonnet 4.5" : contains
    THINKING_WITH_TOOL_CLAUDE_MODELS ||--o| "Claude Haiku 4.5" : contains
    "Claude Sonnet 4.5" {
        string id
    }
    "Claude Haiku 4.5" {
        string id
    }
Loading

File-Level Changes

Change Details Files
Register new Bedrock models in model bank
  • Added AIChatModelCard entry for Claude Sonnet 4.5 with abilities, context window, pricing, and metadata
  • Added AIChatModelCard entry for Claude Haiku 4.5 with similar configuration
packages/model-bank/src/aiModels/bedrock.ts
Expose new models in Bedrock provider config
  • Inserted provider entries for Claude Sonnet 4.5 and Haiku 4.5 with displayName, IDs, token limits, and feature flags
src/config/modelProviders/bedrock.ts
Include new model IDs in constant sets
  • Extended contextCachingModels to include Sonnet 4.5 and Haiku 4.5 IDs
  • Extended thinkingWithToolClaudeModels likewise
  • Added Haiku 4.5 ID to MODEL_PARAMETER_CONFLICTS alongside Sonnet entries
packages/const/src/models.ts
packages/model-runtime/src/core/parameterResolver.ts

Possibly linked issues

  • #Issue: The PR adds Claude 4.5 Sonnet and Haiku models to AWS Bedrock, which directly fulfills the issue's request to add Claude 4 models.
  • #Claude 4.5 from bedrock not working.: The PR adds Claude 4.5 models to Bedrock and includes updates to parameterResolver.ts to prevent the temperature and top_p parameter conflict reported in the issue for these models.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gru-agent
Copy link
Contributor

gru-agent bot commented Oct 21, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail b8d7415 ✅ Finished

History Assignment

Files

File Pull Request
packages/model-runtime/src/core/parameterResolver.ts ❌ Failed (I failed to setup the environment.)

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@lobehubbot
Copy link
Member

👍 @KevinZhao

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.

@dosubot dosubot bot added the Model Provider Model provider related label Oct 21, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider centralizing the new model metadata (IDs, flags, pricing, etc.) into a shared constant to avoid manual duplication across model-bank, config, and const files.
  • I noticed structuredOutput and reasoning flags are set in model-bank but not in the modelProviders/bedrock.ts entries; please ensure feature flags are consistently applied across both listings.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider centralizing the new model metadata (IDs, flags, pricing, etc.) into a shared constant to avoid manual duplication across model-bank, config, and const files.
- I noticed `structuredOutput` and `reasoning` flags are set in model-bank but not in the `modelProviders/bedrock.ts` entries; please ensure feature flags are consistently applied across both listings.

## Individual Comments

### Comment 1
<location> `packages/model-runtime/src/core/parameterResolver.ts:266` </location>
<code_context>
     'claude-opus-4-20250514',
     'claude-sonnet-4-20250514',
     'claude-sonnet-4-5-20250929',
+    'claude-haiku-4-5-20251001',
     // Bedrock model IDs
     'anthropic.claude-opus-4-1-20250805-v1:0',
</code_context>

<issue_to_address>
**issue:** The model ID 'claude-haiku-4-5-20251001' is added without a ':v1:0' suffix, unlike other IDs.

Please update the model ID to match the format used for other entries to avoid potential lookup or parameter issues.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Removed Claude Sonnet 4.5 and Claude Haiku 4.5 model configurations from the Bedrock provider config file as per reviewer request.

The model definitions remain in the model bank (packages/model-bank/src/aiModels/bedrock.ts) and can be enabled once needed.
@arvinxx arvinxx changed the title ✨ feat: add new bedrock model support 💄 style: add new bedrock model support Oct 23, 2025
@vercel
Copy link

vercel bot commented Oct 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lobehub-lite Ready Ready Preview Comment Oct 23, 2025 1:58am

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.54%. Comparing base (e9de9e3) to head (b1d7916).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9826      +/-   ##
==========================================
- Coverage   84.55%   84.54%   -0.01%     
==========================================
  Files         943      944       +1     
  Lines       64465    64510      +45     
  Branches     9534     9307     -227     
==========================================
+ Hits        54508    54543      +35     
- Misses       9957     9967      +10     
Flag Coverage Δ
app 80.20% <ø> (-0.02%) ⬇️
database 98.51% <ø> (ø)
packages/agent-runtime 99.63% <ø> (+<0.01%) ⬆️
packages/context-engine 93.51% <ø> (-0.03%) ⬇️
packages/electron-server-ipc 93.76% <ø> (ø)
packages/file-loaders 92.21% <ø> (ø)
packages/model-bank 100.00% <ø> (ø)
packages/model-runtime 92.16% <100.00%> (+0.01%) ⬆️
packages/prompts 77.21% <ø> (ø)
packages/python-interpreter 96.50% <ø> (ø)
packages/utils 94.50% <ø> (ø)
packages/web-crawler 97.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 74.88% <ø> (+0.01%) ⬆️
Services 61.64% <ø> (-0.07%) ⬇️
Server 77.39% <ø> (ø)
Libs 50.82% <ø> (ø)
Utils 75.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Model Provider Model provider related size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants