Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Local AI Code ChatNew to Visual Studio Code? Get it now.
Local AI Code Chat

Local AI Code Chat

be next GmbH

|
2 installs
| (0) | Free
Chat with your own AI server (OpenAI-compatible URL) and let it read and correct the code in the open project folder.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Local AI Code Chat

A VS Code extension that opens a chat with your own AI server and lets the AI read and correct the source files of the opened project folder. It works like the well-known coding assistants, but talks only to the URL you set, for example http://my-ai.local:8000.

Chat panel: the AI reads the project, writes a file and runs it

Requirements

  • VS Code 1.90 or newer
  • An AI server with an OpenAI-compatible chat API (POST /v1/chat/completions): vLLM, llama.cpp server, Ollama (http://host:11434), LM Studio, LocalAI, ...

Install

In VS Code open the Extensions view (Ctrl+Shift+X), search for Local AI Code Chat and click Install.

Alternatively install a downloaded package file: Extensions > ... > Install from VSIX...

Set up

  1. Run the command AI Code Chat: Set Server URL (Ctrl+Shift+P) and enter the address of your server, e.g. http://my-ai.local:8000.
  2. Optional: AI Code Chat: Select Model (otherwise the first model of the server is used). If the server needs an API key, enter it in the setting aiCodeChat.apiKey or, to keep it in the VS Code secret storage, with AI Code Chat: Set API Key. It is sent as Authorization: Bearer ....
  3. Open a project folder and click the chat icon in the activity bar (or Ctrl+Alt+I).

Project on a remote machine (Remote SSH, WSL, containers)

The extension prefers to run on your PC (the machine with the VS Code window). The requests to the AI server therefore start from your PC, so an address in your local network such as http://192.168.1.50:8000 works even if the project is on a server elsewhere. The project files are reached through VS Code.

For this the extension must be installed locally: install it in a local VS Code window (one without a remote connection), and remove a copy installed on the remote machine. Shell commands for a remote project run in a VS Code terminal named "AI Code Chat" (needs the terminal's shell integration, VS Code 1.93+).

If instead the AI server is only reachable from the remote machine, force the extension to run there with this user setting:

"remote.extensionKind": { "benext.ai-code-chat": ["workspace"] }

Use

Type what you want: "why does the login test fail?", "fix the bug in parse_date", "add input validation to the upload handler". The AI then

  • lists, reads and searches the project files on its own,
  • proposes changes; each change opens as a diff and waits for Apply, Apply all in this chat or Reject,
  • can run shell commands (tests, build) after you allow each one,
  • can read the errors and warnings VS Code shows (Problems panel).

The model's reasoning (thinking) is shown while it is generated and folded once the answer is complete; click Reasoning to open it again.

Adding context

  • + next to the input field: choose files or pictures to send along.
  • Paste a picture (screenshot) or a long text into the input field; it becomes an attachment.
  • Drop files onto the chat panel (hold Shift when dragging from the VS Code Explorer).
  • Right-click a file in the Explorer or an editor tab: Add File to Chat.

Text files are sent as text, pictures (PNG, JPEG, GIF, WebP, up to 5 MB) as images. Pictures need a model that can see images; other models answer with an error from the server.

Context size

Above the input field the panel shows how many tokens of the model's context window are in use, for example 13k / 32k tokens (41%). The number comes from the server after each answer and is estimated (marked ~) in between. At 80% the extension first drops old tool output; if that is not enough, it lets the AI summarise the conversation and continues with the summary (compacting). Compact does this at any time, New Chat starts empty.

The file you are looking at and your selection are sent along as context; click the chip above the input field to leave them out. In the editor's context menu there are Ask About Selection and Fix Problems in This File.

Changes go through the editor when the file is open, so Ctrl+Z works. The AI can only touch files inside the opened folder.

Settings (aiCodeChat.*)

Setting Default Meaning
baseUrl http://my-ai.local:8000 Address of the AI server
apiPath /v1/chat/completions Chat endpoint, appended to the URL
model empty Model name; empty = first model the server lists
apiKey empty API key (plain text setting); alternatively the command Set API Key keeps it in the secret storage
editApproval ask ask = diff and confirmation, auto = apply directly
allowCommands ask never, ask or auto for shell commands
toolMode auto native = function calling of the server, text = tool calls as text blocks (for servers without function calling), auto = try native, fall back to text
temperature 0.2
maxTokens 0 Limit per answer, 0 = server default
maxSteps 30 Maximum tool rounds per request
contextTokens 0 Context window of the model in tokens; 0 = the size the server reports, else 32768
stream true Show the answer while it is generated
systemPrompt empty Extra instructions (conventions, language)

Notes on models

Editing files needs a model that follows tool instructions reliably. Coding models of roughly 14B parameters and up usually work; small models often fail to produce exact edits. If the server supports function calling (vLLM with --enable-auto-tool-choice, llama.cpp with --jinja, Ollama with a tool-capable model) the native mode is the most reliable.

Development

No build step, no runtime dependencies.

npm test            # node --test, uses a mock AI server
npm run package     # builds the .vsix with @vscode/vsce
  • src/llm.js - HTTP client (streaming and plain answers)
  • src/tools.js - file tools, confined to the project folder
  • src/vsfs.js - file access through the VS Code API (local and remote folders)
  • src/agent.js - chat loop and text-mode tool calls
  • src/extension.js - VS Code side: chat view, diff approval, commands
  • media/ - chat panel (webview)

Press F5 in this folder to try the extension in a second VS Code window.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft