Skip to content

[FEATURE]: Auto-Detect and Sync Local/Remote Ollama Models #26863

Description

@nilomind-code

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Auto-detect and dynamically load Ollama models via CLI or /api/tags endpoint

Currently, OpenCode requires manual configuration of available models in opencode.json. For users who already have Ollama installed or running (locally or remotely), this creates redundant setup friction. This feature proposes automatic model discovery by querying the Ollama binary or HTTP API, dynamically populating the model picker, and supporting custom host/port configuration for non-default instances.

Motivation

  • Reduces initial setup time and manual JSON maintenance
  • Aligns with the behavior of other modern AI tooling that auto-discovers local backends
  • Lowers the barrier to entry for developers who manage multiple local/private models
  • Creates a reusable pattern for discovering other local inference servers in the future

Proposed Behavior

  1. On startup or when opening the model selection UI, check if ollama is available in the system PATH.
  2. If found, fetch available models using:
  • Primary: http://<host>:<port>/api/tags
  • Fallback: ollama list --json
  1. Parse the response and dynamically populate the model picker with model names and metadata (name, size, last modified).
  2. If the default localhost:11434 is unreachable, prompt the user to configure a custom host and port for Docker, WSL, or remote instances if The local Ollama model is choosen.

Thanks for making such a good product and considering the above improvement proposal.

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