Lmstudio Models are not listed correctly #1628

Open
opened 2026-02-16 17:31:49 -05:00 by yindo · 5 comments
Owner

Originally created by @haltingstate on GitHub (Sep 6, 2025).

Originally assigned to: @thdxr on GitHub.

Bug: GPT-120B-oss and other loaded models are not displayed in /models in opencode, when using lmstudio

  1. It will use GPT-120B-oss if I set model that is not on lmstudio (like qwen)

  2. but if I set GPT-30B-oss; then it will tell lmstudio to load that model and it loads model

  3. the model I am actually using (GPT-120B) does not show up in /models); and is only used if I select a model that lmstudio has not loaded

Maybe, use API, to check

    1. which models lm studio has loaded/ready (and show in /models)
    1. to check the context size for the model (which I had to increase; maybe put warning)

Very good job on this tool


I have Lmstudio running with GPT-120-oss

I am using opencode (latest).

I did "opencode auth login" and set BS api key for lm studio

  • NOTE: for LMstudio put note "type in any code; unless configured" when doing auth
  • it wasted 2 minutes of my time, looking up that lmstudio does not need api key unless configured; so instructioners were confusing
  • bug: blank api key is rejected as invalid for lmstudio auth,

Originally created by @haltingstate on GitHub (Sep 6, 2025). Originally assigned to: @thdxr on GitHub. Bug: GPT-120B-oss and other loaded models are not displayed in /models in opencode, when using lmstudio 1. It will use GPT-120B-oss if I set model that is not on lmstudio (like qwen) 2. but if I set GPT-30B-oss; then it will tell lmstudio to load that model and it loads model 3. the model I am actually using (GPT-120B) does not show up in /models); and is only used if I select a model that lmstudio has not loaded Maybe, use API, to check - 1. which models lm studio has loaded/ready (and show in /models) - 2. to check the context size for the model (which I had to increase; maybe put warning) --- Very good job on this tool --- I have Lmstudio running with GPT-120-oss I am using opencode (latest). I did "opencode auth login" and set BS api key for lm studio - NOTE: for LMstudio put note "type in any code; unless configured" when doing auth - it wasted 2 minutes of my time, looking up that lmstudio does not need api key unless configured; so instructioners were confusing - bug: blank api key is rejected as invalid for lmstudio auth, ---
Author
Owner

@github-actions[bot] commented on GitHub (Sep 6, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2047: LM Studio Failure to refresh models - Similar issue where models aren't getting refreshed/listed correctly in opencode
  • #508: Better support for LM Studio local provider/models - Request for using /models endpoint to automatically detect loaded models, similar to your suggestion
  • #1555: LM Studio Missing as Provider, custom provider for LM Studio non-functional - Issues with LM Studio configuration and model detection
  • #738: How to use apiKey with local models endpoint? - Discusses API key handling with local models (mentions blank API key rejection)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 6, 2025): This issue might be a duplicate of existing issues. Please check: - #2047: LM Studio Failure to refresh models - Similar issue where models aren't getting refreshed/listed correctly in opencode - #508: Better support for LM Studio local provider/models - Request for using /models endpoint to automatically detect loaded models, similar to your suggestion - #1555: LM Studio Missing as Provider, custom provider for LM Studio non-functional - Issues with LM Studio configuration and model detection - #738: How to use apiKey with local models endpoint? - Discusses API key handling with local models (mentions blank API key rejection) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 6, 2025):

I think at the moment you need to specify the models in your configuration see docs:
https://opencode.ai/docs/providers/#lm-studio

@rekram1-node commented on GitHub (Sep 6, 2025): I think at the moment you need to specify the models in your configuration see docs: https://opencode.ai/docs/providers/#lm-studio
Author
Owner

@Lord-ZuzurNC commented on GitHub (Nov 20, 2025):

Hello,

I'm facing similar issue. I saw issue #4232 with the formatting but doesn't help.

Here my auth.json (in C:\users\myUser\.local\share\opencode)

{
  "lmstudio": {
    "type": "api",
    "key": "qwen2.5-coder-14b-instruct"
  }
}

For the API I saw on LM Studio that it says "API identifier" so I tried this (but whatever if I use that or "lm-studio" I don't have result)

Image

My opencode.json (in C:\users\myUser\.local\share\opencode)

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "lmstudio-community/Qwen2.5-Coder-14B-Instruct-GGUF": {
          "name": "Qwen 2.5 Coder 14B Instruct"
        }
      }
    }
  }
}

Of course LM Studio is opened, Model is loaded and server is UP. I can curl my LM Studio API

# curl http://localhost:1234/v1/models

{
  "data": [
    {
      "id": "qwen2.5-coder-14b-instruct",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "text-embedding-nomic-embed-text-v1.5",
      "object": "model",
      "owned_by": "organization_owner"
    }
  ],
  "object": "list"
}

Here when I do opencode models

lmstudio/openai/gpt-oss-20b
lmstudio/qwen/qwen3-30b-a3b-2507
lmstudio/qwen/qwen3-coder-30b
opencode/gpt-5-nano
opencode/big-pickle
opencode/grok-code

Me env is:
Windows 11 25H2 build 26200.7171
I use VS Code with "opencode" plugin (v0.0.12)
OpenCode is installed ver 1.0.81
LM Studio installed ver 0.3.32

@Lord-ZuzurNC commented on GitHub (Nov 20, 2025): Hello, I'm facing similar issue. I saw issue #4232 with the formatting but doesn't help. Here my auth.json (in C:\users\myUser\\.local\share\opencode) ``` { "lmstudio": { "type": "api", "key": "qwen2.5-coder-14b-instruct" } } ``` For the API I saw on LM Studio that it says "API identifier" so I tried this (but whatever if I use that or "lm-studio" I don't have result) <img width="307" height="177" alt="Image" src="https://github.com/user-attachments/assets/eac10230-bc28-4846-acd6-7e02d417d0be" /> My opencode.json (in C:\users\myUser\\.local\share\opencode) ``` { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "lmstudio-community/Qwen2.5-Coder-14B-Instruct-GGUF": { "name": "Qwen 2.5 Coder 14B Instruct" } } } } } ``` Of course LM Studio is opened, Model is loaded and server is UP. I can curl my LM Studio API ``` # curl http://localhost:1234/v1/models { "data": [ { "id": "qwen2.5-coder-14b-instruct", "object": "model", "owned_by": "organization_owner" }, { "id": "text-embedding-nomic-embed-text-v1.5", "object": "model", "owned_by": "organization_owner" } ], "object": "list" } ``` Here when I do `opencode models` ``` lmstudio/openai/gpt-oss-20b lmstudio/qwen/qwen3-30b-a3b-2507 lmstudio/qwen/qwen3-coder-30b opencode/gpt-5-nano opencode/big-pickle opencode/grok-code ``` Me env is: Windows 11 25H2 build 26200.7171 I use VS Code with "opencode" plugin (v0.0.12) OpenCode is installed ver 1.0.81 LM Studio installed ver 0.3.32
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

We don't automatically grab the models for lm studio but we should

@rekram1-node commented on GitHub (Nov 21, 2025): We don't automatically grab the models for lm studio but we should
Author
Owner

@Lord-ZuzurNC commented on GitHub (Nov 23, 2025):

Hello again,
I re-read all the docs and if I was able to read properly I would be able to make it work...

The thing that I missed (it was well documented but you and I missed it in my comment) is where is located my opencode.json

In my com I said I put it in C:\users\myUser\.local\share\opencode but it should be located in (at least for a Global Config) in C:\users\myUser\.config\opencode.

It all works for me now, sorry for the noises..

@Lord-ZuzurNC commented on GitHub (Nov 23, 2025): Hello again, I re-read all the [docs ](https://opencode.ai/docs/config/) and if I was able to read properly I would be able to make it work... The thing that I missed (it was well documented but you and I missed it in my comment) is where is located my opencode.json In my com I said I put it in `C:\users\myUser\.local\share\opencode` but it should be located in (at least for a Global Config) in `C:\users\myUser\.config\opencode`. It all works for me now, sorry for the noises..
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1628