本页还没有译文
本页 20 段还没译成简体中文,下面显示的是英文原文。VS Code
还没翻译译自英文(docs.ollama.com)本页 20 段都还没译
Use Ollama models in VS Code Chat with the Ollama extension.
Requirements
- Visual Studio Code 1.127 or newer
- Ollama installed and running
- At least one local or cloud model available in Ollama
Earlier VS Code versions do not reliably cancel requests from language model providers.
Ollama 0.17.6 or newer is recommended for cloud model sign-in and richer model metadata. Older versions may still work with local models.
Install the extension
- Install the Ollama extension from the VS Code Marketplace.
- Open Chat in VS Code.
- Open the model picker at the bottom of the chat input.
- Choose a model from the Ollama section.
The extension discovers models from http://127.0.0.1:11434 by default.
Add a model
Pull a local model:
ollama pull qwen3.6To use a cloud model, pull it and sign in:
ollama pull kimi-k2.6:cloud
ollama signinLocal models do not require sign-in.
Context length
VS Code may show a model's maximum supported context length even when Ollama allocates a smaller context at runtime.
For local models, open Ollama Settings, set the context length to at least 64k, reload the VS Code window, and resend your prompt. See Context length for more information.
Troubleshooting
If Ollama models do not appear in the model picker:
- Make sure Ollama is running.
- Run
ollama listand confirm that models are available. - Run Ollama: Refresh Models from the Command Palette.
- Run Ollama: Diagnose Models and check the Ollama output channel.
If a cloud model asks you to sign in, run ollama signin.