Skip to content

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

Closed

Description

@EvolvingSoftware

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.

Activity

  1. self-assigned this
    on Aug 1, 2025
  2. thdxr commented on Aug 1, 2025

    @thdxr
    Member

    are you on latest?

  3. EvolvingSoftware commented on Aug 1, 2025

    @EvolvingSoftware
    Author

    Yes, just brew upgrade 'ed and retested.

  4. Divkix commented on Aug 2, 2025

    @Divkix

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

  5. unluckyjori commented on Aug 2, 2025

    @unluckyjori

    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"
            }
          }
        }
      }
    }
    
  6. EvolvingSoftware commented on Aug 2, 2025

    @EvolvingSoftware
    Author

    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.

  7. unluckyjori commented on Aug 2, 2025

    @unluckyjori

    I put it in .config/opencode

  8. ubergarm commented on Sep 8, 2025

    @ubergarm

    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.

  9. rubnogueira commented on Oct 1, 2025

    @rubnogueira

    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.

  10. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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