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
- Step 1.
Install Copilot CLI (npm, all platforms).
Terminalnpm install -g @github/copilot - Step 2.
Quick setup through Ollama.
Terminalollama launch copilot - Step 3.
Run directly with a model.
Terminalollama launch copilot --model kimi-k2.5:cloud - Step 4.
Headless mode for Docker, CI/CD or scripts (
--yesauto-pulls the model and requires--model).Terminalollama launch copilot --model kimi-k2.5:cloud --yes -- -p "how does this repository work?" - Step 5.
Manual setup per Ollama's docs: set the environment variables, then run copilot.
Terminalexport 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 - 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 - Step 7.
GitHub's docs say Copilot checks for Ollama at
http://127.0.0.1:11434by 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. - 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/v1with 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.
More setup guides
Same tool, other providers
Related reading
- GitHub Copilot CLI With Ollama: Local Models and the New SandboxCopilot CLI 1.0.94 finds local Ollama models from /model and ships an OS-level sandbox. Setup, the 4k context trap, and why local is not offline.
- GitHub Copilot for JetBrains Gains Persistent Memory and Ollama BYOKGitHub Copilot for JetBrains adds memory across chat sessions, Ollama as a BYOK provider, and enterprise settings for MCP access. What each feature does.
- Flint on Ollama: Best Local Coding LLM for Claude Code?Recursive's Flint is a 40B open-weight coding model with 2.5B active parameters. How to run it on Ollama and point Claude Code at it, plus the benchmark caveats.
- Ollama Decision Models: Run Nimble Locally with --askOllama 0.40.4 runs decision models locally: ollama run nimble --ask answers yes/no, label and score questions with probabilities. Commands and limits.
- Ollama 0.40 on Mac: MLX by Default, Disk Space DoubledOllama 0.40 runs supported models on MLX on Apple Silicon and keeps a backup copy of each model you load. What it costs in disk, what is fixed, and the cleanup.
- Hermes Agent Guide (2026): What It Is, Local Setup With Ollama, Skills, and Hermes vs OpenClawHermes Agent is Nous Research's open-source, self-improving AI agent. Run it locally with Ollama, see how its skills system works, and compare it with OpenClaw.
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.
- docs.ollama.comhttps://docs.ollama.com/integrations/copilot-cli
- raw.githubusercontent.comhttps://raw.githubusercontent.com/ollama/ollama/main/docs/integrations/copilot-cli.mdx
- docs.github.comhttps://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-llm-models
- docs.ollama.comhttps://docs.ollama.com/integrations/vscode
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.