Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Pi Coding Agent - Language Model ProviderNew to Visual Studio Code? Get it now.
Pi Coding Agent - Language Model Provider

Pi Coding Agent - Language Model Provider

Preview

tintinweb

|
18 installs
| (0) | Free
Use Pi Coding Agent directly from Copilot Chat via VS Code's Language Model Provider API
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pi Banner

Pi Coding Agent - Language Model Provider for VS Code

Visual Studio Marketplace Version

VS Code Language Model Chat Provider integration for Mario Zechner's open source Pi coding agent, making Pi models available in VS Code's model picker for use with GitHub Copilot Chat and any extension that consumes the vscode.lm.* APIs.

Pi Banner

https://github.com/user-attachments/assets/196cffa2-660e-4b7e-911b-389830420579

Features

  • Universal Model Access: Use Pi with any VS Code extension that supports language models
  • Dynamic Model Discovery: Automatically detects all configured models from Pi
  • Tool Execution: Pi handles tools internally (file operations, bash commands, etc.)
  • Streaming Responses: Real-time streaming of LLM responses
  • Tool Transparency: Optional display of tool execution as text annotations

Prerequisites

  1. Pi CLI must be installed and available in your PATH:

    npm install -g @mariozechner/pi-coding-agent
    
  2. API Keys configured via Pi:

    pi> /login
    

Installation

  1. Install the extension from the VS Code Marketplace (or build from source)
  2. Verify Pi is installed: pi --version
  3. Open VS Code and Pi models will appear in the model picker

Configuration

Access settings via Ctrl/Cmd+, and search for "Pi":

Setting Description Default
pi.binaryPath Path to Pi CLI binary pi
pi.workingDirectory Working directory for Pi agent Workspace root
pi.autoRestart Auto-restart on crash true
pi.maxRestartAttempts Max restart attempts 3
pi.additionalArgs Additional CLI arguments []
pi.debug Enable debug logging false

Usage

With GitHub Copilot Chat

  1. Open Copilot Chat (Ctrl/Cmd+Shift+I)
  2. Click the model picker
  3. Select a Pi model (e.g., pi:anthropic:claude-sonnet-4-20250514)
  4. Start chatting!

With Other Extensions

Any extension using vscode.lm.* APIs can use Pi models:

const models = await vscode.lm.selectChatModels({ vendor: 'pi' });
const model = models[0];

const response = await model.sendRequest(messages, {}, token);

Architecture

  • Process Isolation: Pi runs in a separate process for stability
  • RPC Communication: Uses Pi's RPC mode over stdin/stdout
  • Fresh Sessions: Each request starts a fresh session (MVP)
  • Tool Handling: Pi executes tools internally, only final text reaches VS Code

Troubleshooting

"Pi CLI not found"

Ensure Pi is installed and in your PATH:

which pi
# or
npm install -g @mariozechner/pi-coding-agent

Check Logs

Open the Output panel (Ctrl/Cmd+Shift+U) and select "Pi Agent" from the dropdown to view logs.

Enable Debug Logging

For detailed troubleshooting, enable debug mode:

  1. Open Settings (Ctrl/Cmd+,)
  2. Search for "Pi: Debug"
  3. Check the box to enable

Or add to settings.json:

{
  "pi.debug": true
}

Development

# Clone and install
git clone <repo-url>
cd vscode-pi-model-chat-provider
npm install

# Compile
npm run compile

# Watch mode
npm run watch

# Package
npx @vscode/vsce package

License

MIT

Links

  • Pi Repository
  • VS Code Language Model API
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft