Skip to content

feat(deepinfra/anthropic/claude-sonnet-5): add new models [bot]#1706

Open
models-bot[bot] wants to merge 2 commits into
mainfrom
bot/add-deepinfra-anthropic-claude-sonnet-5-20260708-000538
Open

feat(deepinfra/anthropic/claude-sonnet-5): add new models [bot]#1706
models-bot[bot] wants to merge 2 commits into
mainfrom
bot/add-deepinfra-anthropic-claude-sonnet-5-20260708-000538

Conversation

@models-bot

@models-bot models-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Auto-generated by model-addition-agent for deepinfra/anthropic/claude-sonnet-5.


Note

Low Risk
Adds catalog metadata only; no runtime, auth, or routing logic changes.

Overview
Adds a new DeepInfra provider YAML for anthropic/claude-sonnet-5, registering the model as active serverless chat with the same capabilities as the existing Sonnet entries (function calling, JSON output, text/image in, 1M context, thinking enabled).

Pricing is set to $2e-6 / $1e-5 per input/output token (globally via region: "*"), with a source link to DeepInfra’s model page.

Reviewed by Cursor Bugbot for commit 1a0c7e5. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread providers/deepinfra/anthropic/claude-sonnet-5.yaml
Comment thread providers/deepinfra/anthropic/claude-sonnet-5.yaml Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/test-models

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a0c7e5. Configure here.

- json_output
limits:
context_window: 1000000
max_tokens: 1000000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong max output token limit

Medium Severity

limits.max_tokens is set to 1000000, matching context_window instead of Claude Sonnet 5’s actual maximum response size. In this registry, max_tokens is the cap on generated tokens; Sonnet 5 supports a 1M context but only about 128K output, as in the canonical Anthropic and OpenRouter entries.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a0c7e5. Configure here.

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 8
  • Passed: 4
  • Failed: 3
  • Validation failed: 1
  • Errored: 0
  • Skipped: 0
  • Success rate: 50.0%
Provider Model Scenarios
deepinfra anthropic/claude-sonnet-5 success: tool-call, tool-call:stream, params:stream, params

failure: json-output, json-output:stream, reasoning

validation_failure: reasoning:stream
Failures (4)

deepinfra/anthropic/claude-sonnet-5 — reasoning:stream (validation_failure)

Error
Traceback (most recent call last):
  File "/tmp/tmploz7pnhe/snippet.py", line 31, in <module>
    raise Exception("VALIDATION FAILED: reasoning stream - no reasoning information in stream")
Exception: VALIDATION FAILED: reasoning stream - no reasoning information in stream
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-deepinfra/anthropic-claude-sonnet-5",
    messages=[
        {"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
    ],
    reasoning_effort="medium",
    stream=True,
)
_reasoning_detected = False
for chunk in response:
    if chunk.choices and len(chunk.choices) > 0:
        delta = chunk.choices[0].delta
        if delta.content is not None:
            print(delta.content, end="", flush=True)
        if getattr(delta, "reasoning_content", None) is not None:
            _reasoning_detected = True
        if getattr(delta, "reasoning", None) is not None:
            _reasoning_detected = True

    _usage = getattr(chunk, "usage", None)
    if _usage is not None:
        _details = getattr(_usage, "completion_tokens_details", None)
        if _details and getattr(_details, "reasoning_tokens", 0) > 0:
            _reasoning_detected = True

if not _reasoning_detected:
    raise Exception("VALIDATION FAILED: reasoning stream - no reasoning information in stream")
print("\nVALIDATION: reasoning stream SUCCESS")

deepinfra/anthropic/claude-sonnet-5 — json-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmptpunufhp/snippet.py", line 21, in <module>
    _json.loads(_content)
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Code snippet
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-deepinfra/anthropic-claude-sonnet-5",
    messages=[
        {"role": "user", "content": "List 3 colors with their hex codes in JSON."},
    ],
    response_format={"type": "json_object"},
    stream=False,
)
import json as _json

_content = response.choices[0].message.content
print(_content)

if not _content:
    raise Exception("VALIDATION FAILED: json-output - response content is empty")

_json.loads(_content)
print("VALIDATION: json-output SUCCESS")
Output
```json
[
  {
    "color": "Red",
    "hex": "#FF0000"
  },
  {
    "color": "Green",
    "hex": "#00FF00"
  },
  {
    "color": "Blue",
    "hex": "#0000FF"
  }
]

</details>

**`deepinfra/anthropic/claude-sonnet-5` — json-output:stream (failure)**

<details><summary>Error</summary>

Traceback (most recent call last):
File "/tmp/tmpfbw4q4wu/snippet.py", line 26, in
_json.loads(_accumulated)
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


</details>

<details><summary>Code snippet</summary>

```python
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-deepinfra/anthropic-claude-sonnet-5",
    messages=[
        {"role": "user", "content": "List 3 colors with their hex codes in JSON."},
    ],
    response_format={"type": "json_object"},
    stream=True,
)
import json as _json

_accumulated = ""
for chunk in response:
    if chunk.choices and len(chunk.choices) > 0:
        delta = chunk.choices[0].delta
        if delta.content is not None:
            _accumulated += delta.content
            print(delta.content, end="", flush=True)

if not _accumulated:
    raise Exception("VALIDATION FAILED: json-output stream - no content received")

_json.loads(_accumulated)
print("\nVALIDATION: json-output stream SUCCESS")
Output
Here are 3 colors with their hex codes in JSON format:

```json
{
  "colors": [
    {
      "name": "Red",
      "hex": "#FF0000"
    },
    {
      "name": "Emerald Green",
      "hex": "#50C878"
    },
    {
      "name": "Sky Blue",
      "hex": "#87CEEB"
    }
  ]
}

</details>

**`deepinfra/anthropic/claude-sonnet-5` — reasoning (failure)**

<details><summary>Error</summary>

Traceback (most recent call last):
File "/tmp/tmpg174qg4g/snippet.py", line 5, in
response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/_utils/_utils.py", line 286, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 1147, in create
return self._post(
^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1259, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/openai/_base_client.py", line 1047, in request
raise self._make_status_error_from_response(err.response) from None
openai.InternalServerError: Error code: 500 - {'status': 'failure', 'message': 'Invalid response received from deepinfra: {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\"thinking.type.enabled\\\" is not supported for this model. Use \\\"thinking.type.adaptive\\\" and \\\"output_config.effort\\\" to control thinking behavior.\"},\"request_id\":\"req_vrtx_011CcodJnQYaBg6BugZbjoDx\"}","type":"api_error","param":null,"code":null}}', 'error': {'message': 'Invalid response received from deepinfra: {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\"thinking.type.enabled\\\" is not supported for this model. Use \\\"thinking.type.adaptive\\\" and \\\"output_config.effort\\\" to control thinking behavior.\"},\"request_id\":\"req_vrtx_011CcodJnQYaBg6BugZbjoDx\"}","type":"api_error","param":null,"code":null}}', 'type': 'APIError', 'code': '500'}, 'error_origin_level': 'api_error', 'provider': 'deepinfra'}


</details>

<details><summary>Code snippet</summary>

```python
from openai import OpenAI

client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")

response = client.chat.completions.create(
    model="test-v2-deepinfra/anthropic-claude-sonnet-5",
    messages=[
        {"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
    ],
    reasoning_effort="medium",
    stream=False,
)
_usage = getattr(response, "usage", None)
_reasoning_detected = False

_choices = getattr(response, "choices", None)
if _choices and len(_choices) > 0:
    _message = getattr(_choices[0], "message", None)
else:
    _message = None

if _message and getattr(_message, "content", None) is not None:
    print(_message.content)

if _usage is not None:
    _output_token_details = getattr(_usage, "completion_tokens_details", None)
    if _output_token_details and getattr(_output_token_details, "reasoning_tokens", 0) > 0:
        _reasoning_detected = True
    elif getattr(_usage, "reasoning", None) is not None:
        _reasoning_detected = True

if getattr(_message, "reasoning_content", None) is not None:
    _reasoning_detected = True
elif getattr(_message, "reasoning", None) is not None:
    _reasoning_detected = True

if not _reasoning_detected:
    print("Response: ", response)
    raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
print("VALIDATION: reasoning SUCCESS")
Successes (4)

deepinfra/anthropic/claude-sonnet-5 — tool-call (success)

Output
Function: get_weather
Arguments: {"location": "London"}
VALIDATION: tool-call SUCCESS

deepinfra/anthropic/claude-sonnet-5 — tool-call:stream (success)

Output
I'll check the current weather in London for you.{"location": "London"}
VALIDATION: tool-call stream SUCCESS

deepinfra/anthropic/claude-sonnet-5 — params:stream (success)

Output
The capital of France is **Paris**.

Paris is not only the political capital but also the country's largest city and a major global center for art, fa
... (truncated, 152 chars omitted)

deepinfra/anthropic/claude-sonnet-5 — params (success)

Output
The capital of France is **Paris**.

Paris is not only the political capital but also the country's largest city and a major global center for art, fa
... (truncated, 153 chars omitted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant