Local LLM Support on MAC with LM Studio - Without an API Provider Setup #1028

Open
opened 2026-02-16 17:29:08 -05:00 by yindo · 8 comments
Owner

Originally created by @EvolvingSoftware on GitHub (Jul 31, 2025).

Originally assigned to: @thdxr on GitHub.

If you don't setup an API Provider, the global config for local providers doesn't seem to be called.

I loaded this file into ~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "model": "lmstudio/google/gemma-3n-e4b",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "google/gemma-3n-e4b": {
          "name": "Gemma 3n-e4b (local)"
        }
      }
    }
  }
}

But when I try to run opencode from my project directory I just get the add credential providers screen.

When I copy the same opencode.json file to my project directory and run opencode it launches correctly and connects to LM Studio.

Originally created by @EvolvingSoftware on GitHub (Jul 31, 2025). Originally assigned to: @thdxr on GitHub. If you don't setup an API Provider, the global config for local providers doesn't seem to be called. I loaded this file into ~/.config/opencode/opencode.json ``` { "$schema": "https://opencode.ai/config.json", "model": "lmstudio/google/gemma-3n-e4b", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (local)", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "google/gemma-3n-e4b": { "name": "Gemma 3n-e4b (local)" } } } } } ``` But when I try to run opencode from my project directory I just get the add credential providers screen. When I copy the same opencode.json file to my project directory and run opencode it launches correctly and connects to LM Studio.
Author
Owner

@thdxr commented on GitHub (Aug 1, 2025):

are you on latest?

@thdxr commented on GitHub (Aug 1, 2025): are you on latest?
Author
Owner

@EvolvingSoftware commented on GitHub (Aug 1, 2025):

Yes, just brew upgrade 'ed and retested.

@EvolvingSoftware commented on GitHub (Aug 1, 2025): Yes, just brew upgrade 'ed and retested.
Author
Owner

@Divkix commented on GitHub (Aug 1, 2025):

I can confirm this issue, using the latest version and not able to use lm-studio as provider.

@Divkix commented on GitHub (Aug 1, 2025): I can confirm this issue, using the latest version and not able to use lm-studio as provider.
Author
Owner

@unluckyjori commented on GitHub (Aug 2, 2025):

I got it working on my mac with lm studio

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": {
        "baseURL": "http://localhost:1234/v1"
      },
      "models": {
        "qwen/qwen3-4b": {
          "name": "qwen/qwen3-4b"
        },
        "qwen3-8b": {
          "name": "qwen3-8b"
        }
      }
    }
  }
}
@unluckyjori commented on GitHub (Aug 2, 2025): I got it working on my mac with lm studio ``` { "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (local)", "options": { "baseURL": "http://localhost:1234/v1" }, "models": { "qwen/qwen3-4b": { "name": "qwen/qwen3-4b" }, "qwen3-8b": { "name": "qwen3-8b" } } } } } ```
Author
Owner

@EvolvingSoftware commented on GitHub (Aug 2, 2025):

I got it working on my mac with lm studio

Did it work if you don't have that opencode.json file in your project directory, as in the opencode.json only loaded into ~/.config/opencode/opencode.json & with no API provider configured?

I got it working by copying this file to the local project directory but based on the documentation ~/.config/opencode/opencode.json should be the global setting.

@EvolvingSoftware commented on GitHub (Aug 2, 2025): > I got it working on my mac with lm studio Did it work if you don't have that opencode.json file in your project directory, as in the opencode.json only loaded into ~/.config/opencode/opencode.json & with no API provider configured? I got it working by copying this file to the local project directory but based on the documentation ~/.config/opencode/opencode.json should be the global setting.
Author
Owner

@unluckyjori commented on GitHub (Aug 2, 2025):

I put it in .config/opencode

@unluckyjori commented on GitHub (Aug 2, 2025): I put it in .config/opencode
Author
Owner

@ubergarm commented on GitHub (Sep 8, 2025):

omg thanks, I was faffing around for 20 minutes trying to get it to connect to my local ik_llama.cpp llama-server with no idea what was happening...

turns out i had to put the opencode.json in the same directory where i was calling opencode binary. I does not work putting opencode.json into ~/.local/share/opencode/ which is where it was putting the auth.json file on my arch linux box.

Installed with yay -Sy opencode-bin.

@ubergarm commented on GitHub (Sep 8, 2025): omg thanks, I was faffing around for 20 minutes trying to get it to connect to my local ik_llama.cpp llama-server with no idea what was happening... turns out i had to put the `opencode.json` in the *same directory* where i was calling `opencode` binary. I does *not* work putting `opencode.json` into `~/.local/share/opencode/` which is where it was putting the auth.json file on my arch linux box. Installed with `yay -Sy opencode-bin`.
Author
Owner

@rubnogueira commented on GitHub (Oct 1, 2025):

I was having the same issue, and the problem is that I was putting the configs on auth.json based on this link:

https://opencode.ai/docs/providers/#credentials

It's clear now that auth.json is for API keys, so I think it's a good idea to add an extra section mentioning the opencode.json file.

@rubnogueira commented on GitHub (Oct 1, 2025): I was having the same issue, and the problem is that I was putting the configs on auth.json based on this link: https://opencode.ai/docs/providers/#credentials It's clear now that auth.json is for API keys, so I think it's a good idea to add an extra section mentioning the opencode.json file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1028