How can I use the local model of ollama? #3172

Closed
opened 2026-02-16 17:38:58 -05:00 by yindo · 5 comments
Owner

Originally created by @zbxzrsa on GitHub (Nov 27, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

I want to use the local model of ollama but I don't know how to do it. The API for using the good model is too expensive.

Originally created by @zbxzrsa on GitHub (Nov 27, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question I want to use the local model of ollama but I don't know how to do it. The API for using the good model is too expensive.
yindo closed this issue 2026-02-16 17:38:58 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 27, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4428: Why is opencode not working with local llms via Ollama?
  • #1669: How to configure a local large model
  • #4385: Poor performance with local models
  • #4182: Poor Performance and High Resource Usage with Ollama Models in opencode
  • #3266: ollama usage not work in airplane mode?

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 27, 2025): This issue might be a duplicate of existing issues. Please check: - #4428: Why is opencode not working with local llms via Ollama? - #1669: How to configure a local large model - #4385: Poor performance with local models - #4182: Poor Performance and High Resource Usage with Ollama Models in opencode - #3266: ollama usage not work in airplane mode? Feel free to ignore if none of these address your specific case.
Author
Owner

@atkr commented on GitHub (Nov 28, 2025):

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

@atkr commented on GitHub (Nov 28, 2025): https://opencode.ai/docs/providers/#ollama
Author
Owner

@metal3d commented on GitHub (Nov 28, 2025):

It doesn't work here... I added

cat ~/.local/share/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "qwen3-coder": {
          "name": "Qwen3 Coder"
        }
      }
    }
  }
}

The provider is never found

@metal3d commented on GitHub (Nov 28, 2025): It doesn't work here... I added ```bash cat ~/.local/share/opencode/opencode.json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama (local)", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "qwen3-coder": { "name": "Qwen3 Coder" } } } } } ``` The provider is never found
Author
Owner

@rekram1-node commented on GitHub (Nov 28, 2025):

@metal3d the config is in the wrong location. Put it here:

~/.config/opencode/opencode.json

@rekram1-node commented on GitHub (Nov 28, 2025): @metal3d the config is in the wrong location. Put it here: ~/.config/opencode/opencode.json
Author
Owner

@metal3d commented on GitHub (Nov 28, 2025):

The documentation is a bit unclear 🙂. Thanks.

@metal3d commented on GitHub (Nov 28, 2025): The documentation is a bit unclear 🙂. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3172