Repository navigation
Closed
Closed
Copy link
Labels
Description
name: Unsupported parameter
about: Report a problem with the Unsloth Studio desktop app
title: "[Bug] Unsupported parameter: 'max_tokens' instead of 'max_completion_tokens'."
labels: bug, feature request
assignees: ""
Environment
Where are you using Unsloth?
- Unsloth desktop application
- Unsloth web UI (
unsloth studio) - Unsloth CLI
- Python package or notebook
- Colab or Kaggle
Operating system and version:
GPU model(s) and accelerator backend: Connection (not applicable)
Versions:
Unsloth Version: v0.1.808-beta
Package Version: 2026.9.4
Desktop App Version: 0.1.808-beta
llama.cpp Version: b10840-mix-d5c17a0
What happened?
Steps to reproduce:
- Connect to a ChatGPT-5 model that uses 'max_completion_tokens' or 'maxOutputTokens'
- Confirm all models are loaded
- Test and get sad
Expected behavior:
Response
Actual behavior:
Error message, see below.
Model and operation involved:
Model: gpt-5.5
Operator: Microsoft Azure
Diagnostics and logs
Full error: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. (unsupported_parameter)
10:12:04 [INFO] [backend] {"timestamp": "2026-09-11T10:12:04.323074Z", "level": "info", "event": "Proxying chat completion to https://chat.kiconnect.nrw/api/v1/chat/completions (provider=custom, model=GPT5-Mitarbeitende)"}
10:12:04 [INFO] [backend] {"timestamp": "2026-09-11T10:12:04.804473Z", "level": "error", "event": "External provider returned 400: {\n \"error\": {\n \"message\": \"Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"max_tokens\",\n \"code\": \"unsupported_parameter\"\n }\n}"}
Comparable configuration
In github copilot in VS Code this JSON config is fully functional.
{
"name": "KI:connect",
"vendor": "customendpoint",
"apiKey": "${REDACTED}",
"apiType": "chat-completions",
"models": [{
"id": "GPT5-Mitarbeitende",
"name": "KI:connect — GPT5-Mitarbeitende",
"url": "https://chat.kiconnect.nrw/api/v1/chat/completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 120000,
"maxOutputTokens": 8000,
"streaming": true,
"modelOptions": {
"temperature": 1
}
}, ....
Activity
fix(studio): retry custom chat with max_completion_tokens on 400
fix(studio): narrow unslothai#10787 max_tokens field selection and retry
devtyagi3909 commentedon Sep 18, 2026
yeah this is because the backend explicitly hardcodes
max_tokenswhen packing the custom provider payload, but newer endpoints (like o1 and apparently your mock gpt-5) enforce the newermax_completion_tokensstandard. the client config allows passing it, but it gets eaten or mismapped before the request fires. we should probably just normalizemax_tokenstomax_completion_tokensduring the proxy build step for those providers. i can prototype the fix if you agree.fix(studio): narrow unslothai#10787 max_tokens field selection and retry
fix(studio): drop proactive Azure URL max_tokens field rule (unslotha…
Studio: retry custom gateways with max_completion_tokens after a max_…