Major rewrite of the Go backend to support:
- Three API format imports: openai, anthropic, compatible
- Three protocol conversions: Chat Completions, Responses, Messages
- Hub-and-spoke architecture with Chat as intermediate format
Deleted:
- opencat.go (old entry)
- store/, team/, pkg/team/, pkg/store/ (old data layer)
- internal/model/, internal/consts/ (old types)
- internal/service/team/, internal/controller/team/ (old handlers)
- llm/ (removed LLM client library, pure proxy mode)
- dist/, assets/ (old build artifacts)
Added:
- internal/store/ — 9 GORM models + multi-DB support
- internal/pkg/ — crypto (AES-GCM), apikey, jwt, ratelimit, resp, tokenizer
- internal/channel/ — channel selection, weighted LB, health checks
- internal/proxy/convert/ — 6 protocol conversion functions + SSE streaming
- internal/proxy/ — gateway with request dispatch and upstream selection
- internal/usage/ — async usage recorder with batch writes
- internal/api/ — management API (auth, users, keys, channels, models)
- Makefile for build/test/deploy
Fixed API to match frontend expectations:
- Login response wraps token in { data: { token } }
- GET /api/profile route added
- Profile response wraps user in { code, data }
- Role returned as number (10=admin, 1=user)
3.9 KiB
3.9 KiB
opencatd-open OpenTeam
本项目即将更名,后续请关注 👉🏻 https://github.com/mirrors2/openteam
opencatd-open is an open-source, team-shared service for OpenAI-compatible LLM APIs — route clients to any provider through a single endpoint, share costs, and track usage across your team.
OpenCat for Team的开源实现
基本实现了opencatd的全部功能
(openai附属能力:whisper,tts,dall-e(text to image)...)
Extra Support:
| 🎯 | 🚧 | Extra Provider |
|---|---|---|
| OpenAI | ✅ | Azure, Github Marketplace |
| Claude | ✅ | VertexAI |
| Gemini | ✅ | |
| ... | ... |
快速上手
docker run -d --name opencatd -p 80:80 -v /etc/opencatd:/app/db mirrors2/opencatd-open
docker-compose
version: '3.7'
services:
opencatd:
image: mirrors2/opencatd-open
container_name: opencatd-open
restart: unless-stopped
ports:
- 80:80
volumes:
- /etc/opencatd:/app/db
or
wget https://github.com/mirrors2/opencatd-open/raw/main/docker/docker-compose.yml
支持的命令
获取 root 的 token
docker exec opencatd-open opencatd root_token
重置 root 的 token
docker exec opencatd-open opencatd reset_root
导出 user info -> user.json (docker file path: /app/db/user.json)
docker exec opencatd-open opencatd save
导入 user.json -> db
docker exec opencatd-open opencatd load
Q&A
关于证书?
- docker部署会白白占用掉VPS的80,443很不河里,建议用Nginx/Caddy/Traefik等反代并自动管理HTTPS证书.
没有服务器?
使用Nginx + Docker部署
pandora for team
如何自定义HOST地址? (仅OpenAI)
- 需修改环境变量,优先级递增(全局配置谨慎修改)
- Cloudflare AI Gateway地址
AIGateWay_Endpoint=https://gateway.ai.cloudflare.com/v1/123456789/xxxx/openai/chat/completions - 自定义的endpoint
OpenAI_Endpoint=https://your.domain/v1/chat/completions
设置主页跳转地址?
- 修改环境变量
CUSTOM_REDIRECT=https://your.domain