Skip to content

Commit f31353a

Browse files
committed
Accounted for Anthropic's Haiku 3 deprecation
1 parent cd8ab45 commit f31353a

11 files changed

+398
-424
lines changed

packages/lmi/src/lmi/llms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,19 @@ class CommonLLMNames(StrEnum):
136136
GPT_4O = "gpt-4o-2024-11-20"
137137
GPT_35_TURBO = "gpt-3.5-turbo-0125"
138138
CLAUDE_37_SONNET = "claude-3-7-sonnet-20250219"
139+
CLAUDE_46_OPUS = "claude-opus-4-6"
140+
CLAUDE_46_SONNET = "claude-sonnet-4-6"
141+
CLAUDE_45_OPUS = "claude-opus-4-5-20251101"
139142
CLAUDE_45_SONNET = "claude-sonnet-4-5-20250929"
143+
CLAUDE_45_HAIKU = "claude-haiku-4-5-20251001"
140144

141145
# Use these when trying to think of a somewhat opinionated default
142146
OPENAI_BASELINE = "gpt-4o-2024-11-20" # Fast and decent
143147

144148
# Use these in unit testing
145149
OPENAI_TEST = "gpt-4o-mini-2024-07-18" # Cheap, fast, and not OpenAI's cutting edge
146150
ANTHROPIC_TEST = ( # Cheap, fast, and not Anthropic's cutting edge
147-
"claude-3-5-haiku-20241022"
151+
"claude-haiku-4-5-20251001"
148152
)
149153

150154

packages/lmi/tests/cassettes/TestCostTrackerCallback.test_cost_tracking_with_streaming_modes[claude-3-5-haiku-20241022-True].yaml

Lines changed: 0 additions & 146 deletions
This file was deleted.

packages/lmi/tests/cassettes/TestCostTrackerCallback.test_cost_tracking_with_streaming_modes[claude-3-5-haiku-20241022-False].yaml renamed to packages/lmi/tests/cassettes/TestCostTrackerCallback.test_cost_tracking_with_streaming_modes[claude-haiku-4-5-20251001-False].yaml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
interactions:
22
- request:
33
body:
4-
'{"model":"claude-3-5-haiku-20241022","messages":[{"role":"user","content":[{"type":"text","text":"Say
5-
hello"}]}],"temperature":1.0,"max_tokens":4096}'
4+
'{"model":"claude-haiku-4-5-20251001","messages":[{"role":"user","content":[{"type":"text","text":"Say
5+
hello"}]}],"temperature":1.0,"max_tokens":64000}'
66
headers:
77
accept:
88
- application/json
@@ -13,76 +13,77 @@ interactions:
1313
connection:
1414
- keep-alive
1515
content-length:
16-
- "149"
16+
- "150"
1717
content-type:
1818
- application/json
1919
host:
2020
- api.anthropic.com
2121
user-agent:
22-
- litellm/1.74.15.post2
22+
- litellm/1.81.12
2323
method: POST
2424
uri: https://api.anthropic.com/v1/messages
2525
response:
2626
body:
2727
string: !!binary |
28-
H4sIAAAAAAAAA3SQS2vDMBCE/4o7Zxlsp4FGl55CQ6GFQG+lCGEttoi8cvRoa4L/e3Fo6IueFuab
29-
GZY5wRpIDLFTVf2YJt7ap33c7UPHD/ebFd/dHCGQppEWF8WoO4JA8G4RdIw2Js0JAoM35CDROp0N
30-
latyXfbaHnLZVM11XTUNBFrPiThBPp8unYnel/T5SOzIOX9V7PxboQMVk8+F8Za7Inmjp1vMLwIx
31-
+VEF0tEzJIiNSjkwPkGkYyZuCZKzcwL5/LE8wfKYk0r+QBwhNwKtbntSbSCdrGf1k1cXHkib/9gl
32-
u9TT2NNAQTu1Hv76v2jd/6azgM/pu1TXApHCq21JJUsBEsvKRgeDef4AAAD//wMAOCJWH7MBAAA=
28+
H4sIAAAAAAAA/3WRTWrDMBCFr6JqbYMd4kC9KZQs0kUK2RVKEao0iUVkjSuNkobgE3TVE/SKPUKl
29+
0NA/upJ435vRvNGR96jB8pYrK6OGspNmG8tp2ZSTatLUVVXzghudDH3YiKpeLZWfXzd3NFtOb7tp
30+
3M/Xq0DJQ4cBsgtCkBtIgkebBRmCCSRd9ih0BOnW3h/PfoLnU3U+Wr4Aa/GCvb+9vrAF7pmSjt2w
31+
DuzADhgZoZaHKz4+FDwQDsKDDOhSHTgtKHrHP0GApwhOpQdctLbg8TRTe+TGDZEE4RZc4O1lGkmq
32+
DoRKncigEz95deYJ6//YuTa3h6GDHry0oun/+r9o3f2mY8Ex0nepnqUw4HdGgSADPsXMe9TS6/wl
33+
bg0+RxQbwIQckpA7aax8TGsfxw8csOpt2QEAAA==
3334
headers:
3435
CF-RAY:
35-
- 9880ea5a9d9a234f-SJC
36+
- 9d0905154903f64e-SJC
3637
Connection:
3738
- keep-alive
3839
Content-Encoding:
3940
- gzip
41+
Content-Security-Policy:
42+
- default-src 'none'; frame-ancestors 'none'
4043
Content-Type:
4144
- application/json
4245
Date:
43-
- Thu, 02 Oct 2025 02:54:30 GMT
46+
- Thu, 19 Feb 2026 21:57:26 GMT
4447
Server:
4548
- cloudflare
4649
Transfer-Encoding:
4750
- chunked
48-
Via:
49-
- 1.1 google
5051
X-Robots-Tag:
5152
- none
5253
anthropic-organization-id:
5354
- f2c99ed9-038a-406f-9cb5-1f840b758a20
5455
anthropic-ratelimit-input-tokens-limit:
55-
- "5000000"
56+
- "4000000"
5657
anthropic-ratelimit-input-tokens-remaining:
57-
- "5000000"
58+
- "4000000"
5859
anthropic-ratelimit-input-tokens-reset:
59-
- "2025-10-02T02:54:30Z"
60+
- "2026-02-19T21:57:26Z"
6061
anthropic-ratelimit-output-tokens-limit:
61-
- "1000000"
62+
- "800000"
6263
anthropic-ratelimit-output-tokens-remaining:
63-
- "1000000"
64+
- "800000"
6465
anthropic-ratelimit-output-tokens-reset:
65-
- "2025-10-02T02:54:30Z"
66+
- "2026-02-19T21:57:26Z"
6667
anthropic-ratelimit-requests-limit:
67-
- "5000"
68+
- "4000"
6869
anthropic-ratelimit-requests-remaining:
69-
- "4999"
70+
- "3999"
7071
anthropic-ratelimit-requests-reset:
71-
- "2025-10-02T02:54:29Z"
72+
- "2026-02-19T21:57:26Z"
7273
anthropic-ratelimit-tokens-limit:
73-
- "6000000"
74+
- "4800000"
7475
anthropic-ratelimit-tokens-remaining:
75-
- "6000000"
76+
- "4800000"
7677
anthropic-ratelimit-tokens-reset:
77-
- "2025-10-02T02:54:30Z"
78+
- "2026-02-19T21:57:26Z"
7879
cf-cache-status:
7980
- DYNAMIC
8081
request-id:
81-
- req_011CThckaYWpShvVqgm7rube
82+
- req_011CYJB9qMPDBLaehHTtMkft
8283
strict-transport-security:
8384
- max-age=31536000; includeSubDomains; preload
8485
x-envoy-upstream-service-time:
85-
- "820"
86+
- "472"
8687
status:
8788
code: 200
8889
message: OK
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
interactions:
2+
- request:
3+
body:
4+
'{"model": "claude-haiku-4-5-20251001", "messages": [{"role": "user", "content":
5+
[{"type": "text", "text": "Say hello"}]}], "temperature": 1.0, "max_tokens":
6+
64000, "stream": true}'
7+
headers:
8+
accept:
9+
- application/json
10+
accept-encoding:
11+
- gzip, deflate
12+
anthropic-version:
13+
- "2023-06-01"
14+
connection:
15+
- keep-alive
16+
content-length:
17+
- "179"
18+
content-type:
19+
- application/json
20+
host:
21+
- api.anthropic.com
22+
user-agent:
23+
- litellm/1.81.12
24+
method: POST
25+
uri: https://api.anthropic.com/v1/messages
26+
response:
27+
body:
28+
string:
29+
"event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-haiku-4-5-20251001\",\"id\":\"msg_01VrWiiNHrKEEqsq4LF723wu\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":9,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":3,\"service_tier\":\"standard\",\"inference_geo\":\"not_available\"}}
30+
\ }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}
31+
\ }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata:
32+
{\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Hello!
33+
\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\U0001F44B
34+
How can I help you\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"
35+
today?\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0
36+
\ }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":9,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":16}
37+
}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"
38+
headers:
39+
CF-RAY:
40+
- 9d0905195e7112a1-SJC
41+
Cache-Control:
42+
- no-cache
43+
Connection:
44+
- keep-alive
45+
Content-Security-Policy:
46+
- default-src 'none'; frame-ancestors 'none'
47+
Content-Type:
48+
- text/event-stream; charset=utf-8
49+
Date:
50+
- Thu, 19 Feb 2026 21:57:27 GMT
51+
Server:
52+
- cloudflare
53+
Transfer-Encoding:
54+
- chunked
55+
X-Robots-Tag:
56+
- none
57+
anthropic-organization-id:
58+
- f2c99ed9-038a-406f-9cb5-1f840b758a20
59+
anthropic-ratelimit-input-tokens-limit:
60+
- "4000000"
61+
anthropic-ratelimit-input-tokens-remaining:
62+
- "4000000"
63+
anthropic-ratelimit-input-tokens-reset:
64+
- "2026-02-19T21:57:26Z"
65+
anthropic-ratelimit-output-tokens-limit:
66+
- "800000"
67+
anthropic-ratelimit-output-tokens-remaining:
68+
- "800000"
69+
anthropic-ratelimit-output-tokens-reset:
70+
- "2026-02-19T21:57:26Z"
71+
anthropic-ratelimit-requests-limit:
72+
- "4000"
73+
anthropic-ratelimit-requests-remaining:
74+
- "3999"
75+
anthropic-ratelimit-requests-reset:
76+
- "2026-02-19T21:57:26Z"
77+
anthropic-ratelimit-tokens-limit:
78+
- "4800000"
79+
anthropic-ratelimit-tokens-remaining:
80+
- "4800000"
81+
anthropic-ratelimit-tokens-reset:
82+
- "2026-02-19T21:57:26Z"
83+
cf-cache-status:
84+
- DYNAMIC
85+
request-id:
86+
- req_011CYJB9t9onN3ScnKEPtAC7
87+
strict-transport-security:
88+
- max-age=31536000; includeSubDomains; preload
89+
x-envoy-upstream-service-time:
90+
- "449"
91+
status:
92+
code: 200
93+
message: OK
94+
version: 1

0 commit comments

Comments
 (0)