How ken00h/claude-lb works
claude-lb is a work-in-progress Claude/Anthropic account load balancer and proxy with a usage dashboard. Its intended flow is an API client sending Anthropic-compatible requests, account-pool selection and failover, then usage tracking and dashboard reporting. The README explicitly warns that the bundled Codex proxy core is currently inert; the proxy path below represents the documented target, not a working end-to-end flow. The tree and source index show substantial account, dashboard, persistence, and usage subsystems, but sampled excerpts do not establish all runtime wiring.
Main entry points: proxy/service.py Request proxy · models.py Application database · accounts/service.py Account lifecycle · auth_manager.py Account credentials
Components 17
Proxy and routing
- Request proxy
app/modules/proxy/service.py - Account routing
app/modules/proxy/load_balancer.py
Accounts and access
- Account management API
app/modules/accounts/api.py - Account lifecycle
app/modules/accounts/service.py - Account credentials
app/modules/accounts/auth_manager.py - Dashboard authentication
app/modules/dashboard_auth/service.py - Roles and users
app/modules/dashboard_roles/service.py
Usage and dashboard
- Usage ingestion
app/modules/usage/live_ingest.py - Request records
app/modules/request_logs/repository.py - Dashboard data
app/modules/dashboard/service.py - Dashboard UI
frontend/src/App.tsx
Application platform
- Application database
app/db/models.py - Application runtime
app/main.py - Runtime settings
app/core/config/settings.py - Token encryption
app/core/crypto.py
Other components
- API client
- Claude upstream
Connections 13
- API client → Request proxy: sends requests
- Request proxy → Account routing: selects accounts
- Request proxy → Claude upstream: forwards requests
- Account management API → Account lifecycle: manages accounts
- Account lifecycle → Account credentials: refreshes credentials
app/modules/accounts/auth_manager.py - Account credentials → Token encryption: uses encryption
app/modules/accounts/auth_manager.py - Dashboard authentication → Roles and users: checks roles
app/modules/dashboard_auth/service.py - Usage ingestion → Application database: settles snapshots
app/modules/usage/live_ingest.py - Request records → Application database: stores request records
app/modules/request_logs/repository.py - Dashboard data → Application database: reads dashboard data
- Dashboard UI → Dashboard data: presents usage
- Application runtime → Runtime settings: loads configuration
app/main.py - Runtime settings → Token encryption: configures key path
app/core/crypto.py