github copilot api
2.2K
本文档仅用于“部署与使用”,不涉及源码说明。适合直接放在 Docker Hub 页面。
guowenlong/github-copilot-apilatest(或固定版本如 v1.2.2)4141docker-compose.ymlservices:
copilot-api:
image: guowenlong/github-copilot-api:latest
container_name: github-copilot-api
restart: unless-stopped
ports:
- "4141:4141"
environment:
GH_TOKEN: "ghu_xxxxxxxxxxxxxxxxxxxx"
volumes:
- copilot-data:/root/.local/share/copilot-api
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:4141/"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
volumes:
copilot-data:
docker compose up -d
docker compose ps
docker compose logs -f copilot-api
docker volume create copilot-data
docker run -d \
--name github-copilot-api \
--restart unless-stopped \
-p 4141:4141 \
-e GH_TOKEN=ghu_xxxxxxxxxxxxxxxxxxxx \
-v copilot-data:/root/.local/share/copilot-api \
guowenlong/github-copilot-api:latest
服务启动后,地址为:
http://你的服务器IP:4141/http://你的服务器IP:4141/admin将你的客户端 Base URL 指向:
http://你的服务器IP:4141/v1如需鉴权,在请求头带上任一方式:
Authorization: Bearer <你的APIKey>X-Api-Key: <你的APIKey>若未配置 API Key,接口可匿名访问(建议在公网场景务必配置)。
/adminadmin123POST /v1/chat/completionsPOST /v1/responsesPOST /v1/embeddingsGET /v1/modelsPOST /v1/messagesPOST /:provider/v1/messagesGET /:provider/v1/models/v1/models)说明已启用 API Key 鉴权。请在请求头携带:
Authorization: Bearer <API Key> 或X-Api-Key: <API Key>确认访问路径是 /admin,并检查容器日志:
docker compose logs -f copilot-api
请确认挂载了持久化卷:
/root/.local/share/copilot-api/adminContent type
Image
Digest
sha256:5f59bfc1d…
Size
58.5 MB
Last updated
7 months ago
docker pull guowenlong/github-copilot-api