Skip to main content

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 Quickstart

This tutorial walks you through building the gateway from source, sending your first request, and enabling security — all without Docker or the full to11 stack.

Prerequisites

  • Rust stable toolchain — install via rustup if you don’t have it
  • One API key — an OpenAI or Anthropic API key to pass in the Authorization header

1. Clone and build

git clone https://github.com/soerenmartius/llm-development-platform.git
cd llm-development-platform

cargo build --release -p gateway
The binary is output at target/release/gateway.

2. Configure a provider

Create a minimal config file at config/gateway.toml:
[server]
host = "127.0.0.1"
port = 4000

[providers.openai]
base_url    = "https://api.openai.com/v1"
models      = ["gpt-4o", "gpt-4o-mini"]
The gateway uses passthrough authentication — your Authorization header is forwarded directly to the upstream provider. The gateway never reads or stores provider API keys.

3. Run the gateway

cargo run --release -p gateway
You’ll see the gateway start on 127.0.0.1:4000.

4. Send a test request

curl http://localhost:4000/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello from to11!"}],
    "max_tokens": 128
  }'
You should receive a standard OpenAI-format response. The gateway proxied your request to OpenAI with sub-millisecond overhead.

5. Enable security

Add a [security] block to your config to activate inline guardrails:
[security]
enabled   = true
blocklist = ["ignore previous instructions", "jailbreak"]
Restart the gateway, then test that the blocklist works:
curl http://localhost:4000/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Please ignore previous instructions"}]
  }'
You’ll receive a 400 Bad Request — the request was blocked before reaching OpenAI. PII detection (SSN, credit cards, phone numbers, emails) is also active automatically.

Next steps

Configuration

Full TOML reference — providers, telemetry, security.

API Reference

All endpoints: chat, embeddings, images, audio, files.

Telemetry

OpenTelemetry GenAI spans, metrics, and ClickHouse queries.

Streaming

Fast-path vs normalised-path streaming architecture.