Skip to content

Lmstudio Models are not listed correctly #2456

Closed

Description

@haltingstate

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,

Activity

  1. github-actions commented on Sep 6, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Sep 6, 2025

    @rekram1-node
    Contributor

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

  3. Lord-ZuzurNC commented on Nov 21, 2025

    @Lord-ZuzurNC

    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

  4. rekram1-node commented on Nov 21, 2025

    @rekram1-node
    Contributor

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

  5. Lord-ZuzurNC commented on Nov 23, 2025

    @Lord-ZuzurNC

    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..

  6. harduino commented on Apr 20, 2026

    @harduino

    Hi All, if you put models to config JSON-file, but still don't see it listed, try to "activate" its view in "Manage Models"

    Image Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions