Skip to content

[Feature Request] Multiple LM Studio Providers #42

Open

Description

@m21-cerutti

Hello,
I wanted to have multiple LM Studio providers, and I would think it could be possible if we could use for provider "lmstudio.*" instead of just the default one, and for each add the models discovered.
Like that we can have the use case :

{
  "$schema": "https://opencode.ai/config.json",
 "provider": {
    "lmstudio-local": {
      "name": "LM Studio (local)",
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1",
        "includeUsage": true,
        "apiKey": "{env:API_LOCAL_LMSTUDIO}",
      },
    },
    "lmstudio-katana": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (Remote)",
      "options": {
        "baseURL": "http://<remote>/v1",
        "includeUsage": true,
        "apiKey": "{env:API_LOCAL_LMSTUDIO_REMOTE}",
      },
    },
  },
  "disabled_providers": [],
}

EDIT: Just found the corresponding code

config.provider.lmstudio = mergeProvider(

Activity

  1. dgnsrekt commented on Aug 15, 2026

    @dgnsrekt

    Cross-linking #50, which is the same topology seen from the other side.

    My LM Studio already federates two hosts behind one endpoint, and it reports the same key once per host. Because the plugin builds its model map with Object.fromEntries, the duplicate records collapse and one host's loaded_instances are discarded — so limit.context can be taken from a host that is not the one serving the request.

    So multi-host setups are reaching the plugin today, just without a way to represent them. If this issue is resolved by giving routed instances distinct provider or model identities, that would subsume #50; if it is resolved another way, #50 still needs the per-key merge on its own.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions