Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ result, session_id, provider = client.chat.completions.create(
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Concisely explain merge sort."} # Adjust as desired
],
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20240620']
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-sonnet-20240229']
)

print("ND session ID: ", session_id) # A unique ID of Not Diamond's recommendation
Expand Down
2 changes: 1 addition & 1 deletion docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Create a new file in the same directory as your `.env` file and copy and run the
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Consiely explain merge sort."} # Adjust as desired
],
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20240620']
model=['openai/gpt-3.5-turbo', 'openai/gpt-4o', 'anthropic/claude-3-sonnet-20240229']
)

print("ND session ID: ", session_id) # A unique ID of Not Diamond's recommendation
Expand Down
6 changes: 0 additions & 6 deletions notdiamond/llms/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class NDLLMProviders(Enum):
GPT_4o_2024_11_20 (NDLLMProvider): refers to 'gpt-4o-2024-11-20' model by OpenAI

CLAUDE_2_1 (NDLLMProvider): refers to 'claude-2.1' model by Anthropic
CLAUDE_3_OPUS_20240229 (NDLLMProvider): refers to 'claude-3-opus-20240229' model by Anthropic
CLAUDE_3_SONNET_20240229 (NDLLMProvider): refers to 'claude-3-sonnet-20240229' model by Anthropic
CLAUDE_3_5_SONNET_20240620 (NDLLMProvider): refers to 'claude-3-5-sonnet-20240620' model by Anthropic
CLAUDE_3_7_SONNET_LATEST (NDLLMProvider): refers to 'claude-3-7-sonnet-latest' model by Anthropic
CLAUDE_3_7_SONNET_20250219 (NDLLMProvider): refers to 'claude-3-7-sonnet-20250219' model by Anthropic
CLAUDE_3_5_HAIKU_20241022 (NDLLMProvider): refers to 'claude-3-5-haiku-20241022' model by Anthropic
Expand Down Expand Up @@ -118,11 +116,7 @@ class NDLLMProviders(Enum):
GPT_4o_2024_11_20 = ("openai", "gpt-4o-2024-11-20")

CLAUDE_2_1 = ("anthropic", "claude-2.1")
CLAUDE_3_OPUS_20240229 = ("anthropic", "claude-3-opus-20240229")
CLAUDE_3_SONNET_20240229 = ("anthropic", "claude-3-sonnet-20240229")
CLAUDE_3_5_SONNET_20240620 = ("anthropic", "claude-3-5-sonnet-20240620")
CLAUDE_3_5_SONNET_20241022 = ("anthropic", "claude-3-5-sonnet-20241022")
CLAUDE_3_5_SONNET_LATEST = ("anthropic", "claude-3-5-sonnet-latest")
CLAUDE_3_7_SONNET_LATEST = ("anthropic", "claude-3-7-sonnet-latest")
CLAUDE_3_7_SONNET_20250219 = ("anthropic", "claude-3-7-sonnet-20250219")
CLAUDE_3_5_HAIKU_20241022 = ("anthropic", "claude-3-5-haiku-20241022")
Expand Down
16 changes: 0 additions & 16 deletions notdiamond/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,9 @@
"anthropic": {
"models": [
"claude-2.1",
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-20240620",
"claude-3-5-sonnet-20241022",
"claude-3-5-sonnet-latest",
"claude-3-7-sonnet-latest",
"claude-3-7-sonnet-20250219",
"claude-opus-4-20250514",
Expand All @@ -162,13 +158,9 @@
],
"api_key": ANTHROPIC_API_KEY,
"support_tools": [
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307",
"claude-3-5-sonnet-20240620",
"claude-3-5-sonnet-20241022",
"claude-3-5-haiku-20241022",
"claude-3-5-sonnet-latest",
"claude-3-7-sonnet-latest",
"claude-3-7-sonnet-20250219",
"claude-opus-4-20250514",
Expand All @@ -180,15 +172,11 @@
],
"support_response_model": [
"claude-2.1",
"claude-3-opus-20240229",
],
"openrouter_identifier": {
"claude-2.1": "anthropic/claude-2.1",
"claude-3-opus-20240229": "anthropic/claude-3-opus",
"claude-3-sonnet-20240229": "anthropic/claude-3-sonnet",
"claude-3-haiku-20240307": "anthropic/claude-3-haiku",
"claude-3-5-sonnet-20240620": "anthropic/claude-3.5-sonnet-20240620",
"claude-3-5-sonnet-latest": "anthropic/claude-3.5-sonnet",
"claude-3-5-haiku-20241022": "anthropic/claude-3.5-haiku",
"claude-3-7-sonnet-latest": "anthropic/claude-3.7-sonnet",
"claude-3-7-sonnet-20250219": "anthropic/claude-3.7-sonnet",
Expand All @@ -201,13 +189,9 @@
},
"price": {
"claude-2.1": {"input": 8.0, "output": 24.0},
"claude-3-opus-20240229": {"input": 15.0, "output": 75.0},
"claude-3-sonnet-20240229": {"input": 3.0, "output": 15.0},
"claude-3-haiku-20240307": {"input": 0.25, "output": 1.25},
"claude-3-5-haiku-20241022": {"input": 1.0, "output": 5.0},
"claude-3-5-sonnet-20240620": {"input": 3.0, "output": 15.0},
"claude-3-5-sonnet-20241022": {"input": 3.0, "output": 15.0},
"claude-3-5-sonnet-latest": {"input": 3.0, "output": 15.0},
"claude-3-7-sonnet-latest": {"input": 3.0, "output": 15.0},
"claude-3-7-sonnet-20250219": {"input": 3.0, "output": 15.0},
"claude-opus-4-20250514": {"input": 15.0, "output": 75.0},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_components/test_llms/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def test_existing_openrouter_model():
assert llm_provider.openrouter_model == "mistralai/mistral-large"

llm_provider = LLMConfig(
provider="anthropic", model="claude-3-opus-20240229"
provider="anthropic", model="claude-3-sonnet-20240229"
)
assert llm_provider.openrouter_model == "anthropic/claude-3-opus"
assert llm_provider.openrouter_model == "anthropic/claude-3-sonnet"


def test_not_existing_openrouter_model():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ interactions:
Content-Length:
- '327'
User-Agent:
- Python-SDK/0.3.41
- Python-SDK/0.4.5
content-type:
- application/json
method: POST
uri: https://staging-api.notdiamond.ai/v2/modelRouter/modelSelect
response:
body:
string: '{"detail":"requestID=2a52f8d9-4a00-4045, Messages format invalid."}'
string: '{"detail":"Messages format invalid."}'
headers:
CF-RAY:
- 925cfc7e4c94d0ec-SOF
- 982fb2ae5a686249-OTP
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Tue, 25 Mar 2025 08:19:58 GMT
- Mon, 22 Sep 2025 06:20:43 GMT
Server:
- cloudflare
Transfer-Encoding:
Expand All @@ -41,131 +41,14 @@ interactions:
cf-cache-status:
- DYNAMIC
rndr-id:
- 2a52f8d9-4a00-4045
- 149da980-870a-4ae9
vary:
- Accept-Encoding
x-render-origin-server:
- uvicorn
x-request-id:
- 149da980-870a-4ae9
status:
code: 400
message: Bad Request
- request:
body: '{"messages": [{"role": "user", "content": "You are a world class software
developer. Write a merge sort in Python."}], "model": "gpt-3.5-turbo"}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '144'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.68.2
x-stainless-arch:
- x64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
x-stainless-package-version:
- 1.68.2
x-stainless-read-timeout:
- '600'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.3
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: "{\n \"id\": \"chatcmpl-BEtnqQUemyAjI6LtIlcncVQkOpe7Z\",\n \"object\":
\"chat.completion\",\n \"created\": 1742890798,\n \"model\": \"gpt-3.5-turbo-0125\",\n
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
\"assistant\",\n \"content\": \"Sure! Here's a Python implementation
of the merge sort algorithm:\\n\\n```python\\ndef merge_sort(arr):\\n if
len(arr) > 1:\\n mid = len(arr) // 2\\n left_half = arr[:mid]\\n
\ right_half = arr[mid:]\\n\\n merge_sort(left_half)\\n merge_sort(right_half)\\n\\n
\ i = j = k = 0\\n\\n while i < len(left_half) and j < len(right_half):\\n
\ if left_half[i] < right_half[j]:\\n arr[k] = left_half[i]\\n
\ i += 1\\n else:\\n arr[k] = right_half[j]\\n
\ j += 1\\n k += 1\\n\\n while i < len(left_half):\\n
\ arr[k] = left_half[i]\\n i += 1\\n k +=
1\\n\\n while j < len(right_half):\\n arr[k] = right_half[j]\\n
\ j += 1\\n k += 1\\n\\n return arr\\n\\n# Example
usage\\narr = [38, 27, 43, 3, 9, 82, 10]\\nsorted_arr = merge_sort(arr)\\nprint(sorted_arr)\\n```\\n\\nThis
implementation recursively divides the input array into two halves, sorts
each half, and then merges the two sorted halves back together. The time complexity
of the merge sort algorithm is O(n*log(n)).\",\n \"refusal\": null,\n
\ \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\":
\"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 22,\n \"completion_tokens\":
284,\n \"total_tokens\": 306,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
\"default\",\n \"system_fingerprint\": null\n}\n"
headers:
CF-RAY:
- 925cfc813c2f8ee4-SOF
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Tue, 25 Mar 2025 08:20:00 GMT
Server:
- cloudflare
Set-Cookie:
- __cf_bm=UEnUJt97I.W2M053iPJIuvRvZOcwuUWjzQW6qKNUmVc-1742890800-1.0.1.1-dW7G4PvCkye3q5wabFIynaD0ixsaI_OuDvTKpF0CudA4euSxw_d5ymUasIXCvhYtjLWseFyJ0zhp9o5UYh4JoWMWJG9pS7EIN.JG1Cy3Tb8;
path=/; expires=Tue, 25-Mar-25 08:50:00 GMT; domain=.api.openai.com; HttpOnly;
Secure; SameSite=None
- _cfuvid=G1lGnlWCgXi9GfSobTDl6zs5zw.iQ3T1anPBgHzIFec-1742890800832-0.0.1.1-604800000;
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
content-length:
- '1932'
openai-organization:
- not-diamond-bdz8cg
openai-processing-ms:
- '2404'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
x-ratelimit-limit-tokens:
- '50000000'
x-ratelimit-remaining-requests:
- '9999'
x-ratelimit-remaining-tokens:
- '49999979'
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_5edfccb03d05381141520087c2d01a20
status:
code: 200
message: OK
version: 1
Loading
Loading