Menu

GitHub Copilot CLI Ollama Model Discovery: How to Use Local Models in Your Terminal

GitHub Copilot CLI now lets you discover and use locally running Ollama models directly from your terminal without interrupting your workflow. Starting with CLI version 1.0.94-0, typing /model inside an active session surfaces supported models from your running Ollama instance alongside your configured cloud providers and GitHub Copilot's own models. This feature, released on October 7, 2026, eliminates the friction of manually specifying model endpoints and streamlines the process of switching between local and cloud-based inference.

The discovery mechanism scans your local Ollama instance, identifies models that meet compatibility requirements—specifically tool calling and streaming support—and presents them in an interactive picker. You can review each model's provider and endpoint details before confirming. Two actions are available: "Add and use for this session," which immediately switches to the chosen local model, or "Add without switching," which registers the model for later use while keeping your current model active. Neither option requires restarting the CLI session.

The Evolution Toward Local Model Support in Copilot CLI

The October 2026 discovery feature did not arrive in isolation. It builds on a progression of local model capabilities introduced throughout the year. In April 2026, GitHub shipped BYOK (Bring Your Own Key) support, allowing developers to configure their own model providers—including Azure OpenAI, Anthropic, and any OpenAI-compatible endpoint—via environment variables. This update also made GitHub authentication optional when using a personal provider and introduced offline mode through COPILOT_OFFLINE=true for air-gapped environments.

By August 2026, the JetBrains plugin gained Ollama integration as a BYOK provider, complete with provider configuration and model selection throughout the IDE. The CLI discovery feature represents the next logical step: instead of requiring manual configuration of local endpoints, the CLI can now automatically detect what is already running on your machine.

What distinguishes the October update is its focus on reducing configuration overhead. Before discovery, pointing Copilot CLI at a local Ollama model meant setting provider environment variables and specifying endpoints manually. Now, if Ollama is running locally with models pulled and ready, the CLI sees them automatically. This matters in practical terms because local model usage often involves experimentation—switching between different quantized versions, testing new model releases like Llama 4 or Qwen 3, or comparing performance across model sizes. Discovery makes iteration faster.

How the Model Discovery Mechanism Works

When you type /model in a Copilot CLI session, the interactive selector builds its model list from multiple sources: installed provider packages, models configured in config.toml, and now, models discovered from a running local Ollama instance. The discovery process queries the Ollama API endpoint—typically http://localhost:11434—and retrieves the list of pulled models.

A model appears in the picker only if three conditions are met. First, the provider package must be installed (in this case, the Ollama integration). Second, the model must be available from that provider, meaning it has been pulled and exists locally. Third, the model profile must not mark text input or output as unsupported. Additionally, for Copilot CLI specifically, the model must support tool calling and streaming—two capabilities essential for the CLI's agentic workflows, where the model interacts with shell commands, file systems, and other tools.

Provider connection failures do not cause silent errors. If the CLI cannot reach the Ollama instance, the picker displays an explanation, helping you diagnose issues such as the Ollama service not running or a port conflict. Credential status does not affect whether a model appears in the list;even if credentials are missing or invalid, the model remains visible, and the provider reports an authentication error only at request time.

Prerequisites and Initial Configuration

Before discovery can work, several components must be in place. Ollama must be installed on your system and the service must be running. The models you intend to use must be pulled in advance—the discovery flow does not install the Ollama runtime or download models on demand. For example, to pull a popular open-weight model like Qwen 3, you would run:

ollama pull qwen3:4b

The Ollama provider package must also be installed within Copilot CLI. This can be done from within a session using /install ollama or from the shell with dcode --install ollama. Once installed, the provider persists across sessions.

Model compatibility is another critical consideration. The model must support tool calling and streaming. Most modern instruction-tuned models with at least a 4B parameter count meet these requirements, but smaller or older models may not. According to official documentation, a context window of at least 128k tokens is recommended for best results, though this is not a hard requirement for discovery itself.

For developers who want a provider preinstalled alongside the CLI, the DEEPAGENTSCODEEXTRAS environment variable can be set during initial installation. This approach works well for teams standardizing on specific providers across development environments.

Working with Discovered Models in Practice

After a model is discovered and added, using it follows the same interaction patterns as any other Copilot CLI model. Sub-agents—including explore, task, and code-review agents—automatically inherit the provider configuration, meaning switching to a local model affects all downstream agent activity within the session.

Setting a persistent default model is possible through several routes. The interactive model selector supports pressing Ctrl+S on any model to pin it as the default for all future CLI launches. Alternatively, /model --default provider:model sets the default via command, and the config.toml file under [models].default provides a file-based approach. From the shell, dcode --default-model provider:model achieves the same result. To view the current default, run dcode --default-model without arguments;to clear it, use dcode --clear-default-model.

One nuance worth understanding: choosing a local model does not automatically enable offline mode or disable GitHub telemetry. These remain separate concerns. Offline mode must be explicitly activated with COPILOT_OFFLINE=true, and even then, a remote provider can still receive prompts and code context over the network if one is configured. Developers working in sensitive environments should review both the provider and offline-mode documentation carefully.

Intelligent Routing and What Comes Next

Alongside the discovery feature, GitHub and Microsoft also announced intelligent routing with local models. While details on availability remain forthcoming, the concept involves the CLI making routing decisions based on task characteristics—potentially directing simpler queries to a fast local model while reserving cloud models for complex reasoning tasks. This would represent a meaningful shift in how terminal-based AI workflows manage cost, latency, and privacy trade-offs.

The broader trajectory is clear: GitHub Copilot is evolving from a cloud-only AI assistant into a model-agnostic agent platform. The combination of BYOK support, local model discovery, offline mode, and optional GitHub authentication means the CLI can operate across a wide spectrum of environments—from fully cloud-hosted to entirely air-gapped. For teams with specific compliance requirements, cost constraints, or latency sensitivity, this flexibility removes adoption barriers that earlier versions of the tool could not address.

---

Frequently Asked Questions

Does model discovery automatically install Ollama or download models?

No. The discovery feature only detects models that are already pulled and available from a running Ollama instance. You must install Ollama separately and pull any models you want to use before running /model.

What happens if my Ollama instance is not running when I use /model?

The model picker will display a connection failure notice with an explanation, helping you identify that the Ollama service needs attention. You can start Ollama and run /model again without restarting the CLI session.

Can I use discovered Ollama models while working offline?

Yes, but you must explicitly enable offline mode by setting COPILOT_OFFLINE=true. Using a local model alone does not automatically disable network communication or telemetry. Refer to the official offline-mode documentation for complete configuration details.

Which Ollama models are compatible with Copilot CLI discovery?

Models must support tool calling and streaming to appear in the discovery picker. Most modern instruction-tuned models meet these criteria, but some smaller or older architectures may not. If a model is missing from the list, you can still use it by specifying it directly with /model ollama:<model-name>.