Skip to content

fix(provider): auto-discover models for OpenAI-compatible providers (e.g. LM Studio) #32076

Closed

Description

Description

When configuring LM Studio (or other OpenAI-compatible local inference servers) as a custom provider in opencode.json, opencode does not auto-discover the list of loaded models from the GET /v1/models endpoint.

Currently only the 3 LM Studio models hardcoded in the models.dev catalog appear in the UI (GPT OSS 20B, Qwen3 30B A3B 2507, Qwen3 Coder 30B), while other models actually loaded in the local LM Studio instance are invisible.

The discoverModels extension point already exists but is only implemented for GitLab. Generic OpenAI-compatible custom providers lack model discovery.

Steps to reproduce

  1. Configure LM Studio provider in opencode.json with baseURL set to http://127.0.0.1:1234/v1
  2. Load multiple models in LM Studio (e.g. 5+ models)
  3. Open the opencode desktop UI and view available models
  4. Only the 3 models from models.dev are shown, not all models loaded in LM Studio

OpenCode version

1.17.4

Operating System

Windows 11

Activity

  1. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

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

    If your issue is already covered by one of the above, please add a thumbs-up reaction or comment there instead so effort can be consolidated.

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