Communityコーディング&開発github.com

xixu-me/LiteLLM Copilot経由でClaude Codeを実行

ローカルのLiteLLMプロキシを介してClaude CodeをGitHub Copilotにルーティングし、直接のAnthropic費用を削減したり、ANTHROPIC_BASE_URLやANTHROPIC_MODELのオーバーライドを設定したり、Copilotプロキシ設定の失敗(モデル未検出、localhostトラフィックなし、GitHubの401/403認証エラーなど)をトラブルシューティングする際に使用します。

LiteLLM Copilot経由でClaude Codeを実行 とは?

このスキルは、ローカルのLiteLLMプロキシ経由でClaude CodeをGitHub Copilotにルーティングする方法を提供します。これにより、直接Anthropic APIを使用する代わりにCopilotのサブスクリプション経由でモデルアクセスが可能になり、コスト削減に役立ちます。主な設定項目として、`ANTHROPIC_BASE_URL`をローカルプロキシに、`ANTHROPIC_MODEL`を適切なモデル名にオーバーライドする方法を説明します。また、モデル未検出エラー、localhostトラフィックがない問題、GitHubの401/403認証エラーなど、プロキシ設定でよく発生する問題のトラブルシューティング手順も提供します。このスキルはClaude CodeとLiteLLMに対応しており、開発者が効率的にAIエージェントツールを管理・最適化するのに役立ちます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xixu-me/skills/tree/main/skills/running-claude-code-via-litellm-copilot

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

LiteLLM Copilot経由でClaude Codeを実行 は何をしますか?

ローカルのLiteLLMプロキシを介してClaude CodeをGitHub Copilotにルーティングし、直接のAnthropic費用を削減したり、ANTHROPIC_BASE_URLやANTHROPIC_MODELのオーバーライドを設定したり、Copilotプロキシ設定の失敗(モデル未検出、localhostトラフィックなし、GitHubの401/403認証エラーなど)をトラブルシューティングする際に使用します。

設定手順

  1. LiteLLMプロキシをローカルで起動します(例:litellm --model claude-sonnet-4-20250514 --port 4000)。
  2. 環境変数を設定します:
    • ANTHROPIC_BASE_URL=http://localhost:4000
    • ANTHROPIC_MODEL=claude-sonnet-4-20250514(またはプロキシで指定したモデル)
  3. Claude Codeを通常通り実行します。プロキシ経由でCopilotにリクエストが送信されます。

トラブルシューティング

モデル未検出エラー

  • プロキシで正しいモデル名が指定されているか確認します。
  • ANTHROPIC_MODELがプロキシで使用しているモデルと一致していることを確認します。

localhostトラフィックなし

  • LiteLLMプロキシが正しいポート(例:4000)で実行されているか確認します。
  • ファイアウォールやネットワーク設定がlocalhostトラフィックをブロックしていないか確認します。

GitHub 401/403認証エラー

  • GitHub Copilotのサブスクリプションが有効であることを確認します。
  • GitHubの認証トークンが正しく設定されているか確認します。
  • Copilotの認証状態をリフレッシュするには、gh auth refreshを実行します。

参考リンク

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

xixu-me/develop-userscripts

Use when building, debugging, packaging, or publishing browser userscripts for Tampermonkey or ScriptCat, including GM APIs, metadata blocks, permission issues, @match/@grant/@connect setup, ScriptCat background or scheduled scripts, UserConfig blocks, or subscription workflows.

xixu-me/github-actions-docs

Use when users ask how to write, explain, customize, migrate, secure, or troubleshoot GitHub Actions workflows, workflow syntax, triggers, matrices, runners, reusable workflows, artifacts, caching, secrets, OIDC, deployments, custom actions, or Actions Runner Controller, especially when they need official GitHub documentation, exact links, or docs-grounded YAML guidance.

xixu-me/openclaw-secure-linux-cloud

Use when self-hosting OpenClaw on a cloud server, hardening a remote OpenClaw gateway, choosing between SSH tunneling, Tailscale, or reverse-proxy exposure, or reviewing Podman, pairing, sandboxing, token auth, and tool-permission defaults for a secure personal deployment.

xixu-me/opensource-guide-coach

Use when a user wants guidance on starting, contributing to, growing, governing, funding, securing, or sustaining an open source project, or asks about contributor onboarding, community health, maintainer burnout, code of conduct, metrics, legal basics, or open source project adoption.

xixu-me/readme-i18n

Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.

xixu-me/secure-linux-web-hosting

Use when setting up, hardening, or reviewing a cloud server for self-hosting, including DNS, SSH, firewalls, Nginx, static-site hosting, reverse-proxying an app, HTTPS with Let's Encrypt or ACME clients, safe HTTP-to-HTTPS redirects, or optional post-launch network tuning such as BBR.

xixu-me/skills-cli

Use when users ask to discover, install, list, check, update, remove, back up, restore, sync, or initialize Agent Skills, mention `bunx skills`, `npx skills`, `skills.sh`, or `skills-lock.json`, ask "find a skill for X", or want help extending agent capabilities with installable skills.

xixu-me/tzst

Use when the user needs to create, extract, flatten, list, test, install, script, or troubleshoot `tzst` CLI workflows for `.tzst` or `.tar.zst` archives, including compression levels, streaming mode, extraction filters, conflict resolution, JSON output, or standalone binary setup, even if they describe the archive task without naming `tzst`.

xixu-me/use-my-browser

Use when work depends on the user's live browser session or visible rendered state rather than static fetches, especially for browser debugging contexts or DevTools-selected elements or requests, logged-in dashboards or CMS flows, localhost apps, forms, uploads, downloads, media inspection, DOM or iframe inspection, Shadow DOM, or browser failures that look like soft 404s, auth walls, anti-bot checks, or rate limits.

xixu-me/xdrop

Use this skill when the user wants to send or fetch files through an Xdrop server from the terminal, asks to automate encrypted Xdrop share-link workflows, provides an Xdrop `/t/:transferId#k=...` link to download and decrypt locally, or needs Xdrop CLI flags such as `--quiet`, `--json`, `--expires-in`, `--output`, or `--api-url`, even if they do not explicitly mention the skill name.

xixu-me/xget

Use when tasks involve Xget URL rewriting, registry/package/container/API acceleration, integrating Xget into Git, download tools, package managers, container builds, AI SDKs, CI/CD, deployment, self-hosting, or adapting commands and config from the live README `Use Cases` section into files, environments, shells, or base URLs.

関連スキル