Published

Ollama Copilot Integration

Using a local Ollama model in GitHub Copilot Chat.

AILLMOllamaLinuxCopilot

This blog post belongs to a three-part series: Running LLMs Locally

  1. Running LLMs Locally with Ollama
  2. Ollama Copilot Integration Now Reading
  3. Using LM Studio's Chat Interface

Now that we have an Ollama model running locally, let’s see if we can use it with GitHub Copilot. Copilot was the first tool I used for AI-assisted coding, so it will be interesting to see how it performs with a local model.

Update: The exact setup shown below no longer exists. VS Code deprecated its built-in Ollama support in favor of an official Ollama extension, and Copilot’s local model support has grown. The VS Code language model docs are the current starting point. The rest of this post is a snapshot of the original setup.

I would not recommend local models for development work at this time. The models from Anthropic and other providers are significantly larger than local models, still quite fast, and tailored to their tooling (e.g., Claude Code).

My opinion could change in some indeterminate amount of time. Model providers may establish their moats and start turning the screws on pricing, the agent harnesses may become effective without enormous models, or a model architecture breakthrough may make small models as effective as today’s large models. Until then, treat this series as me finding out what my own hardware can do, not a recommendation for daily work.

Configuring Copilot to Use Phi-4

I tested with Phi-4, a 14 billion parameter model that is about a 9 GB download. It fits on my GPU with room to spare for context, and pulling it is one command.

ollama pull phi4

VS Code can register Ollama models for Copilot Chat through its “bring your own key” flow, and I followed GitHub’s docs to set it up.

Note that the page behind that link has since changed and no longer covers local models at all, which is part of why the update note above exists.

VS Code's Manage Ollama Models dialog with phi4 selected

Have Phi-4 Analyze Code

Even the small local model can analyze a simple Python file and provide some insights. It won’t match the large hosted models, but it’s private and free to use, ignoring electricity. Speed felt fine for a chat workflow too, though I didn’t measure tokens per second here.

Phi-4 explaining a Python linear optimization script in Copilot Chat

In the next post, we’ll keep using Phi-4 and get a proper local chat interface running with LM Studio.