Docs Deploy

Deploying t10

What runs, what every environment shares, and how to start it with Docker Compose or Kubernetes.

This is the overall deployment guide: what runs, what every environment shares, and how to start it with Docker Compose or Kubernetes.

  • This directory owns what's shared, such as the namespace, and the overall Kubernetes entry point.
  • Each component owns its own deployment files, in its own repo.
Docker Compose Kubernetes
Use it for Working on one machine Testing the real topology, and production
Entry point One compose.yml per repo, started in order kubectl apply -k deploy/k8s/overlays/<environment>
Instructions Below k8s/README.md
Text traffic Straight to agent-pi, or through ai-gateway-agent Always through ai-gateway-agent
Postgres One container per repo In-cluster locally, managed in production
Replicas One of each Several, except agent-pi locally and ai-gateway-llm

Both publish ports 8081, 8083, 8890, 8891 and 8892, so run one at a time on a machine. See Switching.

What runs#

Component Role Port State
auth-server Users, tenants, tokens, room admission 8081 Postgres
agent-pi The agent and its conversations 9800 SQLite on a volume, one per replica
agent-ti Ti Assistant, a selectable text agent on the Rust runtime 18120 SQLite on its own volume, one replica
ai-gateway-agent Routes clients to the right agent-pi replica 7201 None
ai-gateway-llm The only path to model providers, with quotas 7200 Quota counts in memory
LiveKit server WebRTC audio and data 8890 signalling, 8891 TCP media, 8892 UDP media Rooms in memory
t10-livekit-agent Voice workers: speech to text, agent, text to speech None Room claims in Redis when scaled
workbench (optional) Web client 8083 Postgres
t10-collab (optional) Business module: tasks and offers 8082 Postgres

t10-mac-client and the phone builds of flutter/ are clients and don't get deployed. The web build of flutter/ runs as t10-mobile-web. Start the components in the order above, because auth-server must be up before anything that verifies its tokens. See ARCHITECTURE.md for how they fit together.

Who owns what#

deploy/                                 Shared by the whole platform
  README.md                             This guide
  k8s/
    README.md                           Kubernetes instructions
    base/
      namespace.yaml                    The t10 namespace and its security level
      kustomization.yaml                The platform: lists each component below
    overlays/local/
      kustomization.yaml                What differs on one machine
      local-infra.yaml                  In-cluster Postgres, Redis and LiveKit
    overlays/platform/
      kustomization.yaml                A public platform: https URLs, no ports published
    modules-ingress.yaml                Optional public routes to business modules
  edge/                                 One https host per service: public VM and internal Caddy

<component>/                            Owned by that component
  compose.yml                    Its Compose stack
  .env.example                          Its settings
  deploy/k8s/                           Its manifests and kustomization.yaml
Change this Here
A component's image, env defaults, probes, resources or Service That component's deploy/k8s/ and compose.yml
The namespace or its security level deploy/k8s/base/namespace.yaml
Which components the platform runs deploy/k8s/base/kustomization.yaml
Hosts, issuer, replica counts and exposure for one environment deploy/k8s/overlays/<environment>/

Common settings#

Namespace#

Every workload runs in t10. The namespace enforces the restricted Pod Security Standard, so a pod must run as non-root, drop all capabilities and set a seccomp profile, or Kubernetes refuses it.

Values that must match across components#

Value Set on Local value Rule
Token issuer auth-server AUTH_PUBLIC_URL, agent-pi JWT_ISSUER, ai-gateway-agent and t10-collab AUTH_ISSUER http://localhost:8081 The same string everywhere. It's compared, not fetched, so containers can reach auth-server at another address through AUTH_URL
LiveKit URL auth-server and workbench LIVEKIT_URL ws://localhost:8890 The address a client uses. auth-server hands it out at room admission, and workbench allows it in its content security policy
LiveKit node IP LiveKit --node-ip 127.0.0.1 The address clients send media to. See Clients on other devices
LiveKit keys LiveKit, auth-server, t10-livekit-agent Dev keys The same key and secret on all three
Replica names AGENT_URLS on ai-gateway-agent and t10-livekit-agent assistant.agent-1 (Compose), assistant.agent-pi-0 (Kubernetes) <agent>.<AGENT_INSTANCE_ID>, with one entry per replica of every agent. A wrong name fails with no replica serves that session
Workbench AGENT_URLS workbench assistant=<url> No replica name, because the URL is the gateway. Compose points it straight at agent-pi by default
Service secrets auth-server setup and each service's AUTH_CLIENT_SECRET Dev defaults Each service has its own. See the table below
Workbench callback auth-server/clients.yaml and WORKBENCH_PUBLIC_URL http://127.0.0.1:8083 Matched exactly, so use 127.0.0.1 rather than localhost in the browser
Route source ai-gateway-agent and t10-livekit-agent: one of AGENT_CONTROL_URL, AGENT_ROUTES_FILE or AGENT_URLS AGENT_URLS in Compose. AGENT_CONTROL_URL on the local cluster AGENT_CONTROL_URL to change routes with no deploy. Sources don't fall through to each other
Default agent ai-gateway-agent AGENT_DEFAULT assistant The agent that takes a call with no Agent-Name. With several agents and no default, such a call answers 400, and no client sends that header yet
Tenant API key ai-gateway-llm GATEWAY_DEFAULT_API_KEY, agent-pi LLM_API_KEY, ai-gateway-agent AI_GATEWAY_LLM_API_KEY Your choice The same key on all three when agent-pi calls models through the gateway

Service secrets#

auth-server needs each service's secret when it creates the account, and the service presents the same secret when it starts.

Service Compose variable on auth-server Kubernetes key in auth-server-setup Service's own setting
t10-livekit-agent AUTH_LIVEKIT_AGENT_SECRET LIVEKIT_AGENT_SECRET AUTH_CLIENT_SECRET
agent-pi AUTH_AGENT_PI_SECRET AGENT_PI_SECRET AUTH_CLIENT_SECRET
t10-collab AUTH_T10_COLLAB_SECRET T10_COLLAB_SECRET AUTH_CLIENT_SECRET
ai-gateway-agent Not created by Compose AI_GATEWAY_SECRET AI_GATEWAY_CLIENT_SECRET
t10-automations Not created by Compose T10_AUTOMATIONS_SECRET Proposed service, not built yet

workbench and t10-console are clients rather than services. Their secrets' hashes are in auth-server/clients.yaml.

t10-automations is marked optional in clients.yaml, so auth-server starts without its account. Set its secret only where it runs.

ai-gateway-agent needs its account to accept delegated tokens, which voice workers send straight to agent-pi, and to read routes from t10-agent-control. Compose does neither, so it works without one.

Docker Compose#

This is for local development: dev mode, dev secrets and no TLS.

Before the first start#

Each repo reads its own .env, except t10-collab, which needs none.

agent-pi/.env. Copy .env.example, then replace its AUTH_KIND=static with:

AUTH_KIND=jwt
JWT_ALGORITHMS=ES256
JWT_JWKS_URL=http://host.docker.internal:8081/.well-known/jwks.json
JWT_ISSUER=http://localhost:8081
JWT_AUDIENCE=t10,agent-pi
JWT_REQUIRED_SCOPES=agent:use
JWT_TENANT_CLAIM=tid
AUTH_URL=http://host.docker.internal:8081
AUTH_CLIENT_ID=agent-pi
AUTH_CLIENT_SECRET=dev-only-agent-pi-service-secret-change-me

Then choose how it reaches a model. Directly is simpler. Through the gateway matches Kubernetes.

# Directly
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_API_KEY=<your provider key>
FAST_MODEL_ID=qwen-flash
SMART_MODEL_ID=qwen-flash

# Or through ai-gateway-llm. Model IDs must exist in ai-gateway/config.llm.yaml.
LLM_BASE_URL=http://host.docker.internal:7200/v1
LLM_API_KEY=<GATEWAY_DEFAULT_API_KEY>
FAST_MODEL_ID=qwen3.5-flash
SMART_MODEL_ID=qwen3.5-flash

t10-livekit-agent/.env. Copy .env.example, then set:

DASHSCOPE_API_KEY=<your provider key>
LLM_PROVIDER=agent_pi

The dev secret is the default, and LiveKit's keys come from here. Set LIVEKIT_API_KEY and LIVEKIT_API_SECRET to the same values in auth-server/.env.

workbench/.env. Generate the session key:

echo "WORKBENCH_SESSION_KEY=$(openssl rand -base64 32)" >> workbench/.env

ai-gateway/.env. Needed only when you run the gateway. Copy .env.example, then set the provider keys, GATEWAY_DEFAULT_API_KEY and AI_GATEWAY_LLM_API_KEY.

Start#

From the workspace root:

for repo in auth-server agent-pi t10-collab workbench t10-livekit-agent; do
  (cd "$repo" && docker compose up -d --build --wait)
done

auth-server creates its first user and service accounts in a one-shot seed service, which then exits. That's expected.

To send text through the gateway, start it too, and point workbench at it:

(cd ai-gateway && docker compose up -d --build --wait)
(cd workbench && AGENT_URLS=assistant=http://host.docker.internal:7201 docker compose up -d --wait)

On Linux, ai-gateway-llm must also listen beyond loopback for agent-pi to reach it: set AI_GATEWAY_LLM_BIND=0.0.0.0:7200, and keep that port off public networks.

To run several voice workers, see the redis service in t10-livekit-agent/compose.yml.

Tenants' own model keys. See t10-agent-control/docs/model-keys.md. Without these steps every tenant uses the gateway's configured keys, as before.

  1. Give ai-gateway-llm its account, so it reads the tenant from each run's token. Choose a secret, set it as AI_GATEWAY_LLM_CLIENT_SECRET in ai-gateway/.env and as AUTH_AI_GATEWAY_LLM_SECRET for auth-server's seed, and add ai-gateway-llm to GRANT_AUDIENCES in agent-pi/.env. LLM_IDENTITY_HEADERS stays gateway.
  2. Then either:
    • From a file (Standard). Copy ai-gateway/model-keys.example.yaml to ai-gateway/model-keys.yaml, set MODEL_KEYS_FILE_HOST=./model-keys.yaml in ai-gateway/.env, and put the secrets it names in ai-gateway/model-keys.env. The gateway reads the file again within 10 seconds of a change.
    • With the tenant screens (Full). Start t10-agent-control from its own Compose file, after auth-server, with MODEL_KEY and CONNECTOR_KEY generated into its .env. Choose a client key for it, set it as AGENT_CONTROL_GATEWAY_KEY in ai-gateway/.env and MODEL_GATEWAY_KEY in control's .env, and set AGENT_CONTROL_URL=http://host.docker.internal:8085 on the gateway. Tenant admins then find Administration → Model keys in workbench.
(cd t10-agent-control && cp .env.example .env && docker compose up -d --build --wait)
# To keep model keys in a dev Vault instead of control's database:
(cd t10-agent-control && docker compose --profile vault up -d --wait)

Use it#

What Where
Workbench http://127.0.0.1:8083, as ada@acme.example with change-me-enterprise-admin
Tenant administration Workbench's Administration page. http://localhost:8081/admin sends a tenant admin there
Grafana http://localhost:3002

Stop#

Run this in each repo, in the reverse order:

docker compose stop

A voice worker waits up to 11 minutes for calls to finish. docker compose down also removes the containers and keeps the data. down -v deletes the data too.

Rebuild after a change#

(cd <repo> && docker compose up -d --build --wait)

auth-server mounts clients.yaml, so a change there needs only docker compose restart auth-server.

Kubernetes#

Follow k8s/README.md. In short:

kubectl apply -f deploy/k8s/base/namespace.yaml
kubectl apply -f deploy/k8s/overlays/local/local-infra.yaml
# Create the databases and secrets, and run the auth-server setup Job.
kubectl apply -k deploy/k8s/overlays/local

Switching between Compose and Kubernetes#

They use the same host ports, so a stack started second fails with a port already in use. They share no data, so users and conversations don't move across.

Some images are shared too. agent-pi:latest, t10-livekit-agent:latest and ai-gateway:latest are the same tags in both, so a Compose rebuild changes what a restarted pod runs.

Component Compose image Kubernetes image
auth-server auth-server-auth-server auth-server:latest
workbench workbench-workbench workbench:latest
t10-collab t10-collab-t10-collab t10-collab:latest

To free the ports from Compose, stop it as above. To free them from Kubernetes, delete its LoadBalancer Services, and kubectl apply -k restores them:

kubectl -n t10 delete svc auth-server workbench livekit

Clients on other devices#

A phone or another computer needs two things: a URL it can reach, and an address to send media to. With localhost and --node-ip 127.0.0.1, signalling connects and audio doesn't, and the client reports could not connect after timeout.

Both must be this machine's LAN address, which also works for clients on this machine. The local Kubernetes overlay does this, as k8s/README.md explains. In Compose:

  1. Change --node-ip=127.0.0.1 in t10-livekit-agent/compose.yml to the LAN address.
  2. Set LIVEKIT_URL=ws://<LAN address>:8890 when starting auth-server and workbench.

Open TCP 8890 and 8891 and UDP 8892 on any firewall. Browsers can fall back to TCP 8891. t10-mac-client and testclient use pion, which has no ICE over TCP, so they need UDP 8892.

All of this uses dev keys without TLS, so keep it on a trusted network. A public deployment needs real keys, wss:// and TURN. edge/ sets up the https hosts, with LiveKit on the public machine.

Check that it works#

Start with health, using /readyz on auth-server, workbench and t10-collab.

curl -s -o /dev/null -w '%{http_code}\n' localhost:8081/readyz
curl -s -o /dev/null -w '%{http_code}\n' 127.0.0.1:8083/readyz

Then make a real call. testclient sends a WAV file as the microphone and saves the agent's reply. On macOS, you can make the WAV with say.

say -o /tmp/hi.aiff "What is two plus two?"
afconvert -f WAVE -d LEI16@48000 -c 1 /tmp/hi.aiff /tmp/hi.wav

cd t10-livekit-agent
TESTCLIENT_USERNAME=ada@acme.example TESTCLIENT_PASSWORD=change-me-enterprise-admin \
  LIVEKIT_URL=ws://localhost:8890 AUTH_URL=http://localhost:8081 \
  go run ./cmd/testclient live -room check -file /tmp/hi.wav -out /tmp/reply.wav -final-wait 10

A working stack prints [heard] with your words, then the reply. On the local Kubernetes cluster, use sample-member with t10-sample-password.

Troubleshooting#

Symptom Cause
no replica serves that session The AGENT_URLS name doesn't match AGENT_INSTANCE_ID
could not connect after timeout from a client LiveKit is advertising an address the client can't reach. Check --node-ip, then UDP 8892
the agent did not join No voice worker claimed the room. Check the worker's logs, and Redis when REDIS_URL is set
401 with grant_not_live The grant was revoked or expired. This can take up to 60 seconds to apply
401 from the gateway with a token agent-pi accepts A delegated token. Voice workers send these straight to agent-pi, not through the gateway
auth-server won't start A runtime in clients.yaml has no service account. Run setup again
Workbench sign-in fails with a redirect error Use http://127.0.0.1:8083, or add your address to clients.yaml
Calls fail in the browser only LIVEKIT_URL on workbench doesn't match the URL from admission, so its content security policy blocks it
A pod is refused by the namespace It doesn't meet the restricted Pod Security Standard

Generated from t10’s own docs (bbc3cde). Spotted a problem? Tell us.