DEV Community

Cover image for Ollama for VS Code: Run Local AI Models Inside Visual Studio Code
polina
polina

Posted on

Ollama for VS Code: Run Local AI Models Inside Visual Studio Code

Learn how to use the official Ollama VS Code extension with local and cloud AI models, including installation, model selection, troubleshooting, and practical developer use cases.
AI coding tools have become a normal part of modern software development, but not every developer wants to send their code and prompts to a cloud AI service.

That's where Ollama becomes interesting.

Ollama lets developers run AI models locally and also provides access to supported cloud models. Its official VS Code extension brings those models directly into the Visual Studio Code Chat model picker.
You can find the extension here:

Ollama for VS Code

In this guide, we'll look at what the extension does, how to install it, how it connects to Ollama, how to use local and cloud models, and what to do if your model doesn't appear in VS Code.

What Is the Ollama VS Code Extension?
The official Ollama VS Code extension works as a language-model provider for Visual Studio Code.

Instead of opening a separate AI application, copying code, and moving responses back into your editor, you can select an Ollama model directly from VS Code Chat.

The basic architecture looks like this:

VS Code Chat

Ollama VS Code Extension

Ollama Server

Selected AI Model

The extension discovers models from your running Ollama server and makes them available through the VS Code model picker.

By default, the extension looks for Ollama at:

http://127.0.0.1:11434

This is important because the extension itself isn't the AI model. It connects VS Code to the models managed by Ollama.

Why Use Ollama With VS Code?
There are several reasons developers may want to use Ollama inside VS Code.

The first is model flexibility.

Instead of being tied to a single AI model or provider, you can work with models available through Ollama and choose the model that fits your particular task.

The second is local AI.

When you run a model locally, inference can happen on your own machine. This can be useful when you're working with private source code or simply want more control over where your prompts and code are processed.

The third is experimentation.

Developers can install different models and compare their performance for coding, reasoning, debugging, documentation, and other tasks.

Ollama also supports cloud models, which gives you another option when a local machine doesn't have enough resources for a particular model.

Ollama VS Code Extension Requirements
Before installing the extension, make sure your environment meets the current requirements.

The extension listing currently specifies:

Visual Studio Code 1.127 or newer
Ollama installed and running
At least one Ollama model available
For cloud-model sign-in and richer model metadata, the extension recommends Ollama 0.17.6 or newer.

You can get Ollama from the official website:

Ollama

You can also view the current VS Code extension:

Ollama VS Code Extension

How to Install Ollama for VS Code
The setup is simple.

Step 1: Install Ollama
First, install Ollama on your operating system and start the Ollama service.

After installation, verify that Ollama is working from your terminal.

You can check installed models with:

ollama list

Step 2: Install an AI Model
If you don't have a model installed yet, pull one using the Ollama command line.

For example:

ollama pull qwen3.6

The model you choose should depend on your available RAM, GPU, CPU, context requirements, and the type of development work you want to perform.

Step 3: Install the VS Code Extension
Open Visual Studio Code and install the official Ollama extension.

You can access its listing here:

https://vscodeextensions.com/extensions/ollama-ollama

Step 4: Open VS Code Chat
Open Chat in VS Code.

At the bottom of the chat input, open the model picker.

You should see an Ollama section if the extension can communicate with your Ollama installation.

Select the model you want to use.

That's it.

Your selected Ollama model can now be used through the VS Code Chat experience.

How Does the Ollama Extension Find Models?
The extension communicates with your Ollama server.

The default server address is:

http://127.0.0.1:11434

This means you don't manually configure every model inside VS Code.

Instead, Ollama manages the models and the VS Code extension discovers the available models.

For example, the workflow can look like this:

Install Ollama

Pull a model

Start Ollama

Open VS Code

Open Chat

Select Ollama model

Start working

This separation is useful because model management remains with Ollama while VS Code provides the development interface.

Local Models vs Cloud Models
One of the most useful things to understand about the current Ollama ecosystem is the difference between local and cloud models.

Local Ollama Models
A local model runs on your own computer.

This can make sense when:

You work with private source code
You want local inference
You want more control over your AI environment
You want to experiment with different open models
Your computer has enough resources to run the model
Local models don't require Ollama cloud sign-in.

However, running a large model locally can require significant RAM or GPU resources.

Ollama Cloud Models
Cloud models run through Ollama's cloud infrastructure rather than requiring your computer to run the entire model.

This can be useful when:

Your machine has limited hardware
You need access to larger models
You want to experiment with models that are impractical to run locally
Cloud models require Ollama sign-in.

For example, the current extension documentation provides cloud-model usage such as:

ollama pull kimi-k2.6:cloud

The exact models available can change over time, so check the current Ollama model library before choosing one for a project.

What Can You Do With Ollama in VS Code?
Ollama becomes more useful when you treat it as part of your development workflow rather than simply another chatbot.

For example, you can use an AI model to:

Explain unfamiliar code
Review functions
Suggest refactoring ideas
Help understand error messages
Generate boilerplate code
Explain APIs
Discuss architecture decisions
Create documentation drafts
Explore implementation approaches
Help reason through programming problems
The quality of the result depends on the model, the context you provide, your hardware, and the complexity of the task.

A local model isn't automatically better just because it is local.

Likewise, a larger model isn't automatically the best choice for every programming task.

Why Model Choice Matters
Different development tasks can benefit from different models.

For example, you may want:

A smaller model for quick questions
A stronger coding model for implementation tasks
A reasoning-focused model for complex problems
A larger cloud model when local hardware isn't sufficient
This makes Ollama particularly interesting for developers who like experimenting with AI models.

Instead of treating one model as the answer to everything, you can select the model according to the job.

Ollama Commands Useful for VS Code
If you're using Ollama with VS Code, a few commands are especially useful.

Check Installed Models
ollama list

This shows the models currently available through your Ollama installation.

Pull a Model
ollama pull MODEL_NAME

Replace MODEL_NAME with the model you want to download.

Refresh Models in VS Code
If you install a model but don't see it in the VS Code model picker, run:

Ollama: Refresh Models

This forces the extension to reload the available model list.

Diagnose Model Discovery
If refreshing doesn't solve the problem, run:

Ollama: Diagnose Models

The diagnostic information can help identify problems with model discovery.

Ollama Model Not Showing in VS Code?
This is one of the most common issues you may encounter.

If your model doesn't appear in the VS Code model picker, don't immediately reinstall VS Code or Ollama.

Try these steps:

Make sure Ollama is running.
Run ollama list.
Confirm that the model is actually installed.
Open the VS Code Command Palette.
Run Ollama: Refresh Models.
If the model is still missing, run Ollama: Diagnose Models.
Check the Ollama output channel for diagnostic information.
If you're using a cloud model, make sure you've signed in to Ollama.
These steps cover the model-discovery workflow provided by the current extension documentation.

Is Ollama Better Than GitHub Copilot?
There isn't a universal answer.

Ollama and GitHub Copilot can both help with software development, but their approaches are different.

GitHub Copilot is a full AI developer product deeply integrated into the GitHub and Microsoft ecosystem.

Ollama is particularly interesting if you want control over the models you're using and want the option to run models locally.

A simple comparison looks like this:

Requirement Ollama
Local AI models Yes
Model experimentation Yes
Local inference Yes
Cloud models Supported
VS Code integration Yes
Requires local hardware for local models Yes
Single fixed AI provider No

So the question isn't really "Which one is better?"

A better question is:

Which workflow fits your development environment?

If you want convenience and a managed AI coding product, another tool may be more suitable.

If you want model flexibility and local AI, Ollama becomes much more interesting.

Privacy Considerations
Local AI can be attractive when privacy is important.

When a model is running locally, your prompts and code can be processed by the model on your own machine instead of being sent to a remote inference service.

That doesn't mean every part of an AI workflow is automatically private.

You should still understand:

Which model you're using
Whether it is local or cloud-based
What information you send to cloud services
Your organization's security requirements
Any logging or telemetry associated with the tools you use
For sensitive enterprise code, always verify the current privacy and security documentation of the services involved.

Who Should Use Ollama in VS Code?
Ollama is especially interesting for developers who:

Want to experiment with local AI
Prefer having control over model selection
Work with sensitive development projects
Have suitable hardware for local models
Already use Ollama
Want to compare different AI models
Want an alternative to cloud-only AI workflows
It may not be the best fit for someone who simply wants a zero-configuration AI coding assistant.

Local AI also introduces another responsibility: you need hardware capable of running the models you choose.

Advantages of Ollama for VS Code
The biggest advantages include:

Local model support
Flexible model selection
VS Code Chat integration
Support for Ollama cloud models
More control over the AI environment
Useful model-management commands
Good fit for AI experimentation
Potential privacy benefits from local inference
Limitations to Consider
Ollama isn't perfect for every developer.

Local model performance depends heavily on your hardware.

Large models can consume significant RAM and GPU memory, while smaller models may not perform as well on difficult coding or reasoning tasks.

There can also be additional setup and troubleshooting compared with fully managed cloud AI products.

The important thing is to choose the model and workflow based on your actual requirements instead of assuming that local or cloud AI is always superior.

Official Ollama Extension vs Third-Party Extensions
There are multiple Ollama-related extensions in the VS Code ecosystem.

The important distinction is that the official Ollama.ollama extension is published by Ollama and is designed to provide Ollama models as a language-model provider inside VS Code.

There are also older third-party Ollama extensions.

For example, the older "Ollama (BYOM)" extension is now deprecated because Ollama provides its own official VS Code extension.

If your goal is simply to use Ollama models through the current VS Code model picker, the official extension is the sensible place to start.

Frequently Asked Questions
Is Ollama free?
Ollama supports running models locally without requiring cloud inference. Ollama also provides cloud-based models and paid options, so local and cloud usage should be considered separately.

Does Ollama work with VS Code?
Yes. The official Ollama VS Code extension allows Ollama models to appear in the VS Code model picker.

Does Ollama require the internet?
Local models can run on your computer without cloud inference.

Cloud models require an internet connection.

Do local Ollama models require an Ollama account?
No. Local models don't require Ollama cloud sign-in.

Cloud models require authentication.

Why isn't my Ollama model appearing in VS Code?
First verify that Ollama is running and that the model appears when you run:

ollama list

Then use Ollama: Refresh Models in VS Code.

If the problem continues, use Ollama: Diagnose Models and check the Ollama output channel.

Can Ollama replace a cloud AI coding assistant?
For some developers, local Ollama models can replace parts of a cloud AI workflow.

However, performance varies by model and hardware. Cloud models may still be preferable for larger or more demanding workloads.

Final Thoughts
The official Ollama VS Code extension is an interesting option for developers who want AI models directly inside their development environment.

Its biggest advantage isn't simply that it adds AI to VS Code.

The more important combination is:

VS Code + Ollama + flexible model selection + local inference

That combination gives developers more control over how they use AI during software development.

If you already use Ollama, the extension is a natural way to bring those models into VS Code.

Top comments (1)

Collapse
 
p_o_26e854a54d851cd606f08 profile image
P O

nice little setup. one thing i'd be careful with is leaving 11434 bound beyond loopback just to make vscode reach a remote ollama host. an ssh tunnel or an authenticated reverse proxy is safer, and i'd cap concurrent requests too so one extension doesn't eat all the vram.