astaxie/TokenHub
TokenHub gives enterprises a private gateway to unify AI model access and governance, making every request controllable, traceable, and attributable.
What it solves
TokenHub solves the chaotic sprawl that happens when every team, application, and workflow starts consuming AI models. Without a governance layer, developers copy raw provider keys into each app, model access policies live in code, and nobody can explain the actual AI bill. TokenHub wraps every model call with control: routing by scenario, permission by project and team, token budgets, and a way to reconcile internal usage against provider invoices.
How it works
TokenHub sits between your users/applications and upstream model providers (OpenAI, Azure, Anthropic, Gemini, DeepSeek, Qwen, local models, etc.). It exposes OpenAI-compatible and Anthropic-compatible APIs. Administrators configure providers, a model catalog, routing policies (priority, weight, failover), identity sources (OAuth/OIDC), RBAC, audit, and cost controls. Users get project-scoped API keys and see their own usage. Team leaders manage project spaces, members, keys, and cost attribution. The system tracks every request to the user, project, team, and model, and compares internal usage with provider bills for reconciliation.
Who it's for
Enterprises that consume many AI models and need structured governance: platform teams, finance, and business units. It targets three roles: everyday users, team leaders, and administrators, each with a dedicated workspace. The system supports private deployment (SQLite-first, Docker Compose, native systemd) and PostgreSQL for multi-instance setups.
Highlights
- Project-scoped API keys with team ownership, quotas, and concurrency limits.
- Model routing with priority, weight, failover, and scenario-aware selection.
- Cost controls: budgets, provider spend comparison, model choice, and caching-driven savings (planned).
- Usage analytics and request logs attributed to user, project, team, model, and cost center.
- Identity source integration (OAuth/OIDC) plus RBAC and audit trails.
- OpenAI-compatible and Anthropic-compatible endpoints, plus embeddings, reranking, and image generation/editing.
- Native adapters for OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, local models, and 150+ provider templates.
- Clean console with role-aware navigation, global search, light/dark mode, and split-view API documentation.
- Deployment options: native systemd installer with checksum verification, or Docker Compose with a managed container and update/rollback controls.
Related
- Project
- Project
- Project
- Project
- Project