Skip to content

feat(mistral-ai/mistral-large-veteran-2512): add new models [bot]#1230

Open
models-bot[bot] wants to merge 2 commits into
mainfrom
bot/add-mistral-ai-mistral-large-veteran-2512-20260603-000643
Open

feat(mistral-ai/mistral-large-veteran-2512): add new models [bot]#1230
models-bot[bot] wants to merge 2 commits into
mainfrom
bot/add-mistral-ai-mistral-large-veteran-2512-20260603-000643

Conversation

@models-bot

@models-bot models-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Auto-generated by model-addition-agent for mistral-ai/mistral-large-veteran-2512.


Note

Low Risk
Metadata-only addition of a model definition; no runtime or security logic changes.

Overview
Adds a new Mistral AI provider catalog file for mistral-large-veteran-2512, exposing it as an active chat model with 262k context, text/image input, and standard capabilities (function calling, structured output, system messages, tool choice).

Pricing is set at 5e-7 input and 1.5e-6 output per token (global region), with default temperature 0.3. Documentation is linked via Mistral’s mistral-large-3-25-12 model card.

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

Comment thread providers/mistral-ai/mistral-large-veteran-2512.yaml
Comment thread providers/mistral-ai/mistral-large-veteran-2512.yaml
@github-actions

github-actions Bot commented Jun 3, 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 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 ea82cec. Configure here.

- function_calling
- structured_output
- system_messages
- tool_choice

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing Large 3 feature flags

Medium Severity

The new mistral-large-veteran-2512 entry documents Mistral Large 3 (mistral-large-3-25-12) with the same pricing, context window, and modalities as mistral-large-2512, but its features list omits json_output, parallel_function_calling, and assistant_prefill that the sibling Large 3 config declares. Downstream tooling may hide supported API capabilities for this model.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ea82cec. Configure here.

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 12
  • Passed: 0
  • Failed: 12
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
mistral-ai mistral-large-veteran-2512 failure: tool-call:boto3:adapter, params:stream:boto3:adapter, params:boto3:adapter, structured-output:stream:boto3:adapter, structured-output:boto3:adapter, tool-call:stream:boto3:adapter, structured-output, params:stream, structured-output:stream, tool-call:stream, tool-call, params
Failures (12)

mistral-ai/mistral-large-veteran-2512 — tool-call:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpqd94_0lp/snippet.py", line 54, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the Converse operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "get_weather",
                "description": "Get the current weather for a location.",
                "inputSchema": {
                    "json": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city name, e.g. London",
                            },
                        },
                        "required": ["location"],
                    }
                },
            }
        }
    ],
    "toolChoice": {"auto": {}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]
if _tool_uses:
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]

if _tool_uses:
    for _tu in _tool_uses:
        print(f"Tool: {_tu['toolUse']['name']}")
        print(f"Input: {_tu['toolUse']['input']}")
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    print("\n".join(_text_blocks))

if not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

mistral-ai/mistral-large-veteran-2512 — params:stream:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp2yqj_dy7/snippet.py", line 30, in <module>
    response = client.converse_stream(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the ConverseStream operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "What is the capital of France?"}]},
]

system = [{"text": "You are a helpful assistant."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    inferenceConfig={
        "maxTokens": 256,
        "temperature": 0.3,
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)

mistral-ai/mistral-large-veteran-2512 — params:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpuw4s5fzb/snippet.py", line 30, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the Converse operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "What is the capital of France?"}]},
]

system = [{"text": "You are a helpful assistant."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    inferenceConfig={
        "maxTokens": 256,
        "temperature": 0.3,
    },
)

_content = response["output"]["message"]["content"]
for _block in _content:
    if "text" in _block:
        print(_block["text"])

mistral-ai/mistral-large-veteran-2512 — structured-output:stream:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpzeyehskk/snippet.py", line 58, in <module>
    response = client.converse_stream(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the ConverseStream operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

response_schema = {
    "title": "CalendarEvent",
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "date": {"type": "string"},
        "participants": {
            "type": "array",
            "items": {"type": "string"},
        },
    },
    "required": ["name", "date", "participants"],
}

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "CalendarEvent",
                "description": "Extract event information as a structured CalendarEvent.",
                "inputSchema": {"json": response_schema},
            }
        }
    ],
    "toolChoice": {"tool": {"name": "CalendarEvent"}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Alice and Bob are going to a science fair on Friday."}]},
]

system = [{"text": "Extract the event information using the CalendarEvent tool."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "toolUse" in _start:
            print(f"Tool: {_start['toolUse'].get('name', '')}", flush=True)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            print(_delta["toolUse"].get("input", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)

import json as _json

_accumulated_input = ""
_tool_use_detected = False
_accumulated_text = ""

for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "toolUse" in _start:
            _tool_use_detected = True
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _accumulated_input += _delta["toolUse"].get("input", "")
        if "text" in _delta:
            _accumulated_text += _delta["text"]
            print(_delta["text"], end="", flush=True)

if _tool_use_detected and _accumulated_input:
    _parsed = _json.loads(_accumulated_input)
elif _accumulated_text:
    _parsed = _json.loads(_accumulated_text)
else:
    raise Exception("VALIDATION FAILED: structured-output stream - no content received from Bedrock stream")

print(_json.dumps(_parsed, indent=2))

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")

print("\nVALIDATION: structured-output stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — structured-output:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp9bbflf87/snippet.py", line 58, in <module>
    response = client.converse(
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the Converse operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

response_schema = {
    "title": "CalendarEvent",
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "date": {"type": "string"},
        "participants": {
            "type": "array",
            "items": {"type": "string"},
        },
    },
    "required": ["name", "date", "participants"],
}

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "CalendarEvent",
                "description": "Extract event information as a structured CalendarEvent.",
                "inputSchema": {"json": response_schema},
            }
        }
    ],
    "toolChoice": {"tool": {"name": "CalendarEvent"}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Alice and Bob are going to a science fair on Friday."}]},
]

system = [{"text": "Extract the event information using the CalendarEvent tool."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_content = response["output"]["message"]["content"]
for _block in _content:
    if "toolUse" in _block:
        print(json.dumps(_block["toolUse"]["input"], indent=2))
    elif "text" in _block:
        print(_block["text"])

import json as _json

_content = response["output"]["message"]["content"]
_tool_uses = [block for block in _content if "toolUse" in block]

if _tool_uses:
    _parsed = _tool_uses[0]["toolUse"]["input"]
else:
    _text_blocks = [block["text"] for block in _content if "text" in block]
    _text = "".join(_text_blocks)
    _parsed = _json.loads(_text)

print(_json.dumps(_parsed, indent=2))

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")

print("VALIDATION: structured-output SUCCESS")

mistral-ai/mistral-large-veteran-2512 — tool-call:stream:boto3:adapter (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpiy0njoor/snippet.py", line 54, in <module>
    response = client.converse_stream(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 606, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (400) when calling the ConverseStream operation: mistral-ai error: Invalid model: mistral-large-veteran-2512
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-mistral-ai/mistral-large-veteran-2512"

client = boto3.client(
    "bedrock-runtime",
    region_name="us-east-1",
    endpoint_url=_endpoint,
    aws_access_key_id="dummy",
    aws_secret_access_key="dummy",
    config=Config(inject_host_prefix=False),
)

def _add_auth_header(request, **kwargs):
    request.headers["x-tfy-api-key"] = _api_key

client.meta.events.register("before-sign.bedrock-runtime.*", _add_auth_header)

tool_config = {
    "tools": [
        {
            "toolSpec": {
                "name": "get_weather",
                "description": "Get the current weather for a location.",
                "inputSchema": {
                    "json": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city name, e.g. London",
                            },
                        },
                        "required": ["location"],
                    }
                },
            }
        }
    ],
    "toolChoice": {"auto": {}},
}

messages = [
    {"role": "user", "content": [{"text": "Hi"}]},
    {"role": "assistant", "content": [{"text": "Hi, how can I help you"}]},
    {"role": "user", "content": [{"text": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    toolConfig=tool_config,
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "toolUse" in _start:
            print(f"Tool: {_start['toolUse'].get('name', '')}", flush=True)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            print(_delta["toolUse"].get("input", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)

_tool_use_detected = False
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "toolUse" in _start:
            _tool_use_detected = True
            print(f"Tool: {_start['toolUse'].get('name', '')}", flush=True)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = True
            print(_delta["toolUse"].get("input", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)

if not _tool_use_detected:
    raise Exception("VALIDATION FAILED: tool-call stream - no tool uses in Bedrock stream")
print("\nVALIDATION: tool-call stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpqbn99ijk/snippet.py", line 21, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI
import json

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

response_schema = json.loads('''{
  "title": "CalendarEvent",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "date": { "type": "string" },
    "participants": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "required": ["name", "date", "participants"],
  "additionalProperties": false
}''')

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "Extract the event information as JSON."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
    ],
    response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
    stream=False,
)

import json as _json

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

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

_parsed = _json.loads(_content)

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")

if set(_parsed.keys()) != {"name", "date", "participants"}:
    raise Exception(
        f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
    )

print("VALIDATION: structured-output SUCCESS")

mistral-ai/mistral-large-veteran-2512 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp7jet08hu/snippet.py", line 5, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
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-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "What is the capital of France?"},
    ],
    max_tokens=256,
    temperature=0.3,
    stream=True,
)

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)

mistral-ai/mistral-large-veteran-2512 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpv16r0a1l/snippet.py", line 21, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI
import json

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

response_schema = json.loads('''{
  "title": "CalendarEvent",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "date": { "type": "string" },
    "participants": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "required": ["name", "date", "participants"],
  "additionalProperties": false
}''')

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "Extract the event information as JSON."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
    ],
    response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
    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: structured-output stream - no content received")

_parsed = _json.loads(_accumulated)

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")

if set(_parsed.keys()) != {"name", "date", "participants"}:
    raise Exception(
        f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
    )

print("\nVALIDATION: structured-output stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsygm4nfo/snippet.py", line 27, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI

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

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
    ],
    tools=tools,
    tool_choice="auto",
    stream=True,
)

_tool_calls_made = 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 delta.tool_calls:
            _tool_calls_made = True
            for _tc in delta.tool_calls:
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if not _tool_calls_made:
    raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpyi_1x8uk/snippet.py", line 27, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI

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

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
    ],
    tools=tools,
    tool_choice="auto",
    stream=False,
)

_message = response.choices[0].message
if _message.tool_calls:
    for _tc in _message.tool_calls:
        print(f"Function: {_tc.function.name}")
        print(f"Arguments: {_tc.function.arguments}")
else:
    print(_message.content)

if not _message.tool_calls or len(_message.tool_calls) == 0:
    raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")

mistral-ai/mistral-large-veteran-2512 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpgay9gyl2/snippet.py", line 5, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
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-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "What is the capital of France?"},
    ],
    max_tokens=256,
    temperature=0.3,
    stream=False,
)

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

@harshiv-26

Copy link
Copy Markdown
Collaborator

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 6
  • Passed: 0
  • Failed: 6
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
mistral-ai mistral-large-veteran-2512 failure: params:stream, structured-output:stream, params, structured-output, tool-call:stream, tool-call
Failures (6)

mistral-ai/mistral-large-veteran-2512 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpt4qqsiud/snippet.py", line 5, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
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-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "What is the capital of France?"},
    ],
    max_tokens=256,
    temperature=0.3,
    stream=True,
)

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)

mistral-ai/mistral-large-veteran-2512 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp7etb9kbk/snippet.py", line 21, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI
import json

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

response_schema = json.loads('''{
  "title": "CalendarEvent",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "date": { "type": "string" },
    "participants": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "required": ["name", "date", "participants"],
  "additionalProperties": false
}''')

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "Extract the event information as JSON."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
    ],
    response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
    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: structured-output stream - no content received")

_parsed = _json.loads(_accumulated)

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")

if set(_parsed.keys()) != {"name", "date", "participants"}:
    raise Exception(
        f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
    )

print("\nVALIDATION: structured-output stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp2pk_rjle/snippet.py", line 5, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
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-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "What is the capital of France?"},
    ],
    max_tokens=256,
    temperature=0.3,
    stream=False,
)

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

mistral-ai/mistral-large-veteran-2512 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp_i8nm58n/snippet.py", line 21, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI
import json

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

response_schema = json.loads('''{
  "title": "CalendarEvent",
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "date": { "type": "string" },
    "participants": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "required": ["name", "date", "participants"],
  "additionalProperties": false
}''')

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "Extract the event information as JSON."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
    ],
    response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
    stream=False,
)
import json as _json

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

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

_parsed = _json.loads(_content)

if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
    raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")

if not isinstance(_parsed.get("participants"), list):
    raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")

if set(_parsed.keys()) != {"name", "date", "participants"}:
    raise Exception(
        f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
    )

print("VALIDATION: structured-output SUCCESS")

mistral-ai/mistral-large-veteran-2512 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpa5a0wnjl/snippet.py", line 27, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI

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

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
    ],
    tools=tools,
    tool_choice="auto",
    stream=True,
)
_tool_calls_made = 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 delta.tool_calls:
            _tool_calls_made = True
            for _tc in delta.tool_calls:
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if not _tool_calls_made:
    raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")

mistral-ai/mistral-large-veteran-2512 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpbdkrqukj/snippet.py", line 27, in <module>
    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.BadRequestError: Error code: 400 - {'status': 'failure', 'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'error': {'message': 'mistral-ai error: Invalid model: mistral-large-veteran-2512', 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'mistral-ai'}
Code snippet
from openai import OpenAI

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

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name, e.g. London",
                    },
                },
                "required": ["location"],
                "additionalProperties": False,
            },
            "strict": True,
        },
    },
]

response = client.chat.completions.create(
    model="test-v2-mistral-ai/mistral-large-veteran-2512",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly use the provided tools to answer. Never respond with plain text when a tool is available."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
    ],
    tools=tools,
    tool_choice="auto",
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    for _tc in _message.tool_calls:
        print(f"Function: {_tc.function.name}")
        print(f"Arguments: {_tc.function.arguments}")
else:
    print(_message.content)

if not _message.tool_calls or len(_message.tool_calls) == 0:
    raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")

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