Repository navigation
Description
I am using opencode on my macbook.
I have installed this with brew.
I have created a config file like this: touch ~/.opencode.json
Then set up this config with nvim ~/.opencode.json, and after that I export my api keys.
Now when I open opencode, should this work. Correct?
This is my config file structure:
{
"$schema": "https://opencode.ai/config.json",
"theme": "opencode",
"autoshare": false,
"autoupdate": true,
"model": "ollama/starcoder",
"provider": {
"lm-studio": {
"npm": "@ai-sdk/openai-compatible",
"name": "LM Studio",
"options": {
"baseURL": "http://localhost:1234/v1"
},
"models": {
"qwen3-1.7b": {
"name": "Qwen3 1.7B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 8192,
"output": 2048
}
}
}
},
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"starcoder": {
"name": "StarCoder 1B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 32768,
"output": 4096
}
}
}
},
"gemini": {
"name": "Google Gemini",
"env": ["GEMINI_API_KEY"],
"models": {
"gemini-2.0-flash": {
"name": "Gemini 2.0 Flash",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 1000000,
"output": 8192
}
}
}
},
"openrouter": {
"name": "OpenRouter",
"env": ["OPENROUTER_API_KEY"],
"models": {
"anthropic/claude-3.5-sonnet": {
"name": "Claude 3.5 Sonnet (via OpenRouter)",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 200000,
"output": 8192
}
}
}
},
"nvidia": {
"npm": "@ai-sdk/openai-compatible",
"name": "NVIDIA NIM",
"options": {
"baseURL": "https://integrate.api.nvidia.com/v1"
},
"env": ["NVIDIA_API_KEY"],
"models": {
"nvidia/usdcode-llama-3.1-70b-instruct": {
"name": "USD Code Llama 3.1 70B",
"attachment": true,
"reasoning": false,
"temperature": true,
"limit": {
"context": 128000,
"output": 4096
}
}
}
}
}
}
I am really confused.
Activity
thdxr commentedon Jun 27, 2025
~/.opencode.jsonisn't a thing https://opencode.ai/docs/config/marcusjihansson commentedon Jun 27, 2025
Aha I areeee. So it is supposed to be put under ~/.config/opencode/config.json for it to config.
I think I get it now.
Thank you. I appreciate it
Schniz commentedon Jun 27, 2025
@thdxr should opencode figure that this file exists and suggest moving it to config? Many people don't know XDG because most tools don't comply with it. And that can be helpful to migrate it to the real location :)
Keyruu commentedon Jun 27, 2025
@Schniz just giving my two cents in here: I would say people should just read the documentation.
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!