skills/xixu-me/running-claude-code-via-litellm-copilot/SKILL.md
Use when routing Claude Code through a local LiteLLM proxy to GitHub Copilot, reducing direct Anthropic spend, configuring ANTHROPIC_BASE_URL or ANTHROPIC_MODEL overrides, or troubleshooting Copilot proxy setup failures such as model-not-found, no localhost traffic, or GitHub 401/403 auth errors.
npx skillsauth add aiskillstore/marketplace running-claude-code-via-litellm-copilotInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill for the specific workaround where Claude Code keeps its Anthropic-shaped client behavior, but the actual backend traffic is sent to a local LiteLLM proxy and then forwarded to GitHub Copilot.
Treat this as an advanced workaround, not an officially guaranteed GitHub workflow. Help the user succeed technically, but do not promise GitHub support, policy approval, or long-term compatibility.
This skill is guidance-first but execution-aware:
~/.claude/settings.json or shell profile files.Read references/doc-verified-notes.md before answering if you need to justify which parts come from the article and which parts were tightened against current LiteLLM docs.
Use this skill when the user wants any of the following:
config.yaml for LiteLLM's GitHub Copilot providerANTHROPIC_BASE_URL, ANTHROPIC_MODEL, or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC setupDo not use this skill for:
config.yaml unless the user explicitly wants a persistent setup.ANTHROPIC_MODEL and LiteLLM model_name identical.
Exact string match matters more than clever explanation.ANTHROPIC_AUTH_TOKEN as a local placeholder.
Claude Code expects a non-empty value locally, but it is not the GitHub Copilot credential and should not be presented as a reusable secret.~/.claude/settings.json wholesale.
Merge only the needed env keys and preserve unrelated settings.Check these first when the user wants real setup work:
claude --help succeedsuv --version or pip --version succeeds4000If the user only wants instructions, state the prerequisites instead of running them.
Use this rule:
For persistent setup, confirm the target file and then merge keys into ~/.claude/settings.json. Do not replace the file contents.
config.yamlStart from the article's flow, but keep the provider naming aligned with LiteLLM docs:
model_list:
- model_name: claude-opus-4.5
litellm_params:
model: github_copilot/claude-opus-4.5
drop_params: true
Explain the fields:
model_name: the logical name Claude Code will requestmodel: the LiteLLM provider route, using github_copilot/<model>drop_params: true: strips unsupported Anthropic-specific fields before forwarding to CopilotIf the user wants a different Copilot-backed model, keep the same pattern:
model_list:
- model_name: <logical-name>
litellm_params:
model: github_copilot/<copilot-model>
drop_params: true
Do not hardcode extra headers into the default path unless the user already hit a rejection that suggests header overrides are needed.
Preferred install:
uv tool install "litellm[proxy]"
Fallback:
pip install "litellm[proxy]"
Start the proxy from the directory containing config.yaml:
litellm --config config.yaml --port 4000
Tell the user to keep that terminal open because the logs are the fastest truth source during verification.
On the first successful request to the GitHub Copilot provider, LiteLLM may open a device authorization flow:
Optional token-location overrides exist:
GITHUB_COPILOT_TOKEN_DIRGITHUB_COPILOT_ACCESS_TOKEN_FILEOnly mention these when the user needs custom token storage, shared environments, or troubleshooting around expired or misplaced credentials.
For a temporary PowerShell session:
$env:ANTHROPIC_AUTH_TOKEN = "sk-any-string"
$env:ANTHROPIC_BASE_URL = "http://localhost:4000"
$env:ANTHROPIC_MODEL = "claude-opus-4.5"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
claude
For a temporary Bash or Zsh session:
export ANTHROPIC_AUTH_TOKEN="sk-any-string"
export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_MODEL="claude-opus-4.5"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claude
For persistent configuration, merge these keys into ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-any-string",
"ANTHROPIC_BASE_URL": "http://localhost:4000",
"ANTHROPIC_MODEL": "claude-opus-4.5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}
Merge-safe behavior:
env entries that are unrelated to this workflowUse two terminals when possible:
claudeAsk for one small prompt such as a short script or code review request, then verify:
github_copilot/<model>The healthy path is:
Claude Code -> LiteLLM -> GitHub Copilot -> LiteLLM -> Claude Code
If Claude Code reports model-not-found, 404-like failures, or LiteLLM says the model does not exist:
ANTHROPIC_MODEL to model_name exactlyIf LiteLLM never receives a request:
ANTHROPIC_BASE_URL points to http://localhost:4000claudeIf LiteLLM reaches GitHub Copilot but gets 401 or 403 responses:
The article uses explicit Copilot-style headers. Current LiteLLM docs expose GitHub Copilot as a provider and also document header override support.
Only reach for explicit extra_headers when:
Example fallback:
model_list:
- model_name: claude-opus-4.5
litellm_params:
model: github_copilot/claude-opus-4.5
drop_params: true
extra_headers:
editor-version: "vscode/1.85.1"
editor-plugin-version: "copilot/1.155.0"
Copilot-Integration-Id: "vscode-chat"
user-agent: "GithubCopilot/1.155.0"
Present this as an advanced fallback, not the universal default.
When answering a real user request with this skill, include:
config.yaml or the delta to applyANTHROPIC_AUTH_TOKEN is a real Copilot credential.~/.claude/settings.json wholesale.github_copilot/<model> pattern and note that Copilot-exposed model availability may change.development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.