{"slug": "local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama", "title": "Local AI Code Completion in VS Code with Qwen2.5-Coder and Ollama", "summary": "A tutorial by Rachel Goldstein explains how to set up a fully local AI coding environment in VS Code using Qwen2.5-Coder models (1.5B and 7B) run through Ollama and the Continue extension, enabling private, offline tab autocomplete and chat. The setup requires at least 8 GB of RAM, about 6 GB of disk space, and was verified against Ollama 0.32.5 and Continue extension 2.1.0. The guide includes steps to install Ollama, pull the models, configure Continue, and verify the setup, emphasizing that no code leaves the machine.", "body_md": "# Local AI Code Completion in VS Code with Qwen2.5-Coder and Ollama\n\nWire Qwen2.5-Coder through Ollama and Continue for private, offline autocomplete and chat in VS Code.\n\n[Rachel Goldstein](https://sourcefeed.dev/u/rachel_goldstein)\n\n## What you'll build\n\nA fully local AI coding setup in VS Code: [Qwen2.5-Coder](https://github.com/QwenLM/Qwen2.5-Coder) running under [Ollama](https://ollama.com), wired into the [Continue](https://continue.dev) extension for tab autocomplete and inline chat. Nothing leaves your machine — it works on a plane, and proprietary code never touches a third-party API.\n\n## Prerequisites\n\n- macOS, Linux, or Windows with at least 8 GB of RAM (16 GB is comfortable if you want the 7B chat model alongside your editor)\n- About 6 GB of free disk for the two models\n- A current\n[VS Code](https://code.visualstudio.com)install with the`code`\n\nCLI on your PATH - Verified against Ollama 0.32.5, Continue extension 2.1.0, and the\n`qwen2.5-coder`\n\ntags on the Ollama library, August 2026\n\n## 1. Install Ollama\n\nOllama is the local model server everything else talks to. On macOS or Windows, download the installer from [ollama.com/download](https://ollama.com/download) and run it — the app starts a server on `localhost:11434`\n\nand keeps it running in the background. On Linux:\n\n```\ncurl -fsSL https://ollama.com/install.sh | sh\n```\n\nThe script installs Ollama and registers a systemd service, so the server is already running. Confirm:\n\n```\ncurl http://localhost:11434\n```\n\nYou should get back `Ollama is running`\n\n.\n\n## 2. Pull the Qwen2.5-Coder models\n\nYou want two models for two jobs: a small one for autocomplete, where latency matters more than brains, and a bigger one for chat and edits.\n\n```\nollama pull qwen2.5-coder:1.5b\nollama pull qwen2.5-coder:7b\n```\n\nThe 1.5B is a 986 MB download; the 7B is 4.7 GB. Always pin the size tag — a bare `qwen2.5-coder`\n\nresolves to `:latest`\n\n, which is the 7B, and that's too slow for autocomplete on most laptops.\n\n## 3. Install the Continue extension\n\nInstall Continue from the VS Code Marketplace (search \"Continue\", publisher *Continue*), or from the terminal:\n\n```\ncode --install-extension Continue.continue\n```\n\nOn first launch Continue creates its config file and adds a chat icon to the sidebar — you can skip any sign-in it offers, since local models need no account.\n\n## 4. Point Continue at your local models\n\nContinue reads `~/.continue/config.yaml`\n\n(`%USERPROFILE%\\.continue\\config.yaml`\n\non Windows). Open it directly in your editor, or from Continue's chat sidebar (`Cmd/Ctrl+L`\n\n): click the agent selector above the input and hit the gear icon next to your local config. Replace the `models`\n\nsection so the file looks like this:\n\n```\nname: Local Assistant\nversion: 1.0.0\nschema: v1\n\nmodels:\n  - name: Qwen2.5-Coder 7B\n    provider: ollama\n    model: qwen2.5-coder:7b\n    roles:\n      - chat\n      - edit\n      - apply\n  - name: Qwen2.5-Coder 1.5B\n    provider: ollama\n    model: qwen2.5-coder:1.5b\n    roles:\n      - autocomplete\n```\n\nSave the file — Continue reloads automatically, no restart needed. It assumes Ollama's default address; you'd only add an `apiBase`\n\nif Ollama runs on another machine or port. Finally, make sure VS Code's `editor.inlineSuggest.enabled`\n\nsetting is on (it is by default), and disable GitHub Copilot if you have it installed, so two extensions aren't fighting over the same ghost text.\n\n## Verify it works\n\nFirst check both models are in place:\n\n```\nollama list\nNAME                  ID              SIZE      MODIFIED\nqwen2.5-coder:7b      2b0496514337    4.7 GB    2 minutes ago\nqwen2.5-coder:1.5b    d7372fb82b10    986 MB    4 minutes ago\n```\n\n(Your `ID`\n\nvalues will differ.) Then in VS Code, create `test.py`\n\nand type `def fibonacci(`\n\n— pause, and gray ghost text should appear with a suggested completion. Press `Tab`\n\nto accept it. The very first completion takes a few seconds while Ollama loads the model into memory; after that it's near-instant. Running `ollama ps`\n\nin a terminal should now show `qwen2.5-coder:1.5b`\n\nloaded.\n\nFor chat, press `Cmd/Ctrl+L`\n\n, pick *Qwen2.5-Coder 7B* in the model dropdown, and ask it to explain the file. Final proof: turn off Wi-Fi and do it all again — everything still works.\n\n## Troubleshooting\n\n** Error: listen tcp 127.0.0.1:11434: bind: address already in use** — you ran\n\n`ollama serve`\n\nwhile the server was already running (the desktop app and the Linux systemd service start it for you). Don't run `serve`\n\nmanually; just use `ollama pull`\n\nand friends.**A Continue error ending in not found, try pulling it first** — your config names a tag that isn't downloaded. Continue never pulls models itself. Run\n\n`ollama list`\n\nand make the `model:`\n\nvalues match the listed tags exactly, size suffix included.**Ghost text never appears** — autocomplete may be paused: click the *Continue* item in VS Code's status bar and re-enable it. Then confirm `editor.inlineSuggest.enabled`\n\nis `true`\n\nand that Copilot's inline suggestions are off.\n\n**Completions show up but take seconds** — the autocomplete role is on a model that's too big, or you're low on RAM. Keep autocomplete on the 1.5B; on older hardware drop to `qwen2.5-coder:0.5b`\n\n, and use `ollama ps`\n\nto see what's actually loaded.\n\n## Next steps\n\nIf you've got the hardware (24 GB+ RAM or a decent GPU), swap the chat role to `qwen2.5-coder:14b`\n\nor `:32b`\n\n— same config shape, better answers. Add codebase-aware chat by pulling `nomic-embed-text`\n\nand giving it the `embed`\n\nrole, which powers Continue's `@Codebase`\n\ncontext. And when completions feel too eager or too sluggish, tune `debounceDelay`\n\nand `maxPromptTokens`\n\n— the [autocomplete deep dive](https://docs.continue.dev/customize/deep-dives/autocomplete) covers both.\n\n## Sources & further reading\n\n-\n[Continue Autocomplete Setup and Configuration Guide](https://docs.continue.dev/customize/deep-dives/autocomplete)— docs.continue.dev -\n[How to Configure Continue](https://docs.continue.dev/customize/deep-dives/configuration)— docs.continue.dev -\n[config.yaml Reference](https://docs.continue.dev/reference)— docs.continue.dev -\n[qwen2.5-coder model library page](https://ollama.com/library/qwen2.5-coder)— ollama.com -\n[Download Ollama](https://ollama.com/download)— ollama.com -\n[Ollama Releases](https://github.com/ollama/ollama/releases)— github.com\n\n[Rachel Goldstein](https://sourcefeed.dev/u/rachel_goldstein)· Dev Tools Editor\n\nRachel has been embedded in the developer tooling ecosystem for nearly eight years, covering everything from IDE wars and package-manager drama to the quiet rise of AI-assisted coding. She has a soft spot for open-source maintainers and an unhealthy number of terminal emulators installed on a single laptop.\n\n## Discussion 0\n\nNo comments yet\n\nBe the first to weigh in.", "url": "https://wpnews.pro/news/local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama", "canonical_source": "https://sourcefeed.dev/a/local-ai-code-completion-in-vs-code-with-qwen25-coder-and-ollama", "published_at": "2026-08-05 17:40:00+00:00", "updated_at": "2026-08-05 17:41:54.334151+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models"], "entities": ["Rachel Goldstein", "Qwen2.5-Coder", "Ollama", "Continue", "VS Code", "GitHub Copilot"], "alternates": {"html": "https://wpnews.pro/news/local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama", "markdown": "https://wpnews.pro/news/local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama.md", "text": "https://wpnews.pro/news/local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama.txt", "jsonld": "https://wpnews.pro/news/local-ai-code-completion-in-vs-code-with-qwen2-5-coder-and-ollama.jsonld"}}