You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to set a local provider in opencode TUI? #10547
where should I put the file opencode.json, is the file correct? { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (local)", "options": { "baseURL": "http://localhost:8080/v1" }, "models": { "GLM-4.7-Flash-UD-Q5_K_XL.gguf": { "name": "GLM-4.7-Flash-UD-Q5_K_XL.gguf" } } } } }
Is there any entry to set the local provider from opencode TUI?
I use the Windows version (Windows Server 2019, latest version 1.1.35, OpenCode Desktop Installer.exe).
Thanks. I found this issue #6783
is useful. I tried to put config.json in %USERPROFILE%.config\opencode folder: { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (Local)", "options": { "baseURL": "localhost:15432/v1" }, "models": { "GLM-4.7-Flash-UD-Q5_K_XL.gguf": { "name": "GLM-4.7-Flash-UD-Q5_K_XL.gguf", } } } } }
and start Opencode again. I found in the bottom of Opencode TUI appears 'Big Pickle', and the local models are all list here.
But after I selected 'GLM-4.7-Flash-UD-Q5_K_XL.gguf' from the list (the llama-server also launched this one) and type a question in the window, the opencode replied:
Error: Unable to connect. Is the computer able to access the url?
I try this yesterday, and I had the same error. I solve this just activating the local server on developer section on LM Studio. Then I restart Opencode and this work for me. Be sure if the BaseURL is the same that LM Studio is show you.
However, currently although the opencode is connected with the llama_server, the same question, the web by llama_server can give result after several minutes, but in the opencode, I have waited for more than 1 hours, no any response...
However, currently although the opencode is connected with the llama_server, the same question, the web by llama_server can give result after several minutes, but in the opencode, I have waited for more than 1 hours, no any response...
Is there still something wrong?
Thanks, Tang Laoya
Hello Tang Laoya, thats because Opencode send a lot of context in tokens. If you have MCPs the number of tokens increments. A partial solution is disable the MCPs servers. In my case, in LM Studio, I send a simple greeting, and I had a response in seconds, but then I try the same thing in Opencode and I had a response in 4 minute, for a simple greeting. That's because Opencode send to the local model 18k of tokens of context approx. While in LM Studio send a few 42 tokens. The model had a lot of tokens to process in comparison
Activity
github-actions commentedon Jan 25, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
TangLaoya commentedon Jan 25, 2026
Thanks. I found this issue
#6783
is useful. I tried to put config.json in %USERPROFILE%.config\opencode folder:
{ "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (Local)", "options": { "baseURL": "localhost:15432/v1" }, "models": { "GLM-4.7-Flash-UD-Q5_K_XL.gguf": { "name": "GLM-4.7-Flash-UD-Q5_K_XL.gguf", } } } } }and start Opencode again. I found in the bottom of Opencode TUI appears 'Big Pickle', and the local models are all list here.
But after I selected 'GLM-4.7-Flash-UD-Q5_K_XL.gguf' from the list (the llama-server also launched this one) and type a question in the window, the opencode replied:
Error: Unable to connect. Is the computer able to access the url?
What should I do furthermore?
Thanks,
Tang Laoya
justfortheloveof commentedon Jan 25, 2026
Try adding
http://(orhttps://) to your baseURL, make sure the port is accurate as well.R44VC0RP commentedon Jan 25, 2026
Thanks @justfortheloveof for the assist!
@TangLaoya - the fix is to add
http://to your baseURL:The LM Studio docs show the correct format. Let us know if you hit any other issues!
Velkez commentedon Jan 25, 2026
I try this yesterday, and I had the same error. I solve this just activating the local server on developer section on LM Studio. Then I restart Opencode and this work for me. Be sure if the BaseURL is the same that LM Studio is show you.
TangLaoya commentedon Jan 26, 2026
Thanks. After set the correct BaseURL, the problem is solved.
TangLaoya commentedon Jan 26, 2026
However, currently although the opencode is connected with the llama_server, the same question, the web by llama_server can give result after several minutes, but in the opencode, I have waited for more than 1 hours, no any response...
Is there still something wrong?
Thanks,
Tang Laoya
Velkez commentedon Jan 26, 2026
Hello Tang Laoya, thats because Opencode send a lot of context in tokens. If you have MCPs the number of tokens increments. A partial solution is disable the MCPs servers. In my case, in LM Studio, I send a simple greeting, and I had a response in seconds, but then I try the same thing in Opencode and I had a response in 4 minute, for a simple greeting. That's because Opencode send to the local model 18k of tokens of context approx. While in LM Studio send a few 42 tokens. The model had a lot of tokens to process in comparison
TangLaoya commentedon Jan 27, 2026
That's great, thank you very much.
But how to disable the MCPs servers in opencode?
Thanks,
Tang Laoya