Skip to content

feat(aws-bedrock/global.anthropic.claude-fable-5): add new models [bot]#1316

Open
models-bot[bot] wants to merge 6 commits into
mainfrom
bot/add-aws-bedrock-global.anthropic.claude-fable-5-20260609-182151
Open

feat(aws-bedrock/global.anthropic.claude-fable-5): add new models [bot]#1316
models-bot[bot] wants to merge 6 commits into
mainfrom
bot/add-aws-bedrock-global.anthropic.claude-fable-5-20260609-182151

Conversation

@models-bot

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

Copy link
Copy Markdown
Contributor

Auto-generated by model-addition-agent for aws-bedrock/global.anthropic.claude-fable-5.


Note

Low Risk
Metadata-only addition with no runtime or routing logic changes; main review risk is incorrect pricing or limits affecting billing estimates.

Overview
Adds a new AWS Bedrock provider definition for global.anthropic.claude-fable-5 so the model can be selected and costed like other Bedrock Anthropic entries.

The YAML registers per-region token pricing (including prompt-cache read/create costs) across the usual global regions, marks the model active and serverless, and documents 1M context / 128K max output, thinking enabled, chat mode, and modalities text, image, and PDF in / text out. It also lists capabilities (tools, prompt caching, structured output, etc.) and default max_tokens, temperature, and top_p bounds, with links to AWS and Anthropic docs as sources.

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

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 24
  • Passed: 0
  • Failed: 22
  • Validation failed: 0
  • Errored: 0
  • Skipped: 2
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: structured-output:stream:boto3, parallel-tool-call:boto3, tool-call:boto3, structured-output:boto3, parallel-tool-call:stream:boto3, reasoning:boto3, tool-call:stream:boto3, reasoning:stream:boto3, params:boto3, params:stream:boto3, params:stream, reasoning, reasoning:stream, params, json-output:stream, json-output, parallel-tool-call, structured-output:stream, parallel-tool-call:stream, structured-output, tool-call:stream, tool-call

skipped: json-output:boto3, json-output:stream:boto3
Failures (22)

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp4d7p2vag/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpf6jqmv30/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8509_bzh/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpezeoouom/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphbd28ln_/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp1gjsqn8e/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpu0ad2jtm/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8jzcxlcm/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpbll0h_5l/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp98fye7la/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp_wrl93mi/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpztucrcb8/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpdf9iho_9/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpryojdtt3/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — json-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp808asv8s/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. Respond in JSON format."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — json-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmplrqyh071/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. Respond in JSON format."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpwn3zata0/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp62g06il8/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmptril1is_/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsdxkvqtd/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpyilqdk1d/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp_hh3jooj/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")
Skipped (2)

aws-bedrock/global.anthropic.claude-fable-5 — json-output:boto3 (skipped)

Skip reason
json-output is not supported by bedrock-converse

aws-bedrock/global.anthropic.claude-fable-5 — json-output:stream:boto3 (skipped)

Skip reason
json-output is not supported by bedrock-converse

Comment thread providers/aws-bedrock/global.anthropic.claude-fable-5.yaml Outdated
Comment thread providers/aws-bedrock/global.anthropic.claude-fable-5.yaml
@harshiv-26

Copy link
Copy Markdown
Collaborator

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 24
  • Passed: 0
  • Failed: 22
  • Validation failed: 0
  • Errored: 0
  • Skipped: 2
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: tool-call:boto3, reasoning:boto3, parallel-tool-call:stream:boto3, params:boto3, params:stream:boto3, structured-output:boto3, parallel-tool-call:boto3, reasoning:stream:boto3, structured-output:stream:boto3, tool-call:stream:boto3, structured-output, parallel-tool-call:stream, params, parallel-tool-call, json-output, params:stream, reasoning, structured-output:stream, reasoning:stream, tool-call:stream, tool-call, json-output:stream

skipped: json-output:boto3, json-output:stream:boto3
Failures (22)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsfs1ar7s/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpd7i6xn_h/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpylof6vru/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpckd9ct9i/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphien0bs9/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp1_j2fjop/snippet.py", line 59, 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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpxung9x7o/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpyxj203pj/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmprmb6ulk0/snippet.py", line 59, 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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpp9l6t1q0/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp5l5cn5ex/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp42eheo8m/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp_j5qnzup/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8pj1rwxw/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — json-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpdn200p65/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. Respond in JSON format."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp4z3nnv8r/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpl968p6zc/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpeay01_ln/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp9sjuw23s/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsq0ol1v8/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp9c7u14rp/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — json-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpn8tdjekk/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. Respond in JSON format."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")
Skipped (2)

aws-bedrock/global.anthropic.claude-fable-5 — json-output:boto3 (skipped)

Skip reason
json-output is not supported by bedrock-converse

aws-bedrock/global.anthropic.claude-fable-5 — json-output:stream:boto3 (skipped)

Skip reason
json-output is not supported by bedrock-converse

@github-actions

Copy link
Copy Markdown
Contributor

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 20
  • Passed: 0
  • Failed: 20
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: tool-call:boto3, reasoning:boto3, parallel-tool-call:boto3, structured-output:boto3, reasoning:stream:boto3, params:boto3, structured-output:stream:boto3, params:stream:boto3, tool-call:stream:boto3, parallel-tool-call:stream:boto3, reasoning, structured-output, tool-call:stream, params, tool-call, parallel-tool-call:stream, parallel-tool-call, reasoning:stream, structured-output:stream, params:stream
Failures (20)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp67hta2uk/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpjdzgael3/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpktrhkqv4/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp6577wrbk/snippet.py", line 59, 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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp31lk771_/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp6n9kabrb/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp33rms45x/snippet.py", line 59, 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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmptxvgpxvz/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp15d0sg_l/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpqcnu1v2b/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpi92uikyq/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsptm0i_6/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpesfu0h0t/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpd6well4b/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpz2k9szyb/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp131l18a4/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpy57mm96l/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp5pfriwq7/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpydrgxex2/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpcrlguom6/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

- tool_choice
- prompt_caching
- cache_control
- structured_output

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Structured output wrongly enabled

Medium Severity

The config lists structured_output among features, but other global.anthropic Bedrock entries with the same Converse-style setup explicitly omit that flag with a note that structured output is not supported in bedrock-converse. That mismatch can make the gateway treat the model as schema-capable when it is not.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 543b6b4. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 20
  • Passed: 0
  • Failed: 20
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: parallel-tool-call:boto3, tool-call:boto3, tool-call:stream:boto3, structured-output:stream:boto3, reasoning:stream:boto3, reasoning:boto3, params:stream:boto3, structured-output:boto3, tool-call, parallel-tool-call:stream:boto3, params:boto3, parallel-tool-call:stream, params, structured-output, parallel-tool-call, tool-call:stream, params:stream, reasoning, structured-output:stream, reasoning:stream
Failures (20)

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpwu52kdol/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpc3fh5p3a/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpvyx5i1tz/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphgtzk29_/snippet.py", line 59, 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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpzzf_47d8/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8k_u_7vd/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpmnf6tny0/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpxuwbenzu/snippet.py", line 59, 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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpke7gvx7d/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpy3byee5e/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 (403) when calling the ConverseStream operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpso0ll34k/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 (403) when calling the Converse operation: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpo7ba0e4h/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsdjmqcm8/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp1wdoz08g/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpzdhddr1z/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp3zzuqd7g/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpo1tjjd7g/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpjfp2hqr4/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp24sacym0/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpye51inp6/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

@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.

There are 2 total unresolved issues (including 1 from previous review).

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 bf2da24. Configure here.

key: top_p
maxValue: 1.0
minValue: 0
provisioning: serverless

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unsupported sampling params declared

High Severity

This Bedrock entry exposes temperature and top_p under params but omits removeParams for them. Fable 5 rejects those sampling fields (same as Opus 4.7+), while aws-bedrock/default.yaml still supplies defaults—so merged gateway requests can include them and get 400s across scenarios.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bf2da24. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 20
  • Passed: 0
  • Failed: 20
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: params:boto3, reasoning:boto3, parallel-tool-call:stream:boto3, parallel-tool-call:boto3, structured-output:stream:boto3, params:stream:boto3, tool-call:stream:boto3, tool-call:boto3, reasoning:stream:boto3, structured-output:boto3, parallel-tool-call:stream, params:stream, tool-call, tool-call:stream, params, parallel-tool-call, reasoning, reasoning:stream, structured-output:stream, structured-output
Failures (20)

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpnet4_rml/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpocje0aqm/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsq4voqv9/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpx91vh2ft/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp7jy5k_av/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpk8_x1qc2/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmps6krh2kk/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp29qvwq4b/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp18x9csb0/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpcd9th7ei/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp91iaorh4/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpf411g6f8/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.PermissionDeniedError: Error code: 403 - {'status': 'failure', 'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'error': {'message': 'aws-bedrock error: Model access is denied. Your AWS Marketplace subscription for this model is still being processed. Try again after 15 minutes.', 'type': 'APIError', 'code': '403'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpd_iibrba/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphx85s_xd/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpv5uetuw2/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmplvlw_8ts/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpjj1qwsch/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpms2hkj8_/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmptpjcarkb/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmph0yh71pk/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

@github-actions

Copy link
Copy Markdown
Contributor

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 20
  • Passed: 0
  • Failed: 20
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: parallel-tool-call:boto3, tool-call:boto3, reasoning:boto3, structured-output:boto3, params:boto3, tool-call:stream:boto3, parallel-tool-call:stream:boto3, reasoning:stream:boto3, structured-output:stream:boto3, params:stream:boto3, parallel-tool-call, tool-call:stream, tool-call, params:stream, parallel-tool-call:stream, structured-output, reasoning:stream, params, reasoning, structured-output:stream
Failures (20)

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphk1skz0c/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsxg3pdva/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmppdu915nr/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsl4x1o50/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpj7hipqxk/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp9rrmflpl/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpsah0j92q/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpoa533okw/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphn6dqu1m/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmprcojsai9/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmphg6qcwx2/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpng2mr2xo/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpl70n12c9/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp4qlxi32p/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp86jyri9p/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpe_2t7rj0/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpxse9re64/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp5j_4w3ti/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpkctomh6f/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp2_o3z4z4/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

@harshiv-26

Copy link
Copy Markdown
Collaborator

/test-models

@harshiv-26

Copy link
Copy Markdown
Collaborator

Gateway test results

  • Total: 20
  • Passed: 0
  • Failed: 20
  • Validation failed: 0
  • Errored: 0
  • Skipped: 0
  • Success rate: 0.0%
Provider Model Scenarios
aws-bedrock global.anthropic.claude-fable-5 failure: tool-call:boto3, reasoning:boto3, parallel-tool-call:boto3, tool-call:stream:boto3, structured-output:stream:boto3, reasoning:stream:boto3, structured-output:boto3, params:boto3, parallel-tool-call:stream:boto3, params:stream:boto3, tool-call:stream, tool-call, structured-output, reasoning:stream, params:stream, reasoning, parallel-tool-call, structured-output:stream, parallel-tool-call:stream, params
Failures (20)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp3exe5qao/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 not _tool_uses:
    raise Exception("VALIDATION FAILED: tool-call - no tool uses in Bedrock response")
print("VALIDATION: tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp0dgnhcqf/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

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

for _block in _content:
    if "reasoningContent" in _block:
        _reasoning_detected = True

_usage = response.get("usage", {})
if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
    _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpu1k8rsq2/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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:
    print(f"Number of parallel tool calls: {len(_tool_uses)}")

if not _tool_uses or len(_tool_uses) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_tool_uses) if _tool_uses else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpv3u4f218/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "toolUse" in _delta:
            _tool_use_detected = 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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpyhv8c2q8/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

_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)
import json as _json

_accumulated_text = ""

for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "text" in _delta:
            _accumulated_text += _delta["text"]

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

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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpabv9dhrw/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": "How to calculate 3^3^3^3? Think step by step and show all reasoning."}]},
]

system = [{"text": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."}]

response = client.converse_stream(
    modelId=_model,
    system=system,
    messages=messages,
    additionalModelRequestFields={
        "thinking": {"type":"adaptive"},
    },
)

_events = []
for _event in response["stream"]:
    _events.append(_event)
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            print(_delta["reasoningContent"].get("text", ""), end="", flush=True)
        if "text" in _delta:
            print(_delta["text"], end="", flush=True)
_reasoning_detected = False
for _event in _events:
    if "contentBlockDelta" in _event:
        _delta = _event["contentBlockDelta"].get("delta", {})
        if "reasoningContent" in _delta:
            _reasoning_detected = True
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"].get("start", {})
        if "reasoningContent" in _start:
            _reasoning_detected = True
    if "metadata" in _event:
        _usage = _event["metadata"].get("usage", {})
        if _usage.get("reasoning_tokens") or _usage.get("reasoningTokens"):
            _reasoning_detected = True

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

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpuhni_yvt/snippet.py", line 59, 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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
import json
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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"],
    "additionalProperties": False,
}

output_config = {
    "textFormat": {
        "type": "json_schema",
        "structure": {
            "jsonSchema": {
                "schema": json.dumps(response_schema),
                "name": "CalendarEvent",
                "description": "Extract event information as a structured 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 as JSON matching the provided schema."}]

response = client.converse(
    modelId=_model,
    system=system,
    messages=messages,
    outputConfig=output_config,
)

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

_content = response["output"]["message"]["content"]
_text_blocks = [block["text"] for block in _content if "text" in block]
_text = "".join(_text_blocks)
if not _text:
    raise Exception("VALIDATION FAILED: structured-output - no content received from Bedrock response")
_parsed = _json.loads(_text)

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")

aws-bedrock/global.anthropic.claude-fable-5 — params:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpjkilfnd7/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

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

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpkwas720a/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."}]},
]

system = [{"text": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."}]

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_indices = set()
_current_index = -1
for _event in _events:
    if "contentBlockStart" in _event:
        _start = _event["contentBlockStart"]
        _current_index = _start.get("contentBlockIndex", _current_index + 1)
        if "toolUse" in _start.get("start", {}):
            _tool_use_indices.add(_current_index)

if len(_tool_use_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_use_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_use_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream:boto3 (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpe9lmeopj/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: The model returned the following errors: data retention mode 'default' is not available for this model
Code snippet
import boto3
from botocore.config import Config

_endpoint = "https://internal.devtest.truefoundry.tech/api/llm"
_api_key = "***"
_model = "test-v2-aws-bedrock/global.anthropic.claude-fable-5"

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": 1000,
        "temperature": 1,
    },
)

_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)

aws-bedrock/global.anthropic.claude-fable-5 — tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpil0mp46w/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp05gs3d0w/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp96y4n3me/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — reasoning:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8t3ri3qg/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — params:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpuifm0qgp/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    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)

aws-bedrock/global.anthropic.claude-fable-5 — reasoning (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpu6g3l_go/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant. You MUST think step by step and show your reasoning. Never skip reasoning steps."},
        {"role": "user", "content": "Hi"},
        {"role": "assistant", "content": "Hi, how can I help you"},
        {"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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmpyuyomtea/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
    print(f"Number of parallel tool calls: {len(_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) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call - expected at least 1 tool call, "
        f"got {len(_message.tool_calls) if _message.tool_calls else 0}"
    )
print("VALIDATION: parallel-tool-call SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — structured-output:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp8uanxe_s/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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")

aws-bedrock/global.anthropic.claude-fable-5 — parallel-tool-call:stream (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmptknubrve/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    messages=[
        {"role": "system", "content": "You are a helpful assistant with access to tools. You MUST strictly call multiple tools in parallel whenever possible. Never call them sequentially."},
        {"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 and Paris. You MUST make both tool calls strictly in parallel, not sequentially."},
    ],
    tools=tools,
    tool_choice="auto",
    parallel_tool_calls=True,
    stream=True,
)
_tool_call_indices = set()
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:
            for _tc in delta.tool_calls:
                _tool_call_indices.add(_tc.index)
                if _tc.function:
                    print(_tc.function.arguments or "", end="", flush=True)

if len(_tool_call_indices) < 1:
    raise Exception(
        f"VALIDATION FAILED: parallel-tool-call stream - expected at least 1 tool call, "
        f"got {len(_tool_call_indices)}"
    )
print(f"\nNumber of parallel tool calls: {len(_tool_call_indices)}")
print("VALIDATION: parallel-tool-call stream SUCCESS")

aws-bedrock/global.anthropic.claude-fable-5 — params (failure)

Error
Traceback (most recent call last):
  File "/tmp/tmp9s4kj5je/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': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'error': {'message': "aws-bedrock error: The model returned the following errors: data retention mode 'default' is not available for this model", 'type': 'APIError', 'code': '400'}, 'error_origin_level': 'api_error', 'provider': 'aws-bedrock'}
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-aws-bedrock/global.anthropic.claude-fable-5",
    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=1000,
    temperature=1,
    stream=False,
)

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

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