GeezerVison is showing github.com — LM Studio Failure to refresh models · Issue #2047 · anomalyco/opencode
LM Studio Failure to refresh models #2047DescriptionI'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 logout auth login cycle, is there a quick way to fix this? Reacted by Karthikeyan N, Spaceychen, Praise Dare, Jack Slingerland, Ankit Khandelwal, Eric A Stalee and hunterMG Activityblankenshipz commented on Aug 18, 2025 Removing the model cache file in ~/.cache/opencode/models.json also did not help this issue Reacted by Sherwin Techico, Spaceychen, Vishal Doshi, Ricardo Rodriguez Garcia, Ron, Praise Dare and FKS_function rekram1-node commented on Aug 18, 2025 I think I am gonna have to install LM Studio to see what you mean (never used it) blankenshipz commented on 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. Reacted by Sherwin Techico shrwnsan commented on 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 /models too Reacted by Karthikeyan N and Praise Dare perlator commented on 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 commented on 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 Reacted by Karthikeyan N Reacted by Spaceychen rekram1-node commented on Oct 17, 2025 @perlator fixed, may require u to restart opencode but model list should refresh Reacted by Thomas Schmidt Reacted by Spaceychen and ashcdev blankenshipz commented on Oct 31, 2025 I'm still having this issue despite running the latest version of opencode
opencode --version
0.15.30
opencode models | grep lmstudio
lmstudio/openai/gpt-oss-20b
lmstudio/qwen/qwen3-30b-a3b-2507
curl localhost:1234/v1/models
{
"data": [
{
"id": "qwen/qwen3-vl-30b",
"object": "model",
"owned_by": "organization_owner"
},
{
"id": "text-embedding-nomic-embed-text-v1.5",
"object": "model",
"owned_by": "organization_owner"
},
{
"id": "openai/gpt-oss-20b",
"object": "model",
"owned_by": "organization_owner"
}
],
"object": "list"
}
rekram1-node commented on 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 Reacted by Karthikeyan N Reacted by Spaceychen KarthiDreamr commented on Nov 16, 2025 
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. marduk191 commented on Feb 5, 2026 or get this, use the api correctly? Reacted by Mahmoud Abdel-Fattah, Luc Gendrot, Praise Dare, Kohio Deflesselle and Marco Pagliari jecruz commented on 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. Reacted by Georgios Papadakis SpencerGraffunder commented on 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 commented on Apr 10, 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.
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 commented on Jun 5, 2026 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 wweeks commented on Jun 12, 2026 kingeke commented on Jun 16, 2026 @wweeks do you know how we can get it to read the local models list instead? HyperboreanSlug commented on Jul 6, 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.
This appears to be exactly what's going on, and the problem still persists. Reacted by Oleh Solomoichenko GBry commented on Jul 13, 2026 This is very crucial. How can we solve this? Add the model manually? PigeonCoding commented on Jul 17, 2026 aadityabhatia commented on Jul 18, 2026 aadityabhatia commented on Jul 18, 2026 github-actions commented on 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|