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 3 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
4 changes: 4 additions & 0 deletions notdiamond/llms/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ class NDLLMProviders(Enum):
CLAUDE_3_5_HAIKU_20241022 (NDLLMProvider): refers to 'claude-3-5-haiku-20241022' model by Anthropic
CLAUDE_3_HAIKU_20240307 (NDLLMProvider): refers to 'claude-3-haiku-20240307' model by Anthropic
CLAUDE_OPUS_4_20250514 (NDLLMProvider): refers to 'claude-opus-4-20250514' model by Anthropic
CLAUDE_OPUS_4_20250805 (NDLLMProvider): refers to 'claude-opus-4-1-20250805' model by Anthropic
Comment thread
acompa marked this conversation as resolved.
Outdated
CLAUDE_SONNET_4_20250514 (NDLLMProvider): refers to 'claude-sonnet-4-20250514' model by Anthropic
CLAUDE_OPUS_4_0 (NDLLMProvider): refers to 'claude-opus-4-0' model by Anthropic
CLAUDE_OPUS_4_1 (NDLLMProvider): refers to 'claude-opus-4-1' model by Anthropic
CLAUDE_SONNET_4_0 (NDLLMProvider): refers to 'claude-sonnet-4-0' model by Anthropic

GEMINI_PRO (NDLLMProvider): refers to 'gemini-pro' model by Google
Expand Down Expand Up @@ -132,8 +134,10 @@ class NDLLMProviders(Enum):
CLAUDE_3_5_HAIKU_20241022 = ("anthropic", "claude-3-5-haiku-20241022")
CLAUDE_3_HAIKU_20240307 = ("anthropic", "claude-3-haiku-20240307")
CLAUDE_OPUS_4_20250514 = ("anthropic", "claude-opus-4-20250514")
CLAUDE_OPUS_4_20250805 = ("anthropic", "claude-opus-4-1-20250805")
Comment thread
acompa marked this conversation as resolved.
Outdated
CLAUDE_SONNET_4_20250514 = ("anthropic", "claude-sonnet-4-20250514")
CLAUDE_OPUS_4_0 = ("anthropic", "claude-opus-4-0")
CLAUDE_OPUS_4_1 = ("anthropic", "claude-opus-4-1")
CLAUDE_SONNET_4_0 = ("anthropic", "claude-sonnet-4-0")

GEMINI_PRO = ("google", "gemini-pro")
Expand Down
8 changes: 8 additions & 0 deletions notdiamond/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@
"claude-3-7-sonnet-latest",
"claude-3-7-sonnet-20250219",
"claude-opus-4-20250514",
"claude-opus-4-1-20250805",
"claude-sonnet-4-20250514",
"claude-opus-4-0",
"claude-opus-4-1",
"claude-sonnet-4-0",
],
"api_key": ANTHROPIC_API_KEY,
Expand All @@ -181,8 +183,10 @@
"claude-3-7-sonnet-latest",
"claude-3-7-sonnet-20250219",
"claude-opus-4-20250514",
"claude-opus-4-1-20250805",
"claude-sonnet-4-20250514",
"claude-opus-4-0",
"claude-opus-4-1",
"claude-sonnet-4-0",
],
"support_response_model": [
Expand All @@ -200,8 +204,10 @@
"claude-3-7-sonnet-latest": "anthropic/claude-3.7-sonnet",
"claude-3-7-sonnet-20250219": "anthropic/claude-3.7-sonnet",
"claude-opus-4-20250514": "anthropic/claude-opus-4",
"claude-opus-4-1-20250805": "anthropic/claude-opus-4-1-20250805",
"claude-sonnet-4-20250514": "anthropic/claude-sonnet-4",
"claude-opus-4-0": "anthropic/claude-opus-4",
"claude-opus-4-1": "anthropic/claude-opus-4-1",
"claude-sonnet-4-0": "anthropic/claude-sonnet-4",
},
"price": {
Expand All @@ -216,8 +222,10 @@
"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},
"claude-opus-4-1-20250805": {"input": 15.0, "output": 75.0},
"claude-sonnet-4-20250514": {"input": 3.0, "output": 15.0},
"claude-opus-4-0": {"input": 15.0, "output": 75.0},
"claude-opus-4-1": {"input": 15.0, "output": 75.0},
"claude-sonnet-4-0": {"input": 3.0, "output": 15.0},
},
},
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,13 @@ def _before_record_request(request: Any) -> Any:

@pytest.fixture(scope="module")
def vcr_config():
record_mode = os.getenv("RECORD_MODE", "none")
return {
"filter_headers": ["authorization", "x-token"],
"allowed_hosts": ["testserver", "127.0.0.1"],
"before_record_response": _redact_xtoken_response,
"before_record_request": _before_record_request,
"ignore_localhost": True,
"record_mode": "none",
"record_mode": record_mode,
"decode_compressed_response": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
interactions:
- request:
body: '{"messages": [{"role": "user", "content": "How much is 3 + 5?"}], "llm_providers":
[{"provider": "anthropic", "model": "claude-opus-4-1", "is_custom": false, "context_length":
null, "input_price": null, "output_price": null, "latency": null}], "metric":
"accuracy", "max_model_depth": 1, "hash_content": true, "tools": [{"type": "function",
"function": {"name": "add_fct", "description": "Add two numbers", "parameters":
{"type": "object", "properties": {"a": {"type": "integer", "description": "The
first number"}, "b": {"type": "integer", "description": "The second number"}},
"required": ["a", "b"]}}}]}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, zstd
Connection:
- keep-alive
Content-Length:
- '606'
User-Agent:
- Python-SDK/0.4.4
content-type:
- application/json
method: POST
uri: https://api.notdiamond.ai/v2/modelRouter/modelSelect
response:
body:
string: '{"detail":"Could not find valid API key"}'
headers:
CF-RAY:
- 96fc5de6cf7ce00f-MIA
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 15 Aug 2025 23:10:41 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
alt-svc:
- h3=":443"; ma=86400
cf-cache-status:
- DYNAMIC
rndr-id:
- dff267e2-2fc0-48c5
vary:
- Accept-Encoding
x-render-origin-server:
- uvicorn
x-request-id:
- dff267e2-2fc0-48c5
status:
code: 401
message: Unauthorized
- request:
body: '{"max_tokens":200,"messages":[{"role":"user","content":"How much is 3 +
5?"}],"model":"claude-opus-4-1","tools":[{"name":"add_fct","description":"Add
two numbers","input_schema":{"type":"object","properties":{"a":{"type":"integer","description":"The
first number"},"b":{"type":"integer","description":"The second number"}},"required":["a","b"]}}]}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
anthropic-version:
- '2023-06-01'
connection:
- keep-alive
content-length:
- '347'
content-type:
- application/json
host:
- api.anthropic.com
user-agent:
- Anthropic/Python 0.49.0
x-api-key:
- REDACTED
x-stainless-arch:
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 0.49.0
x-stainless-read-timeout:
- '120.0'
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.6
x-stainless-timeout:
- NOT_GIVEN
method: POST
uri: https://api.anthropic.com/v1/messages
response:
body:
string: '{"id":"msg_01MLNm6MvsAe345rsrZLmQ6R","type":"message","role":"assistant","model":"claude-opus-4-1-20250805","content":[{"type":"text","text":"I''ll
help you add those two numbers together."},{"type":"tool_use","id":"toolu_01FnzqgbR95M2QVVRcGmxnCz","name":"add_fct","input":{"a":3,"b":5}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":411,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":82,"service_tier":"standard"}}'
headers:
CF-RAY:
- 96fc5de81b7aed33-MIA
Connection:
- keep-alive
Content-Type:
- application/json
Date:
- Fri, 15 Aug 2025 23:10:44 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
X-Robots-Tag:
- none
anthropic-organization-id:
- a2610b2c-742e-455d-9552-6abe105b2a44
anthropic-ratelimit-input-tokens-limit:
- '2000000'
anthropic-ratelimit-input-tokens-remaining:
- '2000000'
anthropic-ratelimit-input-tokens-reset:
- '2025-08-15T23:10:42Z'
anthropic-ratelimit-output-tokens-limit:
- '400000'
anthropic-ratelimit-output-tokens-remaining:
- '400000'
anthropic-ratelimit-output-tokens-reset:
- '2025-08-15T23:10:44Z'
anthropic-ratelimit-requests-limit:
- '4000'
anthropic-ratelimit-requests-remaining:
- '3999'
anthropic-ratelimit-requests-reset:
- '2025-08-15T23:10:42Z'
anthropic-ratelimit-tokens-limit:
- '2400000'
anthropic-ratelimit-tokens-remaining:
- '2400000'
anthropic-ratelimit-tokens-reset:
- '2025-08-15T23:10:42Z'
cf-cache-status:
- DYNAMIC
content-length:
- '547'
request-id:
- req_011CSALfjb98PLc3UXmaXYxf
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
via:
- 1.1 google
status:
code: 200
message: OK
version: 1
Loading
Loading