Repository navigation
Description
I'm trying to strip thinking tokens from various models served by nano-gpt.com. There are two methods. I have verified they work with direct curl commands, but when I set it up in the opencode config, I either get an API error or the thinking tokens are not stripped (so the option is not forwarded).
Here's a sample config that generates an AI_APICallError (works fine without the :reasoning-exclude suffix):
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"nanogpt": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://nano-gpt.com/api/v1"
},
"models": {
"Qwen/Qwen3-235B-A22B-Thinking-2507:reasoning-exclude": {}
}
}
}
}
Another sample config that works but fails to strip thinking tokens:
{
"$schema": "https://opencode.ai/config.json",
"model": "nanogpt/Qwen/Qwen3-235B-A22B-Thinking-2507",
"provider": {
"nanogpt": {
"npm": "@ai-sdk/openai-compatible",
"name": "NanoGPT",
"options": {
"baseURL": "https://nano-gpt.com/api/v1"
},
"models": {
"Qwen/Qwen3-235B-A22B-Thinking-2507": {
"options": {
"NanoGPT": {
"reasoning": { "exclude": true }
}
}
}
}
}
}
}
Nano-gpt documentation here: https://docs.nano-gpt.com/api-reference/endpoint/chat-completion
This curl command works fine and strips the think tokens:
curl -sS https://nano-gpt.com/api/v1/chat/completions \
-H "Authorization: Bearer $NEVER_ECHO_MY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model":"Qwen/Qwen3-235B-A22B-Thinking-2507:reasoning-exclude",
"messages":[{"role":"user","content":"Say hi"}]
}'
gpt5 is sending me in circles and I can't figure this out. I used Qwen as an example here but the issues hold true for other models too. Somehow the suffix is breaking the request?
Activity
arsham commentedon Sep 10, 2025
Would this help? I think you can try to log the object to see what you can delete from.
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!