litellm - ✅(Solved) Fix [Bug]: Xiaomi MiMo models: 'output_config' parameter causes AsyncCompletions.create() to fail with Claude Code [1 pull requests, 5 comments, 4 participants]

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…
GitHub stats
BerriAI/litellm#24549Fetched 2026-04-08 01:27:09
View on GitHub
Comments
5
Participants
4
Timeline
13
Reactions
0
Timeline (top)
commented ×5labeled ×5cross-referenced ×1referenced ×1

Error Message

Xiaomi_mimoException - AsyncCompletions.create() got an unexpected keyword argument 'output_config'

Root Cause

Root Cause: The output_config parameter is Anthropic-specific and not supported by Xiaomi's AsyncCompletions.create() API. LiteLLM must filter this parameter before passing kwargs to the Xiaomi SDK.

Fix Action

Fix / Workaround

Workaround: Client applications must detect Xiaomi models and strip output_config before making requests.

PR fix notes

PR #24552: fix: filter Anthropic-only output_config from non-Anthropic providers

Description (problem / solution / changelog)

Summary

Fixes #24549

output_config (Anthropic-specific reasoning effort parameter) leaked into optional_params for non-Anthropic providers like xiaomi_mimo, causing:

AsyncCompletions.create() got an unexpected keyword argument 'output_config'

Root Cause

In add_provider_specific_params_to_optional_params(), the else branch blindly copied all non-standard kwargs into optional_params, including Anthropic-only params.

Fix

  • Added _ANTHROPIC_ONLY_EXTRA_PARAMS = ["output_config"]
  • In the else branch, skip these params for non-Anthropic providers
  • Verified output_config still reaches Anthropic transformers correctly

Tests

Added TestXiaomiMiMoOutputConfigFiltering in tests/test_litellm/llms/openai_like/test_xiaomi_mimo.py

Changed files

  • litellm/utils.py (modified, +20/-0)
  • tests/test_litellm/llms/openai_like/test_xiaomi_mimo.py (modified, +46/-0)

Code Example

Xiaomi_mimoException - AsyncCompletions.create() got an unexpected keyword argument 'output_config'

---

import requests

BASE_URL = "https://your-litellm-proxy"
API_KEY = "your-api-key"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

# Test 1: MiMo-V2-Pro on /v1/messages - FAILS
payload1 = {
    "model": "MiMo-V2-Pro",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}],
    "output_config": {"effort": "medium"}
}
r1 = requests.post(f"{BASE_URL}/v1/messages", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/messages: {r1.status_code}")  # 500

# Test 2: MiMo-V2-Pro on /v1/chat/completions - WORKS!
r2 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/chat/completions: {r2.status_code}")  # 200

# Test 3: MiMo-V2-Omni on /v1/chat/completions - FAILS
payload2 = {**payload1, "model": "MiMo-V2-Omni"}
r3 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload2)
print(f"MiMo-V2-Omni /v1/chat/completions: {r3.status_code}")  # 500

# Test 4: Adding streaming makes MiMo-V2-Pro fail on /v1/chat/completions
payload3 = {**payload1, "stream": True}
r4 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload3, stream=True)
print(f"MiMo-V2-Pro /v1/chat/completions + stream: {r4.status_code}")  # 500

---

================================================================================
MODEL: MiMo-V2-Pro
================================================================================
1. /v1/messages + output_config:500 FAILED
2. /v1/messages + output_config + streaming:500 FAILED
3. /v1/messages + output_config + tools:500 FAILED
4. /v1/messages + output_config + system:500 FAILED
5. /v1/chat/completions + output_config:200 SUCCESS
6. /v1/chat/completions + output_config + streaming:500 FAILED

================================================================================
MODEL: MiMo-V2-Omni
================================================================================
1. /v1/messages + output_config:500 FAILED
2. /v1/messages + output_config + streaming:500 FAILED
3. /v1/messages + output_config + tools:500 FAILED
4. /v1/messages + output_config + system:500 FAILED
5. /v1/chat/completions + output_config:500 FAILED
6. /v1/chat/completions + output_config + streaming:500 FAILED

Error Message:

litellm.APIConnectionError: Xiaomi_mimoException - AsyncCompletions.create() got an unexpected keyword argument 'output_config'. Received Model Group=MiMo-V2-Pro
Available Model Group Fallbacks=None
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?

When using Xiaomi MiMo models (MiMo-V2-Pro and MiMo-V2-Omni) with the output_config parameter, requests fail with:

Xiaomi_mimoException - AsyncCompletions.create() got an unexpected keyword argument 'output_config'

Test Results Summary:

MiMo-V2-Pro:

  • /v1/messages + output_config: ❌ FAILS (all combinations)
  • /v1/chat/completions + output_config alone: ✅ WORKS (only scenario that works)
  • /v1/chat/completions + output_config + streaming: ❌ FAILS

MiMo-V2-Omni:

  • /v1/messages + output_config: ❌ FAILS (all combinations)
  • /v1/chat/completions + output_config: ❌ FAILS (all combinations)

Expected: LiteLLM should filter provider-specific parameters (like output_config) before calling the provider's SDK, similar to how other Anthropic-specific parameters are handled.

Actual: The parameter is passed through unfiltered, breaking Xiaomi model requests.

Steps to Reproduce

import requests

BASE_URL = "https://your-litellm-proxy"
API_KEY = "your-api-key"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

# Test 1: MiMo-V2-Pro on /v1/messages - FAILS
payload1 = {
    "model": "MiMo-V2-Pro",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}],
    "output_config": {"effort": "medium"}
}
r1 = requests.post(f"{BASE_URL}/v1/messages", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/messages: {r1.status_code}")  # 500

# Test 2: MiMo-V2-Pro on /v1/chat/completions - WORKS!
r2 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/chat/completions: {r2.status_code}")  # 200

# Test 3: MiMo-V2-Omni on /v1/chat/completions - FAILS
payload2 = {**payload1, "model": "MiMo-V2-Omni"}
r3 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload2)
print(f"MiMo-V2-Omni /v1/chat/completions: {r3.status_code}")  # 500

# Test 4: Adding streaming makes MiMo-V2-Pro fail on /v1/chat/completions
payload3 = {**payload1, "stream": True}
r4 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload3, stream=True)
print(f"MiMo-V2-Pro /v1/chat/completions + stream: {r4.status_code}")  # 500

Root Cause: The output_config parameter is Anthropic-specific and not supported by Xiaomi's AsyncCompletions.create() API. LiteLLM must filter this parameter before passing kwargs to the Xiaomi SDK.

Why This Matters:

  • Claude Code IDE sends output_config by default, making Xiaomi models completely unusable in Claude Code
  • The parameter filtering is inconsistent between models and endpoints
  • MiMo-V2-Pro has ONE working scenario (/v1/chat/completions without streaming), but MiMo-V2-Omni fails everywhere

Suggested Fix: Add output_config to the list of parameters to exclude in the Xiaomi provider handler before calling AsyncCompletions.create(). Check:

  • litellm/llms/xiaomi_mimo/chat/handler.py
  • Anthropic passthrough handlers that may be routing these requests

Similar Issues: This same pattern could affect other Anthropic-specific parameters like thinking, cache_control, etc. when used with providers that don't support them.

Workaround: Client applications must detect Xiaomi models and strip output_config before making requests.

Relevant log output

================================================================================
MODEL: MiMo-V2-Pro
================================================================================
1. /v1/messages + output_config:              ❌ 500 FAILED
2. /v1/messages + output_config + streaming:  ❌ 500 FAILED
3. /v1/messages + output_config + tools:      ❌ 500 FAILED
4. /v1/messages + output_config + system:     ❌ 500 FAILED
5. /v1/chat/completions + output_config:      ✅ 200 SUCCESS
6. /v1/chat/completions + output_config + streaming: ❌ 500 FAILED

================================================================================
MODEL: MiMo-V2-Omni
================================================================================
1. /v1/messages + output_config:              ❌ 500 FAILED
2. /v1/messages + output_config + streaming:  ❌ 500 FAILED
3. /v1/messages + output_config + tools:      ❌ 500 FAILED
4. /v1/messages + output_config + system:     ❌ 500 FAILED
5. /v1/chat/completions + output_config:      ❌ 500 FAILED
6. /v1/chat/completions + output_config + streaming: ❌ 500 FAILED

Error Message:

litellm.APIConnectionError: Xiaomi_mimoException - AsyncCompletions.create() got an unexpected keyword argument 'output_config'. Received Model Group=MiMo-V2-Pro
Available Model Group Fallbacks=None

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.81.12

Twitter / LinkedIn details

https://www.linkedin.com/in/nrkshna/

extent analysis

Fix Plan

To resolve the issue, we need to filter out the output_config parameter before passing it to the Xiaomi SDK. We can achieve this by modifying the Xiaomi provider handler.

Step 1: Modify the Xiaomi Provider Handler

In litellm/llms/xiaomi_mimo/chat/handler.py, add output_config to the list of excluded parameters.

# litellm/llms/xiaomi_mimo/chat/handler.py

class XiaomiMimoHandler:
    # ...

    def __init__(self, *args, **kwargs):
        # ...
        self.excluded_params = ['output_config']  # Add output_config to excluded params

    def create_completion(self, **kwargs):
        # Filter out excluded parameters
        filtered_kwargs = {k: v for k, v in kwargs.items() if k not in self.excluded_params}
        # ...
        return AsyncCompletions.create(**filtered_kwargs)

Step 2: Update Anthropic Passthrough Handlers

Verify that Anthropic passthrough handlers are correctly routing requests and not passing output_config to the Xiaomi SDK.

# litellm/llms/anthropic/passthrough/handler.py

class AnthropicPassthroughHandler:
    # ...

    def create_completion(self, **kwargs):
        # Filter out excluded parameters for Xiaomi models
        if kwargs.get('model') in ['MiMo-V2-Pro', 'MiMo-V2-Omni']:
            filtered_kwargs = {k: v for k, v in kwargs.items() if k not in ['output_config']}
            return self.xiaomi_handler.create_completion(**filtered_kwargs)
        # ...

Verification

To verify the fix, run the test cases again with the modified handler.

# Test 1: MiMo-V2-Pro on /v1/messages
payload1 = {
    "model": "MiMo-V2-Pro",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}],
    "output_config": {"effort": "medium"}
}
r1 = requests.post(f"{BASE_URL}/v1/messages", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/messages: {r1.status_code}")  # Should return 200

# Test 2: MiMo-V2-Pro on /v1/chat/completions
r2 = requests.post(f"{BASE_URL}/v1/chat/completions", headers=headers, json=payload1)
print(f"MiMo-V2-Pro /v1/chat/completions: {r2.status_code}")  # Should return 200

# Test 3: MiMo-V2-Omni on /v1/chat/completions
payload2 = {**payload1, "model": "MiMo-V2-Omni

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