Documentation Index
Fetch the complete documentation index at: https://to11.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Gateway Development
This guide covers how to run the Rust gateway on your host machine for faster development iteration, and how to work with the crate workspace.Prerequisites
- Rust stable toolchain (
rustup default stable) - Docker and Docker Compose v2+ (for infrastructure services)
- An API key for at least one LLM provider
Run the gateway on your host machine
This flow runs the Rust gateway on your host machine while keeping infrastructure services (ClickHouse, OTel Collector, Grafana, Tempo) in Docker containers.docker/gateway/config.dev.toml. The host-run gateway itself
listens on http://localhost:4000; read the current API and observability host
ports for your worktree from .worktree/runtime.json. See the
configuration reference for all available settings.
Crate workspace
The gateway is organised as a Cargo workspace with isolated responsibilities:| Crate | Purpose |
|---|---|
gateway | Binary entry point, CLI, benchmarks |
gateway-core | Axum router, provider adapters, SSE streaming |
gateway-config | TOML config loading, runtime telemetry resolution |
gateway-security | Detector trait, PII + blocklist + ONNX pipeline |
gateway-telemetry | OTel init, middleware layers, context propagation |
gateway-auth | API key and JWT validation |
gateway-cache | Semantic and exact-match caching |
gateway-types | Shared types and error definitions |
gateway-security owns the ort (ONNX Runtime) dependency so that changes to routing, config, or core never trigger ONNX recompilation.
Running tests
Building a release binary
target/release/gateway.
Environment variables
The gateway uses passthrough authentication — the caller’sAuthorization header is forwarded directly to the upstream provider. The gateway itself does not read or store provider API keys.
Telemetry can be enabled via environment variables that override the TOML config. See the configuration reference for the full list.