DEV Community

alilo113
alilo113

Posted on

How I Built a Lightweight, Local-First VS Code AI Assistant with Ollama

🚀 The Motivation

Cloud AI coding assistants are convenient, but subscription fees add up and sending enterprise or personal codebases to external APIs isn't ideal for privacy.

I wanted a simple, zero-cost, local-first alternative that integrates directly into VS Code and hooks straight into Ollama. So, I built Echo.


🛠️ How It Works Under the Hood

To keep the MVP fast and reliable, the architecture is entirely decoupled from heavy frontend frameworks:

  1. Extension Host (TypeScript): Listens for commands and sends direct HTTP requests to the local Ollama instance running at http://localhost:11434.
  2. Inline Completion Provider (TypeScript): Hooks directly into VS Code's native inline completion API (vscode.InlineCompletionItemProvider) to serve ghost-text suggestions as you type.
  3. Distribution: Packaged directly as a .vsix binary via GitHub Releases for complete control.

⚡ Current Challenges & What's Next

  • Hardware Variability: Users running different local models need smooth onboarding. My next step is adding automatic model detection via Ollama's API on startup.
  • Streamlined Workflow: Refining how code snippets and prompts are handled directly inside the editor workflow.

📦 Try It Out

Echo is available as an open-source MVP release on GitHub:

I'd love feedback from fellow developers building local toolchains!

Top comments (0)