Skip to main content
Watch: Anthropic Just Hit the Brakes on Its Next AI Model

Setup guide - From Ollama and GitHub Copilot docs

Use Ollama in GitHub Copilot

GitHub Copilot CLI can use local Ollama models: GitHub documents adding Ollama models it discovers on your machine from the /model picker, and Ollama documents COPILOT_PROVIDER_* environment variables and ollama launch copilot.

Last verified 8 steps4 official sources

Steps

  1. Step 1.

    Install Copilot CLI (npm, all platforms).

    Terminal
    npm install -g @github/copilot
  2. Step 2.

    Quick setup through Ollama.

    Terminal
    ollama launch copilot
  3. Step 3.

    Run directly with a model.

    Terminal
    ollama launch copilot --model kimi-k2.5:cloud
  4. Step 4.

    Headless mode for Docker, CI/CD or scripts (--yes auto-pulls the model and requires --model).

    Terminal
    ollama launch copilot --model kimi-k2.5:cloud --yes -- -p "how does this repository work?"
  5. Step 5.

    Manual setup per Ollama's docs: set the environment variables, then run copilot.

    Terminal
    export COPILOT_PROVIDER_BASE_URL=http://localhost:11434/v1
    export COPILOT_PROVIDER_API_KEY=
    export COPILOT_PROVIDER_WIRE_API=responses
    export COPILOT_MODEL=qwen3.5
    copilot
  6. Step 6.

    Per GitHub's docs: with Ollama running and at least one model downloaded, enter /model in an interactive session, look under "Local and self-hosted" for models shown as "Discovered", select one and press Enter, then choose Add and use for this session (or Add without switching). The CLI saves the model to providers.json.

    Snippet
    /model
  7. Step 7.

    GitHub's docs say Copilot checks for Ollama at http://127.0.0.1:11434 by default; if Ollama uses another local address or port, set OLLAMA_HOST before starting the CLI. For an Ollama server on another machine, use a providers.json provider configuration with its OpenAI-compatible API URL, including /v1.

  8. Step 8.

    Optional: set the COPILOT_OFFLINE environment variable to true before starting the CLI to prevent Copilot CLI from contacting GitHub's servers; for full network isolation your model provider must also be local.

Caveats

  • This covers GitHub Copilot CLI, not the Copilot editor extensions.
  • The two official pages differ: Ollama's manual setup sets COPILOT_PROVIDER_BASE_URL=http://localhost:11434/v1 with COPILOT_PROVIDER_WIRE_API=responses, while GitHub's page documents automatic Ollama discovery and a providers.json file instead of environment variables. GitHub says providers.json, when it already contains providers or models, takes precedence over environment settings.
  • GitHub says to choose a model and endpoint that support tool calling and streaming, and that for an unknown model Copilot CLI can default to a limit of 128,000 prompt tokens, which can exceed the model's actual capacity; Ollama recommends a context window of at least 64k tokens.
  • Separately, Ollama documents a VS Code extension (Ollama.ollama, VS Code 1.127 or newer) that adds Ollama models to the VS Code Chat model picker; that page does not mention Copilot by name.

FAQ

How do I use Ollama in GitHub Copilot?

GitHub Copilot CLI can use local Ollama models: GitHub documents adding Ollama models it discovers on your machine from the /model picker, and Ollama documents COPILOT_PROVIDER_* environment variables and ollama launch copilot.

Which Ollama model ids work in GitHub Copilot?

The official docs read for this guide list qwen3.5, kimi-k2.5:cloud, glm-5:cloud, glm-5.3:cloud and kimi-k3:cloud. Requests go to http://localhost:11434/v1.

Is this an official Ollama and GitHub Copilot setup?

The steps draw on both Ollama's and GitHub Copilot's docs. It was last checked against 4 official pages on November 8, 2026.

Sources

Last verified against 4 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.