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

Commit b386d9a

Browse files
authored
Merge pull request #103 from Not-Diamond/ENG-3234_remove-sonnet-3.5-and-opus-3
refactor: Update model references and remove deprecated entries
2 parents a2bb206 + 8a272a2 commit b386d9a

30 files changed

Lines changed: 201463 additions & 2136 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ result, session_id, provider = client.chat.completions.create(
5151
{"role": "system", "content": "You are a helpful assistant."},
5252
{"role": "user", "content": "Concisely explain merge sort."} # Adjust as desired
5353
],
54-
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20240620']
54+
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-sonnet-20240229']
5555
)
5656

5757
print("ND session ID: ", session_id) # A unique ID of Not Diamond's recommendation

docs/source/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Create a new file in the same directory as your `.env` file and copy and run the
5353
{"role": "system", "content": "You are a helpful assistant."},
5454
{"role": "user", "content": "Consiely explain merge sort."} # Adjust as desired
5555
],
56-
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20240620']
56+
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-sonnet-20240229']
5757
)
5858
5959
print("ND session ID: ", session_id) # A unique ID of Not Diamond's recommendation

notdiamond/llms/providers.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class NDLLMProviders(Enum):
3232
GPT_4o_2024_11_20 (NDLLMProvider): refers to 'gpt-4o-2024-11-20' model by OpenAI
3333
3434
CLAUDE_2_1 (NDLLMProvider): refers to 'claude-2.1' model by Anthropic
35-
CLAUDE_3_OPUS_20240229 (NDLLMProvider): refers to 'claude-3-opus-20240229' model by Anthropic
3635
CLAUDE_3_SONNET_20240229 (NDLLMProvider): refers to 'claude-3-sonnet-20240229' model by Anthropic
37-
CLAUDE_3_5_SONNET_20240620 (NDLLMProvider): refers to 'claude-3-5-sonnet-20240620' model by Anthropic
3836
CLAUDE_3_7_SONNET_LATEST (NDLLMProvider): refers to 'claude-3-7-sonnet-latest' model by Anthropic
3937
CLAUDE_3_7_SONNET_20250219 (NDLLMProvider): refers to 'claude-3-7-sonnet-20250219' model by Anthropic
4038
CLAUDE_3_5_HAIKU_20241022 (NDLLMProvider): refers to 'claude-3-5-haiku-20241022' model by Anthropic
@@ -118,11 +116,7 @@ class NDLLMProviders(Enum):
118116
GPT_4o_2024_11_20 = ("openai", "gpt-4o-2024-11-20")
119117

120118
CLAUDE_2_1 = ("anthropic", "claude-2.1")
121-
CLAUDE_3_OPUS_20240229 = ("anthropic", "claude-3-opus-20240229")
122119
CLAUDE_3_SONNET_20240229 = ("anthropic", "claude-3-sonnet-20240229")
123-
CLAUDE_3_5_SONNET_20240620 = ("anthropic", "claude-3-5-sonnet-20240620")
124-
CLAUDE_3_5_SONNET_20241022 = ("anthropic", "claude-3-5-sonnet-20241022")
125-
CLAUDE_3_5_SONNET_LATEST = ("anthropic", "claude-3-5-sonnet-latest")
126120
CLAUDE_3_7_SONNET_LATEST = ("anthropic", "claude-3-7-sonnet-latest")
127121
CLAUDE_3_7_SONNET_20250219 = ("anthropic", "claude-3-7-sonnet-20250219")
128122
CLAUDE_3_5_HAIKU_20241022 = ("anthropic", "claude-3-5-haiku-20241022")

notdiamond/settings.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,9 @@
144144
"anthropic": {
145145
"models": [
146146
"claude-2.1",
147-
"claude-3-opus-20240229",
148147
"claude-3-sonnet-20240229",
149148
"claude-3-haiku-20240307",
150149
"claude-3-5-haiku-20241022",
151-
"claude-3-5-sonnet-20240620",
152-
"claude-3-5-sonnet-20241022",
153-
"claude-3-5-sonnet-latest",
154150
"claude-3-7-sonnet-latest",
155151
"claude-3-7-sonnet-20250219",
156152
"claude-opus-4-20250514",
@@ -162,13 +158,9 @@
162158
],
163159
"api_key": ANTHROPIC_API_KEY,
164160
"support_tools": [
165-
"claude-3-opus-20240229",
166161
"claude-3-sonnet-20240229",
167162
"claude-3-haiku-20240307",
168-
"claude-3-5-sonnet-20240620",
169-
"claude-3-5-sonnet-20241022",
170163
"claude-3-5-haiku-20241022",
171-
"claude-3-5-sonnet-latest",
172164
"claude-3-7-sonnet-latest",
173165
"claude-3-7-sonnet-20250219",
174166
"claude-opus-4-20250514",
@@ -180,15 +172,11 @@
180172
],
181173
"support_response_model": [
182174
"claude-2.1",
183-
"claude-3-opus-20240229",
184175
],
185176
"openrouter_identifier": {
186177
"claude-2.1": "anthropic/claude-2.1",
187-
"claude-3-opus-20240229": "anthropic/claude-3-opus",
188178
"claude-3-sonnet-20240229": "anthropic/claude-3-sonnet",
189179
"claude-3-haiku-20240307": "anthropic/claude-3-haiku",
190-
"claude-3-5-sonnet-20240620": "anthropic/claude-3.5-sonnet-20240620",
191-
"claude-3-5-sonnet-latest": "anthropic/claude-3.5-sonnet",
192180
"claude-3-5-haiku-20241022": "anthropic/claude-3.5-haiku",
193181
"claude-3-7-sonnet-latest": "anthropic/claude-3.7-sonnet",
194182
"claude-3-7-sonnet-20250219": "anthropic/claude-3.7-sonnet",
@@ -201,13 +189,9 @@
201189
},
202190
"price": {
203191
"claude-2.1": {"input": 8.0, "output": 24.0},
204-
"claude-3-opus-20240229": {"input": 15.0, "output": 75.0},
205192
"claude-3-sonnet-20240229": {"input": 3.0, "output": 15.0},
206193
"claude-3-haiku-20240307": {"input": 0.25, "output": 1.25},
207194
"claude-3-5-haiku-20241022": {"input": 1.0, "output": 5.0},
208-
"claude-3-5-sonnet-20240620": {"input": 3.0, "output": 15.0},
209-
"claude-3-5-sonnet-20241022": {"input": 3.0, "output": 15.0},
210-
"claude-3-5-sonnet-latest": {"input": 3.0, "output": 15.0},
211195
"claude-3-7-sonnet-latest": {"input": 3.0, "output": 15.0},
212196
"claude-3-7-sonnet-20250219": {"input": 3.0, "output": 15.0},
213197
"claude-opus-4-20250514": {"input": 15.0, "output": 75.0},

tests/test_components/test_llms/test_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def test_existing_openrouter_model():
5353
assert llm_provider.openrouter_model == "mistralai/mistral-large"
5454

5555
llm_provider = LLMConfig(
56-
provider="anthropic", model="claude-3-opus-20240229"
56+
provider="anthropic", model="claude-3-sonnet-20240229"
5757
)
58-
assert llm_provider.openrouter_model == "anthropic/claude-3-opus"
58+
assert llm_provider.openrouter_model == "anthropic/claude-3-sonnet"
5959

6060

6161
def test_not_existing_openrouter_model():

tests/test_documentation/cassettes/test_fallback_and_custom/test_custom_logic.yaml

Lines changed: 7 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ interactions:
1515
Content-Length:
1616
- '327'
1717
User-Agent:
18-
- Python-SDK/0.3.41
18+
- Python-SDK/0.4.5
1919
content-type:
2020
- application/json
2121
method: POST
2222
uri: https://staging-api.notdiamond.ai/v2/modelRouter/modelSelect
2323
response:
2424
body:
25-
string: '{"detail":"requestID=2a52f8d9-4a00-4045, Messages format invalid."}'
25+
string: '{"detail":"Messages format invalid."}'
2626
headers:
2727
CF-RAY:
28-
- 925cfc7e4c94d0ec-SOF
28+
- 982fb2ae5a686249-OTP
2929
Connection:
3030
- keep-alive
3131
Content-Type:
3232
- application/json
3333
Date:
34-
- Tue, 25 Mar 2025 08:19:58 GMT
34+
- Mon, 22 Sep 2025 06:20:43 GMT
3535
Server:
3636
- cloudflare
3737
Transfer-Encoding:
@@ -41,131 +41,14 @@ interactions:
4141
cf-cache-status:
4242
- DYNAMIC
4343
rndr-id:
44-
- 2a52f8d9-4a00-4045
44+
- 149da980-870a-4ae9
4545
vary:
4646
- Accept-Encoding
4747
x-render-origin-server:
4848
- uvicorn
49+
x-request-id:
50+
- 149da980-870a-4ae9
4951
status:
5052
code: 400
5153
message: Bad Request
52-
- request:
53-
body: '{"messages": [{"role": "user", "content": "You are a world class software
54-
developer. Write a merge sort in Python."}], "model": "gpt-3.5-turbo"}'
55-
headers:
56-
accept:
57-
- application/json
58-
accept-encoding:
59-
- gzip, deflate, zstd
60-
connection:
61-
- keep-alive
62-
content-length:
63-
- '144'
64-
content-type:
65-
- application/json
66-
host:
67-
- api.openai.com
68-
user-agent:
69-
- OpenAI/Python 1.68.2
70-
x-stainless-arch:
71-
- x64
72-
x-stainless-async:
73-
- 'false'
74-
x-stainless-lang:
75-
- python
76-
x-stainless-os:
77-
- Linux
78-
x-stainless-package-version:
79-
- 1.68.2
80-
x-stainless-read-timeout:
81-
- '600'
82-
x-stainless-retry-count:
83-
- '0'
84-
x-stainless-runtime:
85-
- CPython
86-
x-stainless-runtime-version:
87-
- 3.12.3
88-
method: POST
89-
uri: https://api.openai.com/v1/chat/completions
90-
response:
91-
body:
92-
string: "{\n \"id\": \"chatcmpl-BEtnqQUemyAjI6LtIlcncVQkOpe7Z\",\n \"object\":
93-
\"chat.completion\",\n \"created\": 1742890798,\n \"model\": \"gpt-3.5-turbo-0125\",\n
94-
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
95-
\"assistant\",\n \"content\": \"Sure! Here's a Python implementation
96-
of the merge sort algorithm:\\n\\n```python\\ndef merge_sort(arr):\\n if
97-
len(arr) > 1:\\n mid = len(arr) // 2\\n left_half = arr[:mid]\\n
98-
\ right_half = arr[mid:]\\n\\n merge_sort(left_half)\\n merge_sort(right_half)\\n\\n
99-
\ i = j = k = 0\\n\\n while i < len(left_half) and j < len(right_half):\\n
100-
\ if left_half[i] < right_half[j]:\\n arr[k] = left_half[i]\\n
101-
\ i += 1\\n else:\\n arr[k] = right_half[j]\\n
102-
\ j += 1\\n k += 1\\n\\n while i < len(left_half):\\n
103-
\ arr[k] = left_half[i]\\n i += 1\\n k +=
104-
1\\n\\n while j < len(right_half):\\n arr[k] = right_half[j]\\n
105-
\ j += 1\\n k += 1\\n\\n return arr\\n\\n# Example
106-
usage\\narr = [38, 27, 43, 3, 9, 82, 10]\\nsorted_arr = merge_sort(arr)\\nprint(sorted_arr)\\n```\\n\\nThis
107-
implementation recursively divides the input array into two halves, sorts
108-
each half, and then merges the two sorted halves back together. The time complexity
109-
of the merge sort algorithm is O(n*log(n)).\",\n \"refusal\": null,\n
110-
\ \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\":
111-
\"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 22,\n \"completion_tokens\":
112-
284,\n \"total_tokens\": 306,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
113-
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
114-
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
115-
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
116-
\"default\",\n \"system_fingerprint\": null\n}\n"
117-
headers:
118-
CF-RAY:
119-
- 925cfc813c2f8ee4-SOF
120-
Connection:
121-
- keep-alive
122-
Content-Type:
123-
- application/json
124-
Date:
125-
- Tue, 25 Mar 2025 08:20:00 GMT
126-
Server:
127-
- cloudflare
128-
Set-Cookie:
129-
- __cf_bm=UEnUJt97I.W2M053iPJIuvRvZOcwuUWjzQW6qKNUmVc-1742890800-1.0.1.1-dW7G4PvCkye3q5wabFIynaD0ixsaI_OuDvTKpF0CudA4euSxw_d5ymUasIXCvhYtjLWseFyJ0zhp9o5UYh4JoWMWJG9pS7EIN.JG1Cy3Tb8;
130-
path=/; expires=Tue, 25-Mar-25 08:50:00 GMT; domain=.api.openai.com; HttpOnly;
131-
Secure; SameSite=None
132-
- _cfuvid=G1lGnlWCgXi9GfSobTDl6zs5zw.iQ3T1anPBgHzIFec-1742890800832-0.0.1.1-604800000;
133-
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
134-
Transfer-Encoding:
135-
- chunked
136-
X-Content-Type-Options:
137-
- nosniff
138-
access-control-expose-headers:
139-
- X-Request-ID
140-
alt-svc:
141-
- h3=":443"; ma=86400
142-
cf-cache-status:
143-
- DYNAMIC
144-
content-length:
145-
- '1932'
146-
openai-organization:
147-
- not-diamond-bdz8cg
148-
openai-processing-ms:
149-
- '2404'
150-
openai-version:
151-
- '2020-10-01'
152-
strict-transport-security:
153-
- max-age=31536000; includeSubDomains; preload
154-
x-ratelimit-limit-requests:
155-
- '10000'
156-
x-ratelimit-limit-tokens:
157-
- '50000000'
158-
x-ratelimit-remaining-requests:
159-
- '9999'
160-
x-ratelimit-remaining-tokens:
161-
- '49999979'
162-
x-ratelimit-reset-requests:
163-
- 6ms
164-
x-ratelimit-reset-tokens:
165-
- 0s
166-
x-request-id:
167-
- req_5edfccb03d05381141520087c2d01a20
168-
status:
169-
code: 200
170-
message: OK
17154
version: 1

0 commit comments

Comments
 (0)