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
I'm running LM Studio locally and I've found that if I add/remove models in LM Studio the list of models in opencode isn't getting refreshed even if I do an auth logoutauth login cycle, is there a quick way to fix this?
I'm not sure it's an issue with the LM Studio exactly it's more an issue with how refreshing the models cache works - it seems like there's not a way to easily force a refresh or break the cache
When I run models in LM Studio the list of models available has a much higher rate of change then it does for a commercial vendor you can "eject" models and "load" models somewhat arbitrarily.
I believe I have encountered a similar issue. Although GitHub made Claude Sonnet General available, I see it as a preview. (GitHub Copilot Claude Sonnet 4.5 (Preview))
currently opencode isnt hitting the models endpoint of your provider, we should add something like that but currently everything comes from models.dev and your opencode config
I think removing the ghost endpoint when its found no longer alive is the best way to implement this. This way, we don't need to refresh model list everytime launch etc.
It seems when you delete models via the interface, some may not be getting cleaned up properly in the .internal/model-data.json when the names or aliases are close or the same. I think in my case, the alias was the same qwen3-coder-next. When I modified the .internal/model-data.json to remove two deleted model entries, once saved, the list of models refreshed on its own. Initially, it listed the models with their full name and the alias, and double entries for all models. I tried the refresh list, and it listed everything as expected. My issue involved similarly named models qwen3-coder-next (lingering entry) and the newly added Qwen3-Coder-Next-MLX-6bit.
I'm running into this problem too. I downloaded a new model in LM Studio and want to use it in OpenCode. When I do opencode models --refresh, it just gets the old list of models. Going to http://localhost:1234/v1/models shows the updated list so I think LM Studio is working fine. I reinstalled OpenCode and LM Studio, cleared cache files, and it's still the same.
It seems when you delete models via the interface, some may not be getting cleaned up properly in the .internal/model-data.json when the names or aliases are close or the same. I think in my case, the alias was the same qwen3-coder-next. When I modified the .internal/model-data.json to remove two deleted model entries, once saved, the list of models refreshed on its own. Initially, it listed the models with their full name and the alias, and double entries for all models. I tried the refresh list, and it listed everything as expected. My issue involved similarly named models qwen3-coder-next (lingering entry) and the newly added Qwen3-Coder-Next-MLX-6bit.
In my case
1, i deleted a model
2. then restored it from backup
the model refused to appear on the list of models inside the UI of LM studio
Hello, the problem is still present in version 1.16.2
opencode --version
1.16.2
I had LMStudio installed on my computer with several models that I hadn't used for a long time. I decided to update the list, but in the process, I accidentally deleted them and downloaded more recent versions. As a result, they remained in the opencode memory. The command opencode models --refresh doesn't update the list.
Could you please tell me where the model list is stored? I might try to fix this bug myself, if I can.
PS. If I request a list of models from LM Studio using curl http://localhost:1234/v1/models it returns a correct list. Therefore, I suspect that the models are not being updated by opencode.
Reacted by Leonid Vygovskiy, Luiz Junio and Ondřej Súkup
Activity
blankenshipz commentedon Aug 18, 2025
Removing the model cache file in
~/.cache/opencode/models.jsonalso did not help this issuerekram1-node commentedon Aug 18, 2025
I think I am gonna have to install LM Studio to see what you mean (never used it)
blankenshipz commentedon Aug 18, 2025
I'm not sure it's an issue with the LM Studio exactly it's more an issue with how refreshing the models cache works - it seems like there's not a way to easily force a refresh or break the cache
When I run models in LM Studio the list of models available has a much higher rate of change then it does for a commercial vendor you can "eject" models and "load" models somewhat arbitrarily.
shrwnsan commentedon Sep 26, 2025
Ran into this too
I've removed certain models from the OC config file, as well as LM Studio models dir
Removed OC cache dir as well
But I still see ghost models when I do
/modelstooperlator commentedon Oct 17, 2025
I believe I have encountered a similar issue. Although GitHub made Claude Sonnet General available, I see it as a preview. (
GitHub Copilot Claude Sonnet 4.5 (Preview))rekram1-node commentedon Oct 17, 2025
thats because the list of models comes from a models api that hasnt been updated with that change quite yet
models.dev
ill update that tho
rekram1-node commentedon Oct 17, 2025
@perlator fixed, may require u to restart opencode but model list should refresh
blankenshipz commentedon Oct 31, 2025
I'm still having this issue despite running the latest version of opencode
rekram1-node commentedon Oct 31, 2025
currently opencode isnt hitting the models endpoint of your provider, we should add something like that but currently everything comes from models.dev and your opencode config
KarthiDreamr commentedon Nov 16, 2025
marduk191 commentedon Feb 5, 2026
or get this, use the api correctly?
jecruz commentedon Feb 11, 2026
It seems when you delete models via the interface, some may not be getting cleaned up properly in the .internal/model-data.json when the names or aliases are close or the same. I think in my case, the alias was the same qwen3-coder-next. When I modified the .internal/model-data.json to remove two deleted model entries, once saved, the list of models refreshed on its own. Initially, it listed the models with their full name and the alias, and double entries for all models. I tried the refresh list, and it listed everything as expected. My issue involved similarly named models qwen3-coder-next (lingering entry) and the newly added Qwen3-Coder-Next-MLX-6bit.
SpencerGraffunder commentedon Feb 12, 2026
I'm running into this problem too. I downloaded a new model in LM Studio and want to use it in OpenCode. When I do opencode models --refresh, it just gets the old list of models. Going to http://localhost:1234/v1/models shows the updated list so I think LM Studio is working fine. I reinstalled OpenCode and LM Studio, cleared cache files, and it's still the same.
ggppdk commentedon Apr 10, 2026
In my case
1, i deleted a model
2. then restored it from backup
and when going to its download page it was showing the model as already downloaded
... and i could still load it manually
So deleting this
USER_FOLDER/.lmstudio/.internal/model-data.json
did the trick (to make the restored-from-backup model to reappear):
Alternatively this worked too:
Changing the flag
transient: true
to
transient: false
Another option was to rename the parent folder of the model, this also made the model to reappear inside the ui and in the list via the API
Red-Cat-Fat commentedon Jun 5, 2026
Hello, the problem is still present in version 1.16.2
I had LMStudio installed on my computer with several models that I hadn't used for a long time. I decided to update the list, but in the process, I accidentally deleted them and downloaded more recent versions. As a result, they remained in the opencode memory. The command
opencode models --refreshdoesn't update the list.Could you please tell me where the model list is stored? I might try to fix this bug myself, if I can.
PS. If I request a list of models from LM Studio using
curl http://localhost:1234/v1/modelsit returns a correct list. Therefore, I suspect that the models are not being updated by opencode.wweeks commentedon Jun 12, 2026
@Red-Cat-Fat
Just found this project, and this problem... I think what they mean is https://models.dev/providers/lmstudio/
It is building its models list from models.dev (website), not your local models list.
kingeke commentedon Jun 16, 2026
@wweeks do you know how we can get it to read the local models list instead?
HyperboreanSlug commentedon Jul 6, 2026
This appears to be exactly what's going on, and the problem still persists.
GBry commentedon Jul 13, 2026
This is very crucial. How can we solve this? Add the model manually?
PigeonCoding commentedon Jul 17, 2026
My current workaround is to use this project https://github.com/agustif/opencode-lmstudio
aadityabhatia commentedon Jul 18, 2026
There is an unmerged pull request at sethjones/opencode/pull/2 that was referenced in #18011 but closed last month. Curious why it was not merged.
aadityabhatia commentedon Jul 18, 2026
Likely duplicate: #23327
github-actions commentedon Sep 17, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.