How benedictking/ccx works
CCX is an AI API proxy and protocol-translation gateway, with a web administration console and a native desktop management option. The principal workflow accepts a client request, selects an eligible upstream channel, translates and forwards the request, then returns the upstream response. Separate capabilities cover channel/key administration, health checks and failover, usage monitoring, and Autopilot routing. The README documents the supported protocols and scheduling features; sampled source shows route registration, capability-test requests, health-check orchestration, and selected supporting logic, but not every runtime call path.
Main entry points: handlers Protocol Handlers · channel_scheduler.go Channel Scheduler · main.go HTTP Entrypoint · manager.go Health Checks
Components 18
Proxy Gateway
- HTTP Entrypoint
backend-go/main.go - Protocol Handlers
backend-go/internal/handlers - Protocol Converters
backend-go/internal/converters - Request Compression
backend-go/internal/compression/engine.go - Model Providers
backend-go/internal/providers
Routing and Health
- Channel Scheduler
backend-go/internal/scheduler/channel_scheduler.go - Channel Configuration
backend-go/internal/config/config.go - Health Checks
backend-go/internal/healthcheck/manager.go - Metrics and Logs
backend-go/internal/metrics - Metrics Store
backend-go/internal/metrics/sqlite_store.go - Autopilot Routing
backend-go/internal/autopilot
Administration
- Web Admin Console
frontend/src/App.vue - Admin API
backend-go/internal/handlers - Capability Testing
backend-go/internal/handlers/capability_test_handler.go
Desktop Management
- Desktop Shell
desktop/app.go - Backend Manager
desktop/internal/backend/manager.go
Other components
- API Client
- AI Services
Connections 21
- API Client → HTTP Entrypoint: sends requests
- HTTP Entrypoint → Protocol Handlers: dispatches API
- Protocol Handlers → Channel Scheduler: selects channel
- Channel Scheduler → Channel Configuration: reads channels
- Protocol Handlers → Protocol Converters: translates payloads
- Protocol Handlers → Request Compression: may compress
- Protocol Handlers → Model Providers: forwards requests
- Model Providers → AI Services: calls models
- Health Checks → AI Services: probes channels
- Health Checks → Metrics Store: records health
- Health Checks → Channel Scheduler: reports failures
- Channel Scheduler → Metrics and Logs: records traffic
- Metrics and Logs → Metrics Store: persists metrics
- Web Admin Console → Admin API: calls admin APIs
- HTTP Entrypoint → Admin API: registers admin routes
- Admin API → Channel Configuration: manages channels
- Admin API → Capability Testing: starts tests
- Capability Testing → AI Services: tests capabilities
- Autopilot Routing → Channel Scheduler: advises routing
- Desktop Shell → Backend Manager: manages process
- Backend Manager → HTTP Entrypoint: starts or attaches