LocalForge

Chat with any major AI API without leaving VS Code: local Ollama models, OpenAI, OpenRouter, Anthropic Claude, Google Gemini, or any OpenAI-compatible server (LM Studio, llama.cpp, vLLM, Groq, Together, DeepSeek…).

What's new in 1.1.0
- New name: LocalForge — new display name, sidebar title, and
LocalForge: … command titles (command IDs and settings keys are unchanged, so nothing breaks).
- Multi-provider chat — one dropdown switches between Ollama, OpenAI, OpenRouter, Anthropic, Gemini, and custom OpenAI-compatible endpoints, with per-provider model lists.
- Secure API keys — keys are stored in VS Code Secret Storage via
LocalForge: Set API Key, never written to settings files.
- Stop generation — cancel a streaming reply mid-flight from the stop button or the
LocalForge: Stop Generation command.
- Hardened webview — strict Content-Security-Policy, zero CDN/network dependencies (fully offline-safe), XSS-safe Markdown rendering, toasts instead of
alert() popups, and fixed copy/insert buttons that no longer break on quotes or backticks.
- Smarter UX — connection-status banner with actionable errors, preferred-model auto-select, token-speed stats under every reply, chat persistence per workspace, one-click transcript export, and Ollama-only actions (pull/delete) cleanly hidden for cloud providers.
Features
Sidebar chat panel — always one click away in the activity bar, themed to match your VS Code theme.
Live streaming replies with tokens/sec, total time, and prompt-token stats.

Editor actions — select code, right-click, and choose:
AI: Explain Code
AI: Find Bugs & Optimize
AI: Generate Unit Tests
AI: Write Documentation
The analysis streams into the sidebar; hover any code block to Copy or Insert it at your cursor.
Model manager —
- Ollama: lists installed models (size, parameter count, format), pulls new ones with a live progress bar, deletes with confirmation.
- Cloud providers: lists available models with a one-click Use shortcut.

Tunable per chat — provider, model, system prompt, temperature, context window, max output tokens, and base URL, all from the settings drawer.
Private by default — Ollama runs 100% locally; cloud keys stay in your OS keychain via Secret Storage.
Requirements
- VS Code
^1.96.0.
- For local models: Ollama running (
ollama pull llama3.2 to get started).
- For cloud providers: an API key (OpenAI, OpenRouter, Anthropic, or Google AI Studio).
Installation
- Marketplace: search
LocalForge in the Extensions view (Ctrl+Shift+X), or install from the Marketplace page.
- From
.vsix: code --install-extension ollama-vscode-chat-1.1.0.vsix, or Extensions → … → Install from VSIX.
Quick Start
Option A — Local, free, private (Ollama)
- Install Ollama: ollama.com/download, or
curl -fsSL https://ollama.com/install.sh | sh.
- Pull a model:
ollama pull llama3.2.
- Click the LocalForge activity-bar icon → provider Ollama → pick the model → chat.
Option B — Cloud APIs
- Run LocalForge: Set API Key from the Command Palette (
Ctrl+Shift+P) and paste your key (stored securely; repeat per provider as needed — the key is matched to the selected provider's service).
- Select the provider in the sidebar dropdown, then pick a model:
| Provider |
Example models |
| OpenAI |
gpt-4o-mini, gpt-4o |
| OpenRouter |
meta-llama/llama-3.3-70b-instruct, google/gemini-2.0-flash-001 |
| Anthropic |
claude-sonnet-4-20250514, claude-3-5-haiku-20241022 |
| Gemini |
gemini-2.0-flash, gemma-3-27b-it |
Option C — Custom OpenAI-compatible server
- Choose provider Custom OpenAI API.
- Set the base URL, e.g. LM Studio
http://localhost:1234/v1 or llama.cpp http://localhost:8080/v1 (add a key only if your server requires one).
- Pick a loaded model and chat. Works with vLLM, Groq, Together, DeepSeek, and friends.
Settings (File → Preferences → Settings, search ollama)
| Setting | Default | Description |
|---|---|---|
| ollama.provider | ollama | ollama · openai · openrouter · anthropic · gemini · openai-compatible |
| ollama.apiUrl | http://localhost:11434 | Base URL (http://localhost:1234/v1 for LM Studio-style servers) |
| ollama.apiKey | | Optional fallback key field — the `LocalForge: Set API Key` command (Secret Storage) is recommended | | `ollama.defaultModel` | | Preferred model, auto-selected whenever it appears in the list |
| ollama.systemPrompt | You are a helpful, expert AI software developer… | System instructions sent with every chat |
| ollama.temperature | 0.7 | Creativity/randomness (0–2) |
| ollama.contextLength | 4096 | Ollama num_ctx window |
| ollama.maxTokens | 2048 | Max output tokens for cloud APIs |
Commands
LocalForge: Open Chat Panel / LocalForge: Focus Chat Sidebar
LocalForge: Set API Key (secure) / LocalForge: Clear API Key
LocalForge: Stop Generation
AI: Explain Code · AI: Find Bugs & Optimize · AI: Generate Unit Tests · AI: Write Documentation (editor right-click with a selection)
Troubleshooting
| Symptom |
Fix |
| Red “Disconnected” banner (Ollama) |
Start Ollama (ollama serve) and check ollama.apiUrl |
| “API key is required” (cloud) |
Run LocalForge: Set API Key, then re-select the provider |
| Empty model list |
Hit Refresh; for custom servers ensure the base URL ends with /v1 |
| Reply stops / errors mid-stream |
Check the error text in the bubble; use the stop button and retry — large contexts may exceed the model limit (raise contextLength/maxTokens) |
Privacy
- Ollama chats never leave your machine.
- Cloud chats go directly from VS Code to the selected provider — this extension runs no proxy and collects no telemetry.
- API keys live in VS Code Secret Storage (OS keychain), not in settings or workspace files.
Changelog
See CHANGELOG.md. Highlights: 1.1.0 LocalForge rename + docs refresh · 1.0.1 rename release · 1.0.0 multi-provider rewrite + security hardening.
Publishing a new version (maintainers)
npm run compile && npm run lint && npm test
npx vsce package # produces ollama-vscode-chat-<version>.vsix
npx vsce publish # needs a Marketplace PAT with Manage scope
Get a token at aka.ms/vscodepat (organization Vaibhavrathod), then npx vsce login Vaibhavrathod && npx vsce publish.
License
MIT — see LICENSE.
| |