Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 2374475

Browse files
authored
Merge pull request #107 from Not-Diamond/ENG-3725_add-support-claue-haiku-4.5
feat: Add support for claude-haiku-4.5 model
2 parents 46eaac3 + 484eff2 commit 2374475

5 files changed

Lines changed: 368 additions & 0 deletions

File tree

notdiamond/llms/providers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class NDLLMProviders(Enum):
4444
CLAUDE_SONNET_4_20250514 (NDLLMProvider): refers to 'claude-sonnet-4-20250514' model by Anthropic
4545
CLAUDE_SONNET_4_5 (NDLLMProvider): refers to 'claude-sonnet-4-5' model by Anthropic
4646
CLAUDE_SONNET_4_5_20250929 (NDLLMProvider): refers to 'claude-sonnet-4-5-20250929' model by Anthropic
47+
CLAUDE_HAIKU_4_5 (NDLLMProvider): refers to 'claude-haiku-4-5' model by Anthropic
48+
CLAUDE_HAIKU_4_5_20251001 (NDLLMProvider): refers to 'claude-haiku-4-5-20251001' model by Anthropic
4749
CLAUDE_OPUS_4_0 (NDLLMProvider): refers to 'claude-opus-4-0' model by Anthropic
4850
CLAUDE_OPUS_4_1 (NDLLMProvider): refers to 'claude-opus-4-1' model by Anthropic
4951
CLAUDE_SONNET_4_0 (NDLLMProvider): refers to 'claude-sonnet-4-0' model by Anthropic
@@ -134,6 +136,8 @@ class NDLLMProviders(Enum):
134136
CLAUDE_SONNET_4_20250514 = ("anthropic", "claude-sonnet-4-20250514")
135137
CLAUDE_SONNET_4_5 = ("anthropic", "claude-sonnet-4-5")
136138
CLAUDE_SONNET_4_5_20250929 = ("anthropic", "claude-sonnet-4-5-20250929")
139+
CLAUDE_HAIKU_4_5 = ("anthropic", "claude-haiku-4-5")
140+
CLAUDE_HAIKU_4_5_20251001 = ("anthropic", "claude-haiku-4-5-20251001")
137141
CLAUDE_OPUS_4_0 = ("anthropic", "claude-opus-4-0")
138142
CLAUDE_OPUS_4_1 = ("anthropic", "claude-opus-4-1")
139143
CLAUDE_SONNET_4_0 = ("anthropic", "claude-sonnet-4-0")

notdiamond/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
"claude-sonnet-4-20250514",
159159
"claude-sonnet-4-5",
160160
"claude-sonnet-4-5-20250929",
161+
"claude-haiku-4-5",
162+
"claude-haiku-4-5-20251001",
161163
"claude-opus-4-0",
162164
"claude-opus-4-1",
163165
"claude-sonnet-4-0",
@@ -178,6 +180,8 @@
178180
"claude-sonnet-4-20250514",
179181
"claude-sonnet-4-5",
180182
"claude-sonnet-4-5-20250929",
183+
"claude-haiku-4-5",
184+
"claude-haiku-4-5-20251001",
181185
"claude-opus-4-0",
182186
"claude-opus-4-1",
183187
"claude-sonnet-4-0",
@@ -201,6 +205,8 @@
201205
"claude-sonnet-4-20250514": "anthropic/claude-sonnet-4",
202206
"claude-sonnet-4-5": "anthropic/claude-sonnet-4-5",
203207
"claude-sonnet-4-5-20250929": "anthropic/claude-sonnet-4-5",
208+
"claude-haiku-4-5": "anthropic/claude-haiku-4-5",
209+
"claude-haiku-4-5-20251001": "anthropic/claude-haiku-4-5",
204210
"claude-opus-4-0": "anthropic/claude-opus-4",
205211
"claude-opus-4-1": "anthropic/claude-opus-4-1",
206212
"claude-sonnet-4-0": "anthropic/claude-sonnet-4",
@@ -221,6 +227,8 @@
221227
"claude-sonnet-4-20250514": {"input": 3.0, "output": 15.0},
222228
"claude-sonnet-4-5": {"input": 3.0, "output": 15.0},
223229
"claude-sonnet-4-5-20250929": {"input": 3.0, "output": 15.0},
230+
"claude-haiku-4-5": {"input": 1.0, "output": 5.0},
231+
"claude-haiku-4-5-20251001": {"input": 1.0, "output": 5.0},
224232
"claude-opus-4-0": {"input": 15.0, "output": 75.0},
225233
"claude-opus-4-1": {"input": 15.0, "output": 75.0},
226234
"claude-sonnet-4-0": {"input": 3.0, "output": 15.0},
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
interactions:
2+
- request:
3+
body: '{"messages": [{"role": "user", "content": "How much is 3 + 5?"}], "llm_providers":
4+
[{"provider": "anthropic", "model": "claude-haiku-4-5", "is_custom": false,
5+
"context_length": null, "input_price": null, "output_price": null, "latency":
6+
null}], "metric": "accuracy", "max_model_depth": 1, "hash_content": true, "tools":
7+
[{"type": "function", "function": {"name": "add_fct", "description": "Add two
8+
numbers", "parameters": {"type": "object", "properties": {"a": {"type": "integer",
9+
"description": "The first number"}, "b": {"type": "integer", "description":
10+
"The second number"}}, "required": ["a", "b"]}}}]}'
11+
headers:
12+
Accept:
13+
- '*/*'
14+
Accept-Encoding:
15+
- gzip, deflate, zstd
16+
Connection:
17+
- keep-alive
18+
Content-Length:
19+
- '607'
20+
User-Agent:
21+
- Python-SDK/0.4.6
22+
content-type:
23+
- application/json
24+
method: POST
25+
uri: https://staging-api.notdiamond.ai/v2/modelRouter/modelSelect
26+
response:
27+
body:
28+
string: '{"providers":[{"provider":"anthropic","model":"claude-haiku-4-5"}],"session_id":"9b1fd830-46af-4d40-9721-a435b3563d42"}'
29+
headers:
30+
CF-RAY:
31+
- 9922d1537e1bf3a9-OTP
32+
Connection:
33+
- keep-alive
34+
Content-Type:
35+
- application/json
36+
Date:
37+
- Tue, 21 Oct 2025 18:28:58 GMT
38+
Server:
39+
- cloudflare
40+
Transfer-Encoding:
41+
- chunked
42+
alt-svc:
43+
- h3=":443"; ma=86400
44+
cf-cache-status:
45+
- DYNAMIC
46+
content-length:
47+
- '119'
48+
rndr-id:
49+
- 9496ca26-7e0a-4223
50+
vary:
51+
- Accept-Encoding
52+
x-render-origin-server:
53+
- uvicorn
54+
x-request-id:
55+
- 9496ca26-7e0a-4223
56+
status:
57+
code: 200
58+
message: OK
59+
- request:
60+
body: '{"max_tokens":200,"messages":[{"role":"user","content":"How much is 3 +
61+
5?"}],"model":"claude-haiku-4-5","tools":[{"name":"add_fct","description":"Add
62+
two numbers","input_schema":{"type":"object","properties":{"a":{"type":"integer","description":"The
63+
first number"},"b":{"type":"integer","description":"The second number"}},"required":["a","b"]}}]}'
64+
headers:
65+
accept:
66+
- application/json
67+
accept-encoding:
68+
- gzip, deflate, zstd
69+
anthropic-version:
70+
- '2023-06-01'
71+
connection:
72+
- keep-alive
73+
content-length:
74+
- '348'
75+
content-type:
76+
- application/json
77+
host:
78+
- api.anthropic.com
79+
user-agent:
80+
- Anthropic/Python 0.49.0
81+
x-api-key:
82+
- REDACTED
83+
x-stainless-arch:
84+
- arm64
85+
x-stainless-async:
86+
- 'false'
87+
x-stainless-lang:
88+
- python
89+
x-stainless-os:
90+
- MacOS
91+
x-stainless-package-version:
92+
- 0.49.0
93+
x-stainless-read-timeout:
94+
- '120.0'
95+
x-stainless-retry-count:
96+
- '0'
97+
x-stainless-runtime:
98+
- CPython
99+
x-stainless-runtime-version:
100+
- 3.11.12
101+
x-stainless-timeout:
102+
- NOT_GIVEN
103+
method: POST
104+
uri: https://api.anthropic.com/v1/messages
105+
response:
106+
body:
107+
string: '{"model":"claude-haiku-4-5-20251001","id":"msg_01GB5sj9VwhFkt3jJpSoGtA3","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01G8aqFJ7t4jw7uC3GYe2DBD","name":"add_fct","input":{"a":3,"b":5}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":594,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":72,"service_tier":"standard"}}'
108+
headers:
109+
CF-RAY:
110+
- 9922d15cfb11a051-OTP
111+
Connection:
112+
- keep-alive
113+
Content-Type:
114+
- application/json
115+
Date:
116+
- Tue, 21 Oct 2025 18:29:00 GMT
117+
Server:
118+
- cloudflare
119+
Transfer-Encoding:
120+
- chunked
121+
X-Robots-Tag:
122+
- none
123+
anthropic-organization-id:
124+
- a2610b2c-742e-455d-9552-6abe105b2a44
125+
anthropic-ratelimit-input-tokens-limit:
126+
- '4000000'
127+
anthropic-ratelimit-input-tokens-remaining:
128+
- '4000000'
129+
anthropic-ratelimit-input-tokens-reset:
130+
- '2025-10-21T18:29:00Z'
131+
anthropic-ratelimit-output-tokens-limit:
132+
- '800000'
133+
anthropic-ratelimit-output-tokens-remaining:
134+
- '800000'
135+
anthropic-ratelimit-output-tokens-reset:
136+
- '2025-10-21T18:29:00Z'
137+
anthropic-ratelimit-requests-limit:
138+
- '4000'
139+
anthropic-ratelimit-requests-remaining:
140+
- '3999'
141+
anthropic-ratelimit-requests-reset:
142+
- '2025-10-21T18:28:59Z'
143+
anthropic-ratelimit-tokens-limit:
144+
- '4800000'
145+
anthropic-ratelimit-tokens-remaining:
146+
- '4800000'
147+
anthropic-ratelimit-tokens-reset:
148+
- '2025-10-21T18:29:00Z'
149+
cf-cache-status:
150+
- DYNAMIC
151+
content-length:
152+
- '477'
153+
request-id:
154+
- req_011CULpP6uopMpyFxSpH2Fu1
155+
strict-transport-security:
156+
- max-age=31536000; includeSubDomains; preload
157+
via:
158+
- 1.1 google
159+
x-envoy-upstream-service-time:
160+
- '1589'
161+
status:
162+
code: 200
163+
message: OK
164+
version: 1
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
interactions:
2+
- request:
3+
body: '{"messages": [{"role": "user", "content": "How much is 3 + 5?"}], "llm_providers":
4+
[{"provider": "anthropic", "model": "claude-haiku-4-5", "is_custom": false,
5+
"context_length": null, "input_price": null, "output_price": null, "latency":
6+
null}], "metric": "accuracy", "max_model_depth": 1, "hash_content": true, "tools":
7+
[{"type": "function", "function": {"name": "add_fct", "description": "Adds a
8+
and b.", "parameters": {"properties": {"a": {"type": "integer"}, "b": {"type":
9+
"integer"}}, "required": ["a", "b"], "type": "object"}}}]}'
10+
headers:
11+
Accept:
12+
- '*/*'
13+
Accept-Encoding:
14+
- gzip, deflate, zstd
15+
Connection:
16+
- keep-alive
17+
Content-Length:
18+
- '534'
19+
User-Agent:
20+
- Python-SDK/0.4.6
21+
content-type:
22+
- application/json
23+
method: POST
24+
uri: https://staging-api.notdiamond.ai/v2/modelRouter/modelSelect
25+
response:
26+
body:
27+
string: '{"providers":[{"provider":"anthropic","model":"claude-haiku-4-5"}],"session_id":"0799fd13-6c94-48de-be45-9e0ef632d9f1"}'
28+
headers:
29+
CF-RAY:
30+
- 9922d0c68ce0e44f-OTP
31+
Connection:
32+
- keep-alive
33+
Content-Type:
34+
- application/json
35+
Date:
36+
- Tue, 21 Oct 2025 18:28:36 GMT
37+
Server:
38+
- cloudflare
39+
Transfer-Encoding:
40+
- chunked
41+
alt-svc:
42+
- h3=":443"; ma=86400
43+
cf-cache-status:
44+
- DYNAMIC
45+
content-length:
46+
- '119'
47+
rndr-id:
48+
- 056d6954-bc6d-4d9e
49+
vary:
50+
- Accept-Encoding
51+
x-render-origin-server:
52+
- uvicorn
53+
x-request-id:
54+
- 056d6954-bc6d-4d9e
55+
status:
56+
code: 200
57+
message: OK
58+
- request:
59+
body: '{"max_tokens":200,"messages":[{"role":"user","content":"How much is 3 +
60+
5?"}],"model":"claude-haiku-4-5","tools":[{"name":"add_fct","description":"Adds
61+
a and b.","input_schema":{"properties":{"a":{"type":"integer"},"b":{"type":"integer"}},"required":["a","b"],"type":"object"}}]}'
62+
headers:
63+
accept:
64+
- application/json
65+
accept-encoding:
66+
- gzip, deflate, zstd
67+
anthropic-version:
68+
- '2023-06-01'
69+
connection:
70+
- keep-alive
71+
content-length:
72+
- '279'
73+
content-type:
74+
- application/json
75+
host:
76+
- api.anthropic.com
77+
user-agent:
78+
- Anthropic/Python 0.49.0
79+
x-api-key:
80+
- REDACTED
81+
x-stainless-arch:
82+
- arm64
83+
x-stainless-async:
84+
- 'false'
85+
x-stainless-lang:
86+
- python
87+
x-stainless-os:
88+
- MacOS
89+
x-stainless-package-version:
90+
- 0.49.0
91+
x-stainless-read-timeout:
92+
- '120.0'
93+
x-stainless-retry-count:
94+
- '0'
95+
x-stainless-runtime:
96+
- CPython
97+
x-stainless-runtime-version:
98+
- 3.11.12
99+
x-stainless-timeout:
100+
- NOT_GIVEN
101+
method: POST
102+
uri: https://api.anthropic.com/v1/messages
103+
response:
104+
body:
105+
string: '{"model":"claude-haiku-4-5-20251001","id":"msg_01ULxjzUy4U6U9KeHvYdx6gS","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01ViL4AbgWuXv3xjasgXknxD","name":"add_fct","input":{"a":3,"b":5}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":580,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":72,"service_tier":"standard"}}'
106+
headers:
107+
CF-RAY:
108+
- 9922d0cfae42c9c7-OTP
109+
Connection:
110+
- keep-alive
111+
Content-Type:
112+
- application/json
113+
Date:
114+
- Tue, 21 Oct 2025 18:28:37 GMT
115+
Server:
116+
- cloudflare
117+
Transfer-Encoding:
118+
- chunked
119+
X-Robots-Tag:
120+
- none
121+
anthropic-organization-id:
122+
- a2610b2c-742e-455d-9552-6abe105b2a44
123+
anthropic-ratelimit-input-tokens-limit:
124+
- '4000000'
125+
anthropic-ratelimit-input-tokens-remaining:
126+
- '4000000'
127+
anthropic-ratelimit-input-tokens-reset:
128+
- '2025-10-21T18:28:37Z'
129+
anthropic-ratelimit-output-tokens-limit:
130+
- '800000'
131+
anthropic-ratelimit-output-tokens-remaining:
132+
- '800000'
133+
anthropic-ratelimit-output-tokens-reset:
134+
- '2025-10-21T18:28:37Z'
135+
anthropic-ratelimit-requests-limit:
136+
- '4000'
137+
anthropic-ratelimit-requests-remaining:
138+
- '3999'
139+
anthropic-ratelimit-requests-reset:
140+
- '2025-10-21T18:28:36Z'
141+
anthropic-ratelimit-tokens-limit:
142+
- '4800000'
143+
anthropic-ratelimit-tokens-remaining:
144+
- '4800000'
145+
anthropic-ratelimit-tokens-reset:
146+
- '2025-10-21T18:28:37Z'
147+
cf-cache-status:
148+
- DYNAMIC
149+
content-length:
150+
- '477'
151+
request-id:
152+
- req_011CULpMSFbGcB6DKdBDFAE1
153+
strict-transport-security:
154+
- max-age=31536000; includeSubDomains; preload
155+
via:
156+
- 1.1 google
157+
x-envoy-upstream-service-time:
158+
- '1045'
159+
status:
160+
code: 200
161+
message: OK
162+
version: 1

0 commit comments

Comments
 (0)