Rust-first LLM gateway workspace with an embedded TanStack Start admin control plane.
crates/gateway- Rust HTTP runtime for
/healthz,/readyz,/v1/*, and/api/v1/admin/*
- Rust HTTP runtime for
crates/gateway-core- shared domain types, traits, OpenAI-compatible Chat/Responses/Embeddings DTOs, and errors
crates/gateway-mcp- protocol-only MCP JSON-RPC, Streamable HTTP discovery, tool normalization, and schema hashing
crates/gateway-store- libsql or SQLite and PostgreSQL stores, migrations, and seed behavior
crates/gateway-service- auth, model resolution, routing, accounting, and request logging
crates/gateway-providers- provider adapters and transport helpers
crates/admin-ui- Rust reverse-proxy integration for
/admin*
- Rust reverse-proxy integration for
crates/admin-ui/web- TanStack Start and React admin UI
Install the repo toolchain:
eval "$(mise activate zsh)"
mise install
mise run ui-installRun the local development stack:
mise run dev-stackDefault local endpoints:
- gateway API:
http://localhost:8080 - admin UI:
http://localhost:8080/admin - active config:
./gateway.yaml - database backend: local libsql or SQLite
On a first mise run dev-stack with no ./gateway.db, the local demo dataset is seeded automatically.
Use mise run gateway-reset-local-demo any time you want to recreate that richer sample state from scratch.
- local dev stack:
mise run dev-stack
- local gateway:
mise run gateway-serve
- local explicit migration:
mise run gateway-migrate
- local explicit bootstrap admin:
mise run gateway-bootstrap-admin
- local explicit config seed:
mise run gateway-seed-config
- request-log retention purge:
mise run gateway-purge-request-logs-dry-runmise run gateway-purge-request-logsmise run gateway-purge-request-logs-dry-run-prodmise run gateway-purge-request-logs-prod
- local-only demo dataset seed:
mise run gateway-seed-local-demo
- local-only demo dataset reset:
mise run gateway-reset-local-demo
- production-shaped local stack:
mise run prod-stack
- production-shaped explicit migration:
mise run gateway-migrate-prod
- production-shaped explicit bootstrap admin:
mise run gateway-bootstrap-admin-prod
- production-shaped explicit config seed:
mise run gateway-seed-config-prod
- admin contract generation:
mise run admin-contract-generate
- admin contract drift check:
mise run admin-contract-check
- full lint:
mise run lint
- full test:
mise run test
- E2E contract suite:
mise run e2e-test
- Fresh databases apply one active
V17baseline per backend. - Databases carrying pre-baseline
V1throughV16history must be recreated instead of upgraded in place. - Use
mise run gateway-migrateto apply or inspect the active migration state.
Use the docs site instead of treating this file as the full admin and maintainer manual.
- repo workflow:
- docs site:
- startup and first access:
- config contract:
- identity:
- gateway API keys and service-account-style callers:
- budgets:
- routing:
- provider API compatibility:
- cross-cutting request flow:
- pricing and spend:
- observability:
- admin UI:
- maintainer-facing docs source notes:
- deploy quick start:
- Kubernetes and Helm:
The product runs as a same-origin control plane:
- the gateway listens on the configured bind address
- the admin UI SSR process runs separately
- the gateway reverse-proxies
/admin*to the admin UI upstream
This is part of the product contract, not only a local-dev trick.
The live admin control plane ships checked-in contract artifacts:
- gateway OpenAPI artifact:
crates/gateway/openapi/admin-api.json
- generated admin UI types:
crates/admin-ui/web/src/generated/admin-api.ts
Regenerate them with:
mise run admin-contract-generateVerify drift with:
mise run admin-contract-checkFor the full maintainer workflow, use Admin API Contract Workflow.
