Integration guide

Developer ToolsProprietary serviceUpdated 2026

GitHub Integration

Code hosting and collaboration platform where Copilot, agents, and repository automation connect to development work.

Beginner to intermediateSetup
PartialLocal runtime
3Related paths

Recommended path

GitHub local AI quick start

  1. 1. Install Copilot CLI and prepare a local modelRun Ollama, pull a model that supports both tool calling and streaming, and verify it before starting Copilot CLI. GitHub recommends at least a 128k-token context window.
  2. 2. Set the local provider environment variablesSet COPILOT_PROVIDER_BASE_URL to http://localhost:11434 and COPILOT_MODEL to the pulled model name. Set the provider type or API key only when your endpoint needs them.
  3. 3. Test a read-only repository taskLaunch Copilot CLI in a repository and begin with an explanation or search task. Confirm tool calls and streaming work before granting any write-capable workflow broader access.

Best for

Teams bringing AI into issues, pull requests, code review, and repository tasks.

Model support

The answer differs by surface, and the distinction is the whole story. GitHub Copilot CLI supports bring-your-own-key against OpenAI-compatible endpoints, explicitly including a locally running Ollama. Copilot features that live on github.com — pull request summaries, code review, agent sessions — run on GitHub infrastructure and have no local-model path.

Choose models by role

Copilot CLI

Tool-capable streaming model

The local model must support tool calling and streaming. A long context window matters because the CLI may combine repository context, conversation, and tool results.

GitHub-hosted Copilot features

GitHub-managed model

Pull-request summaries, code review, and agent sessions on github.com do not use this local endpoint. They remain a separate hosted-model surface.

How to use this integration

  • Automate issue and pull request workflows through the GitHub API, calling a local model from your own runner
  • Use GitHub Actions to run a self-hosted model on your own hardware as part of CI
  • Keep Copilot for hosted repository workflows while a local model handles sensitive code in the editor
  • Summarise repository activity with your own tooling rather than the hosted Copilot features

Connecting a local model

Copilot CLI reads its provider from environment variables: set COPILOT_PROVIDER_BASE_URL to your local endpoint (the docs give http://localhost:11434 for Ollama) and COPILOT_MODEL to the model name, with COPILOT_PROVIDER_TYPE and COPILOT_PROVIDER_API_KEY optional. The model must support tool calling and streaming, or the CLI returns an error, and GitHub recommends a context window of at least 128k tokens.

Tradeoffs

Local models reach the CLI only. Anything running on github.com still processes your code on GitHub infrastructure, so "Copilot with a local model" is true of your terminal and false of your repository automation. The tool-calling and streaming requirements rule out a good number of small local models, and the 128k-context recommendation rules out more on modest hardware. In IDEs the picture is different again: VS Code takes local models for chat but not for inline suggestions, and administrators can disable bring-your-own-key entirely on Business and Enterprise seats.

Source

GitHub Copilot CLI BYOK docs