Component: tokenfactory-controlplane · Formerly: the amazee.ai
backend (repo amazeeai/backend, local: ~/git/amazeeai/backend) ·
Runs as: api.amazee.ai · Status: ✅ production, paying customers
The FastAPI service that is Token Factory's control plane. It owns tenancy,
key lifecycle, budgets, regions, and billing — the control-plane half of the
Inference Mesh pillar.
Python 3.12 · FastAPI · SQLAlchemy 2 + Alembic · PostgreSQL · httpx · Stripe ·
boto3 (SES email, DynamoDB OTP codes) · Prometheus instrumentation · Next.js 16
admin frontend · Helm charts + Lagoon deployment · Apache 2.0 licensed.
| Concept | What it is |
|---|---|
| Region | First-class object pointing at its own LiteLLM proxy (litellm_api_url + master key) and Postgres cluster. Public or dedicated (single-tenant). |
| Private AI Key | The product unit: a LiteLLM virtual token provisioned into a chosen region. Owned by a user XOR a team. (In amazee.ai each key also bundles a pgvector database — parked outside Token Factory scope for now.) |
| Team | Tenancy + billing boundary. Budget types: PERIODIC (subscription cycles) or POOL (prepaid, purchase-gated). Soft-delete → retention → GDPR hard-delete lifecycle. |
| Limits | Unified limited_resources model with source precedence MANUAL > PRODUCT > DEFAULT; spend caps at team / member / key scope — strictest applicable gate wins. |
POST /key/generate on the region's LiteLLM withcurrent_spend + remaining for real-time enforcement.system_admin, user, sales) and team rolesadmin, key_creator, read_only) enforced via FastAPI dependencies./internal/provision-key).| Edition | Usage |
|---|---|
| Enterprise MVP | Candidate management layer in "slim" profile — see ADR-005. The AWS dependencies (SES/DynamoDB OTP) are the main thing to make optional for a single-server install. |
| Enterprise | The Control Plane, minus Stripe (chargeback instead of payments). |
| NeoCloud | The Control Plane, full: multi-region orchestration + Stripe monetization. |
/public/models into the curated catalog.