litellm - 💡(How to fix) Fix [Bug]: LiteLLM Proxy doesn't drop 'minimum' or 'maximum' on Bedrock anymore [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: output_config.format.schema: For 'number' type, properties maximum, minimum are not supported"}

Root Cause

We use minimum and maximum in our JSON schemas and we don't want to remove them because some LLM/Providers support it:

Fix Action

Fixed

Code Example

"score": {
  "type": "number",
  "minimum": 0,
  "maximum": 1,
  "description": "..."
}

---

litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: output_config.format.schema: For \'number\' type, properties maximum, minimum are not supported"}

---

import openai

client = openai.OpenAI(
    api_key='...',
    base_url='...'
)

json_schema = {
    "name": "ExampleSchema",
    "schema": {
        "type": "object",
        "properties": {
            "score": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "A value between 0 and 1"
            }
        },
        "required": ["score"],
        "additionalProperties": False
    }
}

response = client.chat.completions.create(
    model="bedrock/global.anthropic.claude-sonnet-4-6",
    response_format={
        "type": "json_schema", 
        "json_schema": json_schema, 
        "strict": True
    },
    messages=[{
        "role": "user",
        "content": "create a JSON object according to provided schema"
    }]
)

print(response.choices[0].message)

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Old Version: v1.81.9 New Version: v1.86.2

We use minimum and maximum in our JSON schemas and we don't want to remove them because some LLM/Providers support it:

"score": {
  "type": "number",
  "minimum": 0,
  "maximum": 1,
  "description": "..."
}

Our old LiteLLM Proxy was dropping this correctly for requests to claude-sonnet-4-6 on AWS Bedrock which doesn't seem to support these.

With the new version, we get this error:

litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: output_config.format.schema: For \'number\' type, properties maximum, minimum are not supported"}

Steps to Reproduce

  1. Create a tool/function (or try to create a JSON object from schema) with minimum or maximum
  2. Send to Bedrock

Here is a minimal Python example that stopped working in new version:

import openai

client = openai.OpenAI(
    api_key='...',
    base_url='...'
)

json_schema = {
    "name": "ExampleSchema",
    "schema": {
        "type": "object",
        "properties": {
            "score": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "A value between 0 and 1"
            }
        },
        "required": ["score"],
        "additionalProperties": False
    }
}

response = client.chat.completions.create(
    model="bedrock/global.anthropic.claude-sonnet-4-6",
    response_format={
        "type": "json_schema", 
        "json_schema": json_schema, 
        "strict": True
    },
    messages=[{
        "role": "user",
        "content": "create a JSON object according to provided schema"
    }]
)

print(response.choices[0].message)

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.86.2

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING