Copilot Bridge elevates the VS Code experience by transforming it into a local OpenAI-compatible gateway for GitHub Copilot. This extension enables developers to leverage their already-paid-for Copilot subscription directly from their favorite CLI tools and applications.
Copilot Bridge: A VS Code Extension for Local Inference
Copilot Bridge transforms Visual Studio Code into a local gateway compatible with OpenAI, allowing users to utilize the GitHub Copilot capabilities already subscribed to. By using this extension, requests remain on the local machine, offering a seamless experience while maintaining traffic security.
Key Benefits:
- Integrate with CLI and Automation: Connect Copilot to favorite terminals, scripts, and desktop applications through standard HTTP requests, keeping the chat interface within VS Code.
- Reuse OpenAI Integrations: Adapt existing integrations by simply changing the base URL to redirect responses into established workflows.
- Enhanced Control: Ensure low latency and local traffic routing, with the option to secure access via a bearer token.
Features:
- Local HTTP server bound to
127.0.0.1by default. - Supports OpenAI-style endpoints for chat completions, model listings, and health checks.
- Real-time streaming responses using Server-Sent Events (SSE).
- Automatic startup with Visual Studio Code to maintain service availability.
Usage Scenarios:
- Automate Copilot responses for build processes, performance tracking, or documentation generation.
- Experiment with prompts while ensuring all interactions stay on-device.
- Utilize tool launchers like Raycast or Alfred to trigger completions without leaving the editor.
Getting Started:
- Install from the Visual Studio Marketplace.
- Open the Command Palette in VS Code and enable the Copilot Bridge extension.
- Check the status of the bridge to ensure it is active and ready.
Example API Requests:
To interact with the extension, simply use curl commands:
- List available models
curl http://127.0.0.1:PORT/v1/models
- Stream a completion
curl -N -H "Content-Type: application/json" \
-d '{"model":"gpt-4o-copilot","messages":[{"role":"user","content":"hello"}]}' \
http://127.0.0.1:PORT/v1/chat/completions
The architecture of Copilot Bridge ensures responsive interactions by managing request loads efficiently, utilizing the capabilities of VS Code’s Language Model API. It is designed for local use, thereby reinforcing privacy and minimizing security risks.
For further details or to contribute, visit the GitHub repository.
No comments yet.
Sign in to be the first to comment.