A LiteLLM proxy that lets you use GitHub Copilot models via the OpenAI-compatible API. Point any tool that supports ANTHROPIC_BASE_URL or OPENAI_BASE_URL at this proxy to use Copilot models.
Unlike other "copilot-proxy" projects that implement custom proxy servers, this is just a thin wrapper script and config for LiteLLM's built-in github_copilot provider.
- uv (Python package runner)
- A GitHub account with Copilot access
- A secret manager (1Password CLI or macOS Keychain)
macOS:
brew install uvLinux:
curl -LsSf https://astral.sh/uv/install.sh | shCreate a PAT with the copilot scope:
https://github.com/settings/tokens/new?scopes=copilot&description=LiteLLM%20Proxy
Store the token in your preferred secret manager.
1Password:
# Store in 1Password (via web UI or CLI), then reference it as:
op://YourVault/YourItem/tokenmacOS Keychain:
security add-generic-password -a "$USER" -s copilot-token -w "ghp_your_token_here"Add to your shell profile (~/.zshrc, ~/.bashrc, etc.):
# Required: Command to retrieve your GitHub PAT
# Pick ONE of these based on your secret manager:
# 1Password:
export COPILOT_PROXY_TOKEN_CMD='op read "op://YourVault/YourItem/token"'
# macOS Keychain:
export COPILOT_PROXY_TOKEN_CMD='security find-generic-password -a "$USER" -s copilot-token -w'Clone this repo and add it to your PATH:
git clone https://github.com/jonmagic/litellm-copilot.git ~/.litellm-copilotThen either symlink the script:
ln -s ~/.litellm-copilot/litellm-copilot /usr/local/bin/litellm-copilotOr add the directory to your PATH:
export PATH="$HOME/.litellm-copilot:$PATH"Start the proxy:
litellm-copilotTo use a custom port:
litellm-copilot --port 8080To use LiteLLM nightly from GitHub main:
litellm-copilot --nightlyThe proxy runs on http://localhost:4000 by default.
Configure your favorite AI tools to use the proxy. Add these to your shell profile or set them before running the tool.
Install:
npm install -g @anthropic-ai/claude-codeConfigure:
export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_AUTH_TOKEN="fake-key" # Required but not usedTest:
claude -p "What is 2+2?"Install:
npm install -g opencode@latestOpenCode has built-in GitHub Copilot support — no proxy needed:
opencode auth loginNote: Gemini CLI requires a fix in LiteLLM that forwards
extra_headersthrough the generateContent adapter. This fix is pending in PR #18935. Until it's merged, you can run the proxy using a patched version:# Clone the patched fork git clone https://github.com/jonmagic/litellm.git ~/litellm-patched # Create a venv and install (Python 3.13 required, uvloop doesn't support 3.14+) python3.13 -m venv ~/litellm-patched/.venv ~/litellm-patched/.venv/bin/pip install -e ~/litellm-patched[proxy] # Run the proxy using the patched version GITHUB_TOKEN=$(eval "$COPILOT_PROXY_TOKEN_CMD") ~/litellm-patched/.venv/bin/litellm --config ~/.litellm-copilot/config.yaml --port 4000
Install:
npm install -g @google/gemini-cli@previewConfigure:
export GOOGLE_GEMINI_BASE_URL="http://localhost:4000"
export GEMINI_API_KEY="fake-key" # Required but not usedTest:
gemini -p "What is 2+2?"Install:
pip install aider-chatConfigure:
export AIDER_OPENAI_API_BASE="http://localhost:4000"
export OPENAI_API_KEY="fake-key" # Required but not usedTest:
aider --model openai/claude-sonnet-4 --message "What is 2+2?"llm (Simon Willison's LLM CLI)
Install llm:
Homebrew (recommended):
brew install llmpip:
pip install llmInstall the Azure plugin:
llm install llm-azureVerify the plugin is installed:
llm plugins
# Should show llm-azure in the listConfigure a dummy API key (llm requires an API key even though the proxy doesn't use it):
llm keys set litellm
# Enter: fake-api-keyAdd model configurations to ~/.config/io.datasette.llm/azure/config.yaml:
# Local litellm proxy models
- model_id: copilot-gpt-4.1
provider: openai
model_name: gpt-4.1
endpoint: http://localhost:4000/v1/
api_key_name: litellm
- model_id: copilot-claude-sonnet-4.5
provider: openai
model_name: claude-sonnet-4.5
endpoint: http://localhost:4000/v1/
api_key_name: litellmNote: The
copilot-prefix helps distinguish litellm-copilot models from other configured models in llm. You can add any of the models from the Supported Models section below using this pattern.
Set your default model:
llm models default copilot-gpt-4.1Test:
llm "What is 2+2?"Last updated: 2026-02-06
| Model | Vendor | Category |
|---|---|---|
claude-haiku-4.5 |
Anthropic | versatile |
claude-opus-4.5 |
Anthropic | powerful |
claude-opus-4.6 |
Anthropic | powerful |
claude-sonnet-4 |
Anthropic | versatile |
claude-sonnet-4.5 |
Anthropic | versatile |
gemini-2.5-pro |
powerful | |
gemini-3-flash-preview |
lightweight | |
gemini-3-pro-preview |
powerful | |
gpt-4.1 |
Azure OpenAI | versatile |
gpt-4o |
Azure OpenAI | versatile |
gpt-5 |
Azure OpenAI | versatile |
gpt-5-codex |
OpenAI | powerful |
gpt-5-mini |
Azure OpenAI | lightweight |
gpt-5.1 |
OpenAI | versatile |
gpt-5.1-codex |
OpenAI | powerful |
gpt-5.1-codex-max |
OpenAI | powerful |
gpt-5.1-codex-mini |
OpenAI | powerful |
gpt-5.2 |
OpenAI | versatile |
gpt-5.2-codex |
OpenAI | powerful |
grok-code-fast-1 |
xAI | lightweight |
ISC