Logo: Deploy

Deploy

OrganisatiounBeléift
GetStream
deploy

Ship acceleration/cmd/router to Stream's hosted environments. Read before deploying the router or asking why the hosted one behaves differently.

Iwwersiicht

EditeurGetStream
RepositoryAgents
Skill-Nummdeploy
Stären
8.2K
Forks
709
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    GetStream huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Deploy an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/GetStream/Agents/tree/main/.claude/skills/deploy
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GetStream/Agents.git /tmp/Agents
mkdir -p .claude/skills
cp -r /tmp/Agents/.claude/skills/deploy .claude/skills/deploy
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Deploy an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Deploy automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Deploy net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Deploy the router

The hosted router behind accelerate-<region>.gcp.stream-io-api.com (production) and accelerate-staging.gcp.stream-io-api.com is acceleration/cmd/router built from this repo. The deploy lives in Stream's private infra repo (GetStream/chat): infra/docs/accelerate_launch.md is the runbook, infra/charts/accelerate/README.md the chart, and the CLI, cluster names and credentials are all there. This repo is public — name the runbook, not the infrastructure.

Kubernetes owns the image, a version registry owns the binary: a pod fetches router-linux-<arch> at start, so shipping a router is publishing a binary, moving that pointer and restarting. Not an image build, not a chart deploy.

Build

The router is cgo (opus, opusfile, soxr), so each architecture builds on its own architecture, and both must be published or the deploy rejects the version. Tag the commit accelerate-vX.Y.Z here and push the tag. The private repo's build workflow builds from that tag, but it publishes to an S3 release bucket, not to the bucket pods fetch from; a release reaches pods by building it by hand, then rocky launch upload once per architecture and rocky launch deploy, which moves the pointer and restarts the pods (runbook step 8).

By hand, one container per architecture, from the repo root:

bash
VERSION=vX.Y.Z
mkdir -p /tmp/router-release
docker run --rm --platform linux/arm64 \
  -v "$PWD":/src:ro -v "$(go env GOMODCACHE)":/go/pkg/mod -v /tmp/router-release:/out \
  -e GOWORK=off -e GOPROXY=off -e GOTOOLCHAIN=local -e VERSION="$VERSION" \
  -w /src/acceleration golang:1.27-bookworm bash -c '
    apt-get -qq update && apt-get -qq install -y --no-install-recommends \
      pkg-config libopus-dev libopusfile-dev libsoxr-dev >/dev/null
    CGO_ENABLED=1 go build -trimpath -ldflags="-s -w -X main.release=$VERSION" \
      -o /out/router-linux-arm64 ./cmd/router'

GOWORK=off because go.work otherwise puts the module in workspace mode, which the build refuses; GOPROXY=off builds from the host module cache, so the container uses exactly the modules the host resolved. main.release is the version Sentry files events under, as the workflow sets it. Repeat with --platform linux/amd64, which works under emulation.

GOPROXY=off also means a module the host has not downloaded fails the build: after a go.mod change, run go mod download in acceleration/ on the host first.

Versions are vX.Y.Z or vX.Y.Z-<prerelease>, an unreleased build is named after its commit (v0.6.9-dev-<short sha>), and a published one is immutable. The build is reproducible, so the checksum a pod reports traces back to a commit.

Overlap deploys (staging and the benchmark release)

Staging and the benchmark release (perfbench -target benchmark, nobody else's traffic) ship a router without dropping a call. The runbook is infra/docs/accelerate_overlap_deploy.md in the private repo; rocky fastdeploy --service accelerate-staging (or accelerate-benchmark) builds this checkout and swaps it in, in 11-20 s warm.

  • It needs source ~/.config/rocky/gcp.env, Docker, Go and gcloud, and an arm64 machine: the build runs natively and these releases' pods run arm64 only. It builds the working tree, uncommitted changes included, so the clean-tree rule below is for tagged releases.

  • --status prints what each pod runs. The fetch initContainer's log only says what a pod started on, which a swap has since replaced.

  • On staging a fastdeploy and a tagged release move the same pointer, and a restarted pod comes back on whichever was last. Pull before a fastdeploy, or it rolls back a teammate's release. Load-test on benchmark, not staging.

  • A supervisor (devrun) owns the public socket and hands it to each router as fd 3 (listen_fd), with a peer port of its own (node.listen). A swap starts the new router on the same socket, waits for /health, then SIGTERMs the old one.

  • The old router stops accepting, keeps every call until it ends, bounded by shutdown.drain (1 h), still answering its peers, then exits. A second signal ends its calls now. At most three generations run at once.

  • A draining router exits on session.Manager.Len() reaching zero, which counts a session until its Close returns. Anything new that holds a call open must be counted there, or the old router exits under it.

  • A call only ends when the client's close reaches the router. A client that stops reading its session socket, or closes the connection straight after close, leaves the session running and holds the old router for the whole drain. Pipeline.Leave in the Go SDK waits for the router to hang up.

  • To check a deploy, run perfbench against the benchmark release during the swap and confirm every call held, nothing answered 5xx, and devrun logged pid N (sha) drained in ..., exit 0 for each old router once its last call ended.

Sandbox proxy

Staging and every prod shard run the router with broker: proxy: code in a sandbox reaches a connector's API through the router's egress proxy (acceleration/internal/sandbox/egress/AGENTS.md), not through Daytona Secrets.

WhereOn sinceGetStream/chat PR
stagingAI-2035
prod us-east4AI-2461#20044
prod us-west1, europe-west4AI-2464#20103

AI-2462 proved it live on prod us-east4: run_code GET api.github.com/user through the proxy answered 200, and the token never reached the sandbox.

  • The values are in GetStream/chat on master. Staging's file is infra/shards/us-east1-acceleration/accelerate-staging.yaml. Each prod shard has its own file, infra/shards/<region>-acceleration/accelerate-prod.yaml.
  • router.sandboxProxy holds enabled, broker: proxy, the public URL (it holds the proxy port) and the LoadBalancer's reserved address. The accelerate chart (infra/charts/accelerate, same repo) renders the Service from them.
  • router.overlapDeploy.holdSandboxProxy: true makes devrun hold the proxy port :8091. router.overlapDeploy.devrunImage pins the devrun that can hold it (chat #19840).
  • The CA certificate and key are two secrets, ROUTER_CODE_SANDBOX_PROXY_CA_CERT and ROUTER_CODE_SANDBOX_PROXY_CA_KEY. They reach the pods through accelerate-secrets, which is synced from Secret Manager. Staging has its own CA. Each prod shard has its own P-256 CA (AI-2460). The comment above sandboxProxy in each values file names the CA's expiry.
  • Rotate each CA before it expires. Staging: the steps are in Linear AI-2069. Prod: AI-2663 (us-east4), AI-2664 (us-west1) and AI-2665 (europe-west4), each due 2027-10-02.
  • This repo is public. Read addresses and secret paths in the values file, and do not copy them here.

Verify after an apply, on each shard (AI-2461, AI-2464):

  1. The rollout finishes, and each router logs serving the sandbox egress proxy with tls=true.
  2. TLS verifies against that shard's CA: openssl s_client -connect <address>:8091 -CAfile <shard CA cert> -verify_ip <address> -verify_return_error prints Verification: OK.
  3. A CONNECT without a credential gets 407 Proxy Authentication Required.
  4. One run_code GET api.github.com/user through a binding with sandbox: true answers 200.

Every prod region has a public hostname, https://accelerate-<region>.gcp.stream-io-api.com: all three are behind the global load balancer (accelerate_prod_regions in infra/dns/gcp-stream-io-api-com/accelerate_global_lb.tf). To test a region, call its hostname as the app. Prod runs authMode: proxy with proxyDeclaresKind: true, so send X-Stream-App-Id: <app> and Stream-Auth-Type: server (acceleration/internal/auth/auth.go, proxied.Authenticate). Also send X-Stream-Api-Key-Id: <the app's public key> (APIKeyIDHeader, auth.go:112-118) and X-Stream-Actor-Name: <your name>. Without the key header, the router records the run's usage with no API key and raises the unattributed usage alert. This happened on prod us-west1 and europe-west4 on 2026-11-03 21:28Z (AI-2464 E2E). The sandbox still reaches the shard's proxy on its public address.

Datadog (AI-2463, chat #20097, infra/shards/us-east4-acceleration/datadog/sandbox_egress.tf):

  • The dashboard "Accelerate sandbox egress proxy" shows the proxy's requests per cluster, decision and host.
  • The monitor sandbox_egress_5xx fires on 3 or more 5xx in 30 minutes in accelerate-prod, all clusters together. A refused Upgrade (denied_request, 501) does not count. It notifies @oncall-agents and pages nobody.
  • Datadog scrapes the router in us-west1 and europe-west4 since #20103 (monitoring.datadog.enabled).

To turn the proxy off on one shard:

  1. In that shard's values file, set router.overlapDeploy.holdSandboxProxy: false and router.sandboxProxy.enabled: false.
  2. Run rocky accelerate up --region <region>-acceleration --env prod.
  3. Wait for the rollout to finish. An edit alone changes nothing.

With the proxy off, prod refuses a session that binds a sandbox again. The steps come from the AI-2461 and AI-2464 apply plan. The chart renders the hold only while sandboxProxy.enabled is on.

Production

Production is three shards, us-east4, us-west1 and europe-west4. Each region has its own hostname, accelerate-<region>.gcp.stream-io-api.com, that reaches only that shard. All three are published (local.accelerate_prod_regions); us-east4's is the SDKs' default (DefaultURL, sdks/go/stream/backend.go:57). Any shard serves any app. Each runs the router with its own Postgres and Redis beside the global ones in us-east4 (acceleration/README.md, "Shards"). The runbook is infra/docs/accelerate_shards_rollout.md in the private repo.

A release is a tagged build, published once, then deployed per shard:

  • rocky launch upload both architectures once; the binary is shared by every shard.
  • rocky launch deploy --shard <cluster> --env prod per shard. The registry lock is global, so the three pointer moves run one after another; the restarts they trigger run in parallel. Run it from inside the private repo, or set ROCKY_DIR to that repo's infra/ directory (a checkout of its master branch). Without either, it stops with "could not locate infra/ directory" before it takes the lock, so nothing moves.
  • Migrate every shard before any launch deploy of the release (AI-3286): rocky accelerate migrate --env prod --version <v>. It runs the release's router migrate as a Job in each prod cluster in turn (the chart's templates/migrate-job.yaml), with that shard's settings: its shard and shards too, since shard picks the range its log ids are drawn from. A failed Job runs once more (a trigger re-attach that misses its 3 s lock), then it stops, before any pointer has moved. A rerun waits on a Job of the same release that is still running rather than killing it mid-index; one of another release needs --force. Only then deploy the shards, in any order. Staging runs the same step before its own deploys, rocky accelerate migrate --env staging --version <v>: since AI-3695 it is two clusters too, us-east1-acceleration and europe-west4-acceleration. Without it, each shard's database was migrated only when that shard's first new router started, so new routers met databases a column or table short for the length of the rollout (accelerate-v0.6.346 and v0.6.354, 2026-11-16). Releases before accelerate-v0.6.384 have no router migrate: for a rollback to one, deploy the shards that serve no traffic first. Such a router migrates on start, so on a shard that sets postgres.migrate_dsn it also needs the owner back in postgres.dsn (acceleration/README.md, «A serving role that owns no table»).
  • Routers still migrate on start and take an advisory lock, so after the step above a start finds nothing to do. A deployment that sets postgres.migrate_dsn never migrates on start, and its routers refuse to start until router migrate has run (acceleration/README.md, «A serving role that owns no table»). A migration has to be right for both databases: the global tables and the shard tables share one migration set.
  • Prod runs with the overlap deploy on, so a restarted pod drains its calls (up to 1 h), but rocky fastdeploy does not reach the prod clusters yet: deploy with launch deploy.

The key encryption key

A hosted router unwraps its key encryption key with Cloud KMS at startup: ROUTER_AUTH_KMS_KEY and ROUTER_AUTH_KEK_V<n>_WRAPPED. The steps (IAM role, the gcloud kms encrypt line, the two variables) are in acceleration/README.md, «The key encryption key in Cloud KMS». The router refuses to start with a plain ROUTER_AUTH_KEK or ROUTER_AUTH_KEK_V<n> in its environment, and ROUTER_DEV_KEK (laptops and CI) beside a KMS setting. So a deployment that still holds a plain key switches its values on the build it runs (set the two variables, remove the plain ones, restart) before it takes a build that refuses them. Keep a copy of the plain key outside the deployment, and check that the pods start and open an existing connection. To roll back a new wrapped value, set ROUTER_AUTH_KEK_V1_WRAPPED back to the previous one and restart.

Before and after

  • Commit and push first, and build from a clean tree: the version has to name a commit somebody else can check out.

  • Values and router are one deployment. Rolling the auth work also meant moving ROUTER_AUTH_MODE to proxy, because noauth had changed meaning underneath it. Render the chart, diff it against the live release, explain every line.

  • Migrations run in rocky accelerate migrate before the deploy (prod and staging), and again on start, or only in router migrate where postgres.migrate_dsn is set. Routers of the release before keep serving on the new schema until their shard is deployed, so additive is fine; anything else wants a plan first.

  • Never roll back below accelerate-v0.6.135, the first tag with f38926d2 (#1182): an older router ignores require_approval on connector bindings, so their write tools run without the person's approval. This floor holds in every environment.

  • Staging and every prod shard have a second, higher floor: never roll back below accelerate-v0.6.191 (#1433). Since 2026-10-29 staging devrun holds the sandbox proxy port :8091 and passes it to the router as fd 4 (router.overlapDeploy.holdSandboxProxy, GetStream/chat #19810, #19840). Prod devrun does the same since AI-2461 (us-east4) and AI-2464 (us-west1, europe-west4). A router older than v0.6.191 ignores that socket and retries :8091 until it exits: the API serves, the sandbox proxy does not. To go below it on one shard, in this order:

    1. Set router.overlapDeploy.holdSandboxProxy: false in that shard's values file.
    2. Run rocky accelerate up --region us-east1-acceleration --env staging, or on prod rocky accelerate up --region <region>-acceleration --env prod.
    3. Wait for the rollout.
    4. Roll back.

    The steps are in GetStream/chat infra/docs/accelerate_overlap_deploy.md, paragraph "Revert" under "The sandbox proxy socket". If the only target is older than v0.6.135, stop and ask. A router older than v0.6.191 already stuck behind devrun's socket needs only steps 1 to 3 (set false, rocky accelerate up, wait); the new pods start without it.

  • The version is deliberately not in the pod spec. The fetch initContainer's log says which binary a pod started on; after a fastdeploy, ask --status instead.

  • A model with no key in that environment drops to the next candidate, and when a strict term like diarize leaves none the STT socket just closes on the caller. Check the key before reading that as a bug.

  • Verify from outside: examples/routers/stt_realtime_example -hosted streams a file through the hosted router and prints which model answered.

Heefeg gestallte Froen

Wat mécht de KI-Skill Deploy?

Ship acceleration/cmd/router to Stream's hosted environments. Read before deploying the router or asking why the hosted one behaves differently.

Firwat Deploy op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Deploy besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Deploy an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/GetStream/Agents/tree/main/.claude/skills/deploy an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Deploy benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Deploy benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Deploy domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Deploy gratis?

Jo. GetStream huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇