Freebuff for Copilot 🚀

Use Freebuff's free AI models (DeepSeek V4 Flash, MiMo 2.5) directly in GitHub Copilot Chat via an OpenAI-compatible local proxy.
Author: akshar-bhesaniya
Screenshots 📸
| Dashboard (Dark) |
Server Running |
 |
 |
Features
- 🆓 Free AI models — DeepSeek V4 Flash and MiMo 2.5
- 🔌 Drop-in integration — automatically registers models in Copilot's BYOK config
- 🛡️ Schema sanitization — strips problematic fields (
$comment, enumDescriptions) that upstream backends reject
- ⏱️ Rate limiting — built-in cooldown to avoid upstream 429 errors
- 📊 Dashboard — sidebar webview with server status, account quota, model list, and controls
- 🔄 Round-robin support — automatically switch between multiple Freebuff accounts when one hits its daily quota
- 👤 Multi-account management — add and remove accounts directly from VS Code via OAuth login
- 🔒 Secure credential storage — tokens stored in VS Code settings, managed automatically
Quick Start
1. Add a Freebuff account
Click the + Add User button in the sidebar dashboard or run the Freebuff: Add User command from the Command Palette. Follow the OAuth login in your browser.
2. Start the server
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:
Freebuff: Start Proxy Server
3. Use in Copilot Chat
Open Copilot Chat — Freebuff models appear automatically under the "Freebuff" provider group. Select a model and start chatting for free!
💡 Tip: Enable freebuffCopilot.server.autoStart in settings to have the server start automatically when VS Code launches.
Commands
| Command |
Description |
Freebuff: Start Proxy Server |
Start both proxy servers and configure Copilot |
Freebuff: Stop Proxy Server |
Stop all servers |
Freebuff: Restart Proxy Server |
Restart everything |
Freebuff: Configure Copilot Models |
(Re)register models in Copilot's config |
Freebuff: Show Controls |
Quick-pick control panel |
Freebuff: Add User |
Add a Freebuff account via OAuth login |
Freebuff: Remove Account |
Remove a saved Freebuff account |
Dashboard
The sidebar dashboard gives you a live overview of your Freebuff setup:
- Server status — proxy and schema sanitizer status
- Accounts — list of logged-in accounts with quota bars
- Round-robin — see which account is active and total count
- Rate limiter — cooldown status and manual reset
- Freebuff session — current session model, time left, and usage
- Available models — all registered Freebuff models
Architecture
For a quick overview — this extension opens two local ports (both are non-standard and unlikely to conflict with common services):
┌──────────────┐ ┌──────────────────┐ ┌───────────────┐ ┌──────────────┐
│ Copilot │ ──▶ │ ThrottlingProxy │ ──▶ │ FreebuffServer │ ──▶ │ codebuff.com │
│ Chat │ ◀── │ (port :9420) │ ◀── │ (port :9317) │ ◀── │ API │
└──────────────┘ └──────────────────┘ └───────────────┘ └──────────────┘
│ │
Sanitizes schema Manages sessions
+ rate limits + account switching
Ports: :9420 and :9317 are purposely chosen — they sit well outside the range of common services (80, 443, 3000, 5000, 8080, 5432, etc.) and the ephemeral port range, so you won't run into conflicts with your other dev tools.
Detailed component diagram below:
flowchart TB
subgraph VSIDE ["VS Code"]
direction TB
CC["Copilot Chat<br/><i>Chat panel</i>"]
SP["SidebarProvider<br/><i>Dashboard Webview</i>"]
end
subgraph EXT ["Freebuff Extension"]
direction TB
TP["ThrottlingProxy<br/><small>:9420</small><br/><i>Schema sanitization<br/>+ Rate limiting</i>"]
FS["FreebuffServer<br/><small>:9317</small><br/><i>OpenAI-compatible<br/>API server</i>"]
RL["RateLimiter<br/><i>Cooldown manager</i>"]
AM["AuthManager<br/><i>Account store<br/>+ Round-robin</i>"]
MR["ModelRegistry<br/><i>Model definitions</i>"]
end
subgraph EXT2 ["External"]
API["codebuff.com<br/><i>Freebuff API</i>"]
OAUTH["Freebuff OAuth<br/><i>Login page</i>"]
end
CC -- "Chat request" --> TP
TP -- "Sanitized request" --> FS
FS -- "API call" --> API
API -- "Streaming response" --> FS
FS -- "Response" --> TP
TP -- "Response" --> CC
SP -- "Start / Stop / Restart" --> FS
SP -- "Account status" --> AM
SP -- "Rate limiter status" --> RL
SP -- "Model list" --> MR
SP -- "OAuth login" --> AM
AM -- "Open browser" --> OAUTH
OAUTH -- "Token callback" --> AM
FS -- "Check quota" --> AM
FS -- "Rate limit check" --> RL
FS -- "Get models" --> MR
AM -- "Switch account" --> FS
Components
- FreebuffServer — OpenAI-compatible HTTP server that handles model listings and chat completions via Freebuff's API
- ThrottlingProxy — Schema-sanitizing proxy that strips non-standard fields and enforces rate limits
- RateLimiter — Configurable cooldown between requests to avoid upstream 429 responses
- AuthManager — Stores and manages Freebuff account credentials in VS Code settings
- SidebarProvider — Webview-based dashboard for monitoring and control
Extension Settings
| Setting |
Default |
Description |
freebuffCopilot.server.autoStart |
false |
Auto-start on VS Code launch |
freebuffCopilot.server.port |
9317 |
Freebuff server port |
freebuffCopilot.proxy.port |
9420 |
Throttling proxy port |
freebuffCopilot.proxy.enabled |
true |
Enable schema-sanitizing proxy |
freebuffCopilot.rateLimit.cooldownMs |
8000 |
Cooldown between requests (ms) |
freebuffCopilot.roundRobin.enabled |
true |
Auto-switch accounts on quota exhaustion |
freebuffCopilot.roundRobin.strategy |
sequential |
Round-robin strategy (sequential / least-used) |
freebuffCopilot.autoConfigureCopilot |
false |
Auto-register models in Copilot config |
Requirements
- VS Code ^1.123.0
- Node.js 18+
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode
npm run watch
Press F5 in VS Code to launch an Extension Development Host with the extension loaded.
To package a .vsix for local install:
npm run package
Contributing
Issues and pull requests are welcome. Please open an issue first for significant changes so we can discuss the approach.
Changelog
See CHANGELOG.md for version history.
License
MIT — see LICENSE for details.