Skip to content

Commit 9bcc95e

Browse files
feat: Add Claude Haiku 4.5 model support across all demos (#299)
* feat: add Claude Haiku 4.5 model support across all demos - Add HAIKU_4_5 model configuration to Computer Use Demo - Add provider-specific model strings for Bedrock and Vertex - Update model dropdowns in Customer Support and Financial Data Analyst - Set Claude Haiku 4.5 as default in Customer Support Agent - Document available models in Agents module - Update README with Claude 4.5 Haiku availability Model IDs: - Anthropic API: claude-haiku-4-5-20251001 - AWS Bedrock: anthropic.claude-haiku-4-5-20251001-v1:0 - Google Vertex: claude-haiku-4-5@20251001 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs: update Claude model naming conventions in README Update model naming to follow proper conventions: - Claude 4+ models: Claude [model] [version] (e.g., Claude Sonnet 4.5) - Pre-4 models: Claude [version] [model] (e.g., Claude 3.5 Sonnet) This ensures consistency with Anthropic's official naming standards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 38391da commit 9bcc95e

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

agents/agent.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
class ModelConfig:
1919
"""Configuration settings for Claude model parameters."""
2020

21+
# Available models include:
22+
# - claude-sonnet-4-20250514 (default)
23+
# - claude-opus-4-20250514
24+
# - claude-haiku-4-5-20251001
25+
# - claude-3-5-sonnet-20240620
26+
# - claude-3-haiku-20240307
2127
model: str = "claude-sonnet-4-20250514"
2228
max_tokens: int = 4096
2329
temperature: float = 1.0

computer-use-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Anthropic Computer Use Demo
22

33
> [!NOTE]
4-
> Now featuring support for the new Claude 4 models! The latest Claude 4.5 Sonnet (claude-sonnet-4-5-20250929) is now the default model, with Claude 4 Sonnet (claude-sonnet-4-20250514) and Claude 4 Opus (claude-opus-4-20250514) also available. These models bring next-generation capabilities with the updated str_replace_based_edit_tool that replaces the previous str_replace_editor tool. The undo_edit command has been removed in this latest version for a more streamlined experience.
4+
> Now featuring support for the new Claude 4 models! The latest Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) is now the default model, with Claude Sonnet 4 (claude-sonnet-4-20250514), Claude Opus 4 (claude-opus-4-20250514), and the new Claude Haiku 4.5 (claude-haiku-4-5-20251001) also available. These models bring next-generation capabilities with the updated str_replace_based_edit_tool that replaces the previous str_replace_editor tool. The undo_edit command has been removed in this latest version for a more streamlined experience.
55
66
> [!CAUTION]
77
> Computer use is a beta feature. Please be aware that computer use poses unique risks that are distinct from standard API features or chat interfaces. These risks are heightened when using computer use to interact with the internet. To minimize risks, consider taking precautions such as:
@@ -18,7 +18,7 @@
1818
This repository helps you get started with computer use on Claude, with reference implementations of:
1919

2020
- Build files to create a Docker container with all necessary dependencies
21-
- A computer use agent loop using the Claude API, Bedrock, or Vertex to access Claude 3.5 Sonnet, Claude 3.7 Sonnet, Claude 4 Sonnet, and Claude 4 Opus models
21+
- A computer use agent loop using the Claude API, Bedrock, or Vertex to access Claude 3.5 Sonnet, Claude 3.7 Sonnet, Claude Sonnet 4, Claude Opus 4, and Claude Haiku 4.5 models
2222
- Anthropic-defined computer use tools
2323
- A streamlit app for interacting with the agent loop
2424

computer-use-demo/computer_use_demo/streamlit.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,22 @@ class ModelConfig:
7373
has_thinking=True,
7474
)
7575

76+
HAIKU_4_5 = ModelConfig(
77+
tool_version="computer_use_20250124",
78+
max_output_tokens=1024 * 8,
79+
default_output_tokens=1024 * 4,
80+
has_thinking=False,
81+
)
82+
7683
MODEL_TO_MODEL_CONF: dict[str, ModelConfig] = {
7784
"claude-3-7-sonnet-20250219": SONNET_3_7,
7885
"claude-opus-4@20250508": CLAUDE_4,
7986
"claude-sonnet-4-20250514": CLAUDE_4,
8087
"claude-sonnet-4-5-20250929": CLAUDE_4_5,
8188
"claude-opus-4-20250514": CLAUDE_4,
89+
"claude-haiku-4-5-20251001": HAIKU_4_5,
90+
"anthropic.claude-haiku-4-5-20251001-v1:0": HAIKU_4_5, # Bedrock
91+
"claude-haiku-4-5@20251001": HAIKU_4_5, # Vertex
8292
}
8393

8494
CONFIG_DIR = PosixPath("~/.anthropic").expanduser()

customer-support-agent/components/ChatArea.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function ChatArea() {
302302
const [input, setInput] = useState("");
303303
const [isLoading, setIsLoading] = useState(false);
304304
const [showHeader, setShowHeader] = useState(false);
305-
const [selectedModel, setSelectedModel] = useState("claude-3-haiku-20240307");
305+
const [selectedModel, setSelectedModel] = useState("claude-haiku-4-5-20251001");
306306
const [showAvatar, setShowAvatar] = useState(false);
307307

308308
const messagesEndRef = useRef<HTMLDivElement>(null);
@@ -317,6 +317,7 @@ function ChatArea() {
317317

318318
const models: Model[] = [
319319
{ id: "claude-3-haiku-20240307", name: "Claude 3 Haiku" },
320+
{ id: "claude-haiku-4-5-20251001", name: "Claude 4.5 Haiku" },
320321
{ id: "claude-3-5-sonnet-20240620", name: "Claude 3.5 Sonnet" },
321322
];
322323

financial-data-analyst/app/finance/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ interface FileUpload {
7171

7272
const models: Model[] = [
7373
{ id: "claude-3-haiku-20240307", name: "Claude 3 Haiku" },
74+
{ id: "claude-haiku-4-5-20251001", name: "Claude 4.5 Haiku" },
7475
{ id: "claude-3-5-sonnet-20240620", name: "Claude 3.5 Sonnet" },
7576
];
7677

0 commit comments

Comments
 (0)