bug? Ollama does not work as a provider unless configured with an API key #158

Closed
opened 2026-02-16 17:25:29 -05:00 by yindo · 4 comments
Owner

Originally created by @johnsaigle on GitHub (Jun 19, 2025).

Originally assigned to: @thdxr on GitHub.

I configured my opencode.json file to add Ollama as a provider. However, it only worked if I:

  • ran opencode auth login
  • chose "Other"
  • Added an API key like "abc" (providing an empty string was forbidden)

This should probably be fixed -- I imagine a lot of people will set up Ollama to work on localhost or LAN without requiring an API key.

Originally created by @johnsaigle on GitHub (Jun 19, 2025). Originally assigned to: @thdxr on GitHub. I configured my `opencode.json` file to add Ollama as a provider. However, it only worked if I: - ran `opencode auth login` - chose "Other" - Added an API key like `"abc"` (providing an empty string was forbidden) This should probably be fixed -- I imagine a lot of people will set up Ollama to work on localhost or LAN without requiring an API key.
yindo closed this issue 2026-02-16 17:25:29 -05:00
Author
Owner

@thdxr commented on GitHub (Jun 19, 2025):

hm i didn't need to do that let me double check

@thdxr commented on GitHub (Jun 19, 2025): hm i didn't need to do that let me double check
Author
Owner

@johnsaigle commented on GitHub (Jun 19, 2025):

Thanks, it's possible actually that the JSON was mangled (trailing comma at the end of the models entry).
That might have been failing silently. I thought it was adding the API key that fixed this but I might have forgotten the exact order of how I got things set up.

@johnsaigle commented on GitHub (Jun 19, 2025): Thanks, it's possible actually that the JSON was mangled (trailing comma at the end of the `models` entry). That might have been failing silently. I thought it was adding the API key that fixed this but I might have forgotten the exact order of how I got things set up.
Author
Owner

@thdxr commented on GitHub (Jun 20, 2025):

i'll add proper config validation

@thdxr commented on GitHub (Jun 20, 2025): i'll add proper config validation
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#158