-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Problem
Using BYOK with Grok 4.1 returns a 400 error:
Error: 400 "Model grok-4-1-fast-reasoning does not support parameter reasoningEffort."
here is the config.json entry that caused the error:
{
"model": "grok-4-1-fast-reasoning",
"id": "custom:Grok-4.1-0",
"index": 0,
"baseUrl": "https://api.x.ai/v1",
"apiKey": "xai-****",
"displayName": "Grok 4.1",
"maxOutputTokens": 8192,
"noImageSupport": false,
"provider": "openai"
}x.ai removed support of reasoning_effort after Grok-3, but the parameter is sent by droid automatically, which is why this fails.
Solution (temporary)
added an https proxy that removes the parameter:
mitmproxy --mode reverse:https://api.x.ai -s remove_reasoning.py
# remove_reasoning.py
import json
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
if "application/json" in flow.request.headers.get("Content-Type", ""):
try:
data = json.loads(flow.request.get_text())
if "reasoning" in data:
del data["reasoning"]
flow.request.text = json.dumps(data)
except json.JSONDecodeError:
passthen update config.json: "baseUrl": "http://localhost:8080/v1"
Suggestion
A long term fix would involve adding an unsupportedParams or something similar to config.json (essentially the inverse of extraArgs) so that unsupported params don't lead to 400s
Thank you! :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels