AWS Blogs 05月23日 03:53
Introducing Claude 4 in Amazon Bedrock, the most powerful models for coding from Anthropic
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Anthropic发布了新一代Claude模型Opus 4和Sonnet 4,专为编码、高级推理和支持下一代自主AI代理而设计。这两款模型现已在Amazon Bedrock上全面推出,使开发人员能够立即访问其先进的推理和代理功能。Opus 4擅长处理需要长期、高语境的任务,如大型代码库重构、研究综合和跨职能企业运营。Sonnet 4针对大规模效率进行了优化,适合作为子代理或用于代码审查、错误修复和生产级内容生成等高容量任务。开发者可以通过Amazon Bedrock使用Converse API开始编码。

🚀Anthropic发布了Claude Opus 4和Sonnet 4,这两款模型都已在Amazon Bedrock上全面推出,开发者可以立即使用。

💡Claude Opus 4是Anthropic迄今为止最先进的模型,尤其擅长软件开发,可以分析技术文档、规划软件实施、编写所需代码并迭代改进,同时跟踪整个过程中的需求和架构上下文。

⚡️Claude Sonnet 4在性能、响应速度和成本之间取得了平衡,适用于高容量生产工作负载,可以进行代码审查、错误修复和新功能开发,还能驱动近乎实时的AI助手。

⚙️Opus 4和Sonnet 4提供两种模式:近乎即时的响应和用于更深入推理的扩展思考,开发者可以根据工作负载调整延迟和答案深度之间的权衡。

<section class="blog-post-content lb-rtxt"><table id="amazon-polly-audio-table"><tbody><tr><td id="amazon-polly-audio-tab"><p></p></td></tr></tbody></table><p><a href="https://www.anthropic.com/&quot;&gt;Anthropic&lt;/a&gt; launched the next generation of <a href="https://aws.amazon.com/bedrock/anthropic/&quot;&gt;Claude&lt;/a&gt; models today—Opus 4 and Sonnet 4—designed for coding, advanced reasoning, and the support of the next generation of capable, autonomous AI agents. Both models are now generally available in <a href="https://aws.amazon.com/bedrock/&quot;&gt;Amazon Bedrock</a>, giving developers immediate access to both the model’s advanced reasoning and agentic capabilities.</p><p>Amazon Bedrock expands your AI choices with Anthropic’s most advanced models, giving you the freedom to build transformative applications with <a href="https://aws.amazon.com/bedrock/security-compliance/&quot;&gt;enterprise-grade security</a> and <a href="https://aws.amazon.com/ai/responsible-ai/&quot;&gt;responsible AI</a> controls. Both models extend what’s possible with AI systems by improving task planning, tool use, and agent steerability.</p><p>With Opus 4’s advanced intelligence, you can build agents that handle long-running, high-context tasks like refactoring large codebases, synthesizing research, or coordinating cross-functional enterprise operations. Sonnet 4 is optimized for efficiency at scale, making it a strong fit as a subagent or for high-volume tasks like code reviews, bug fixes, and production-grade content generation.</p><p>When building with <a href="https://aws.amazon.com/ai/generative-ai/&quot;&gt;generative AI</a>, many developers work on long-horizon tasks. These workflows require deep, sustained reasoning, often involving multistep processes, planning across large contexts, and synthesizing diverse inputs over extended timeframes. Good examples of these workflows are developer <a href="https://aws.amazon.com/bedrock/agents/&quot;&gt;AI agents</a> that help you to refactor or transform large projects. Existing models may respond quickly and fluently, but maintaining coherence and context over time—especially in areas like coding, research, or enterprise workflows—can still be challenging.</p><p><strong>Claude Opus 4<br /></strong> Claude Opus 4 is the most advanced model to date from Anthropic, designed for building sophisticated AI agents that can reason, plan, and execute complex tasks with minimal oversight. Anthropic benchmarks show it is the best coding model available on the market today. It excels in software development scenarios where extended context, deep reasoning, and adaptive execution are critical. Developers can use Opus 4 to write and refactor code across entire projects, manage full-stack architectures, or design agentic systems that break down high-level goals into executable steps. It demonstrates <a href="https://www.anthropic.com/news/claude-4&quot;&gt;strong performance on coding and agent-focused benchmarks</a> like <a href="https://www.swebench.com/&quot;&gt;SWE-bench&lt;/a&gt; and <a href="https://github.com/sierra-research/tau-bench&quot;&gt;TAU-bench&lt;/a&gt;, making it a natural choice for building agents that handle multistep development workflows. For example, Opus 4 can analyze technical documentation, plan a software implementation, write the required code, and iteratively refine it—while tracking requirements and architectural context throughout the process.</p><p><strong>Claude Sonnet 4<br /></strong> Claude Sonnet 4 complements Opus 4 by balancing performance, responsiveness, and cost, making it well-suited for high-volume production workloads. It’s optimized for everyday development tasks with enhanced performance, such as powering code reviews, implementing bug fixes, and new feature development with immediate feedback loops. It can also power production-ready AI assistants for near real-time applications. Sonnet 4 is a drop-in replacement from Claude Sonnet 3.7. In multi-agent systems, Sonnet 4 performs well as a task-specific subagent—handling responsibilities like targeted code reviews, search and retrieval, or isolated feature development within a broader pipeline. You can also use Sonnet 4 to manage continuous integration and delivery (CI/CD) pipelines, perform bug triage, or integrate APIs, all while maintaining high throughput and developer-aligned output.</p><p>Opus 4 and Sonnet 4 are hybrid reasoning models offering two modes: near-instant responses and extended thinking for deeper reasoning. You can choose near-instant responses for interactive applications, or enable extended thinking when a request benefits from deeper analysis and planning. Thinking is especially useful for long-context reasoning tasks in areas like software engineering, math, or scientific research. By configuring the model’s thinking budget—for example, by setting a maximum token count—you can tune the tradeoff between latency and answer depth to fit your workload.</p><p><strong>How to get started<br /></strong> To see Opus 4 or Sonnet 4 in action, <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html&quot;&gt;enable the new model</a> in your AWS account. Then, you can start coding using the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html&quot;&gt;Bedrock Converse API</a> with model ID<code>anthropic.claude-opus-4-20250514-v1:0</code> for Opus 4 and <code>anthropic.claude-sonnet-4-20250514-v1:0</code> for Sonnet 4. We recommend using the Converse API, because it provides a consistent API that works with all Amazon Bedrock models that support messages. This means you can write code one time and use it with different models.</p><p>For example, let’s imagine I write an agent to review code before merging changes in a code repository. I write the following code that uses the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html&quot;&gt;Bedrock Converse API</a> to send a system and user prompts. Then, the agent consumes the streamed result.</p><pre class="lang-swift">private let modelId = "us.anthropic.claude-sonnet-4-20250514-v1:0"// Define the system prompt that instructs Claude how to respondlet systemPrompt = """You are a senior iOS developer with deep expertise in Swift, especially Swift 6 concurrency. Your job is to perform a code review focused on identifying concurrency-related edge cases, potential race conditions, and misuse of Swift concurrency primitives such as Task, TaskGroup, Sendable, @MainActor, and @preconcurrency.You should review the code carefully and flag any patterns or logic that may cause unexpected behavior in concurrent environments, such as accessing shared mutable state without proper isolation, incorrect actor usage, or non-Sendable types crossing concurrency boundaries.Explain your reasoning in precise technical terms, and provide recommendations to improve safety, predictability, and correctness. When appropriate, suggest concrete code changes or refactorings using idiomatic Swift 6"""let system: BedrockRuntimeClientTypes.SystemContentBlock = .text(systemPrompt)// Create the user message with text prompt and imagelet userPrompt = """Can you review the following Swift code for concurrency issues? Let me know what could go wrong and how to fix it."""let prompt: BedrockRuntimeClientTypes.ContentBlock = .text(userPrompt)// Create the user message with both text and image contentlet userMessage = BedrockRuntimeClientTypes.Message( content: [prompt], role: .user)// Initialize the messages array with the user messagevar messages: [BedrockRuntimeClientTypes.Message] = []messages.append(userMessage)// Configure the inference parameterslet inferenceConfig: BedrockRuntimeClientTypes.InferenceConfiguration = .init(maxTokens: 4096, temperature: 0.0)// Create the input for the Converse API with streaminglet input = ConverseStreamInput(inferenceConfig: inferenceConfig, messages: messages, modelId: modelId, system: [system])// Make the streaming requestdo { // Process the stream let response = try await bedrockClient.converseStream(input: input) // Iterate through the stream events for try await event in stream { switch event { case .messagestart: print("AI-assistant started to stream"") case let .contentblockdelta(deltaEvent): // Handle text content as it arrives if case let .text(text) = deltaEvent.delta { self.streamedResponse + = text print(text, termination: "") } case .messagestop: print("\n\nStream ended") // Create a complete assistant message from the streamed response let assistantMessage = BedrockRuntimeClientTypes.Message( content: [.text(self.streamedResponse)], role: .assistant ) messages.append(assistantMessage) default: break } }</pre><p>To help you get started, my colleague Dennis maintains a <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/service_code_examples_bedrock-runtime_anthropic_claude.html&quot;&gt;broad range of code examples</a> for multiple use cases and a variety of programming languages.</p><p><strong>Available today in Amazon Bedrock<br /></strong> This release gives developers immediate access in Amazon Bedrock, a fully managed, serverless service, to the next generation of Claude models developed by Anthropic. Whether you’re already building with Claude in Amazon Bedrock or just getting started, this seamless access makes it faster to experiment, prototype, and scale with cutting-edge foundation models—without managing infrastructure or complex integrations.</p><p>Claude Opus 4 is available in the following <a href="https://docs.aws.amazon.com/glossary/latest/reference/glos-chap.html#region&quot;&gt;AWS Regions</a> in North America: US East (Ohio, N. Virginia) and US West (Oregon). Claude Sonnet 4 is available not only in AWS Regions in North America but also in APAC, and Europe: US East (Ohio, N. Virginia), US West (Oregon), Asia Pacific (Hyderabad, Mumbai, Osaka, Seoul, Singapore, Sydney, Tokyo), and Europe (Spain). You can access the two models through <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html&quot;&gt;cross-Region inference</a>. Cross-Region inference helps to automatically select the optimal AWS Region within your geography to process your inference request.</p><p>Opus 4 tackles your most challenging development tasks, while Sonnet 4 excels at routine work with its optimal balance of speed and capability.</p><p>Learn more about the <a href="https://aws.amazon.com/bedrock/pricing/&quot;&gt;pricing&lt;/a&gt; and <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html&quot;&gt;how to use these new models in Amazon Bedrock</a> today!</p><a href="https://linktr.ee/sebsto&quot;&gt;— seb</a></section><aside id="Comments" class="blog-comments"><div data-lb-comp="aws-blog:cosmic-comments" data-env="prod" data-content-id="db067688-b411-4258-b421-1eb7b73f794e" data-title="Introducing Claude 4 in Amazon Bedrock, the most powerful models for coding from Anthropic" data-url="https://aws.amazon.com/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/&quot;&gt;&lt;p data-failed-message="Comments cannot be loaded… Please refresh and try again.">Loading comments…</p></div></aside>

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Anthropic Claude Opus 4 Claude Sonnet 4 Amazon Bedrock AI代理
相关文章