Skip to content

Configuration Reference

The bridge is configured entirely from environment variables. The package ships a fully commented .env.example. Only two variables are required.

EnvMeaning
WORKER_SHARED_SECRETThe shared secret from StandIn pairing. Must equal what StandIn holds, or the HMAC upgrade is rejected with 401.
DEEPGRAM_API_KEYServer-side Deepgram key. Opens Voice Agent sessions and calls Aura TTS. Never sent to the Teams side.

There is no dashboard - these variables define the agent:

EnvDefaultMeaning
DEEPGRAM_LISTEN_MODELnova-3STT model for agent.listen (e.g. nova-3, flux-general-en).
DEEPGRAM_THINK_PROVIDERopen_aiLLM provider for agent.think (open_ai, anthropic, google, groq, aws_bedrock, …).
DEEPGRAM_THINK_MODELgpt-4o-miniLLM model for agent.think.
DEEPGRAM_THINK_ENDPOINT_URLunsetBYO-LLM endpoint - required by Deepgram for third-party think providers (google, groq, aws_bedrock); Deepgram-managed open_ai/anthropic work without it. Must be https; Deepgram dials it itself.
DEEPGRAM_THINK_ENDPOINT_HEADERSunsetHeaders for the think endpoint, as a JSON object (e.g. {"authorization":"Bearer ..."}).
DEEPGRAM_SPEAK_MODELaura-2-thalia-enAura voice for agent.speak.
DEEPGRAM_LANGUAGEenAgent language (set on the listen and speak providers).
DEEPGRAM_PROMPTa built-in defaultBase agent prompt. The bridge appends per-call caller context (name, tenant, direction) and live context notes.
DEEPGRAM_GREETINGunsetDeterministic opening line the agent speaks first (also the natural place for a spoken AI disclosure).
DEEPGRAM_TTS_MODELunsetEnables the deterministic governor goodbye via the standalone Aura TTS endpoint (exact text, agent muted, real duration). Without it, the goodbye is spoken verbatim by the live agent via InjectAgentMessage.
DEEPGRAM_AGENT_HOSTagent.deepgram.comVoice Agent WebSocket host. Regional pins: api.eu.deepgram.com, api.au.deepgram.com. Restricted to *.deepgram.com.
DEEPGRAM_API_HOSTapi.deepgram.comREST host (goodbye TTS). Same regional pins and allowlist.
DEEPGRAM_HOST_ALLOW_ANYunsetSet to true only to point the hosts at a deliberate trusted proxy/test host.
EnvDefaultMeaning
MAX_CALL_MINUTES0 (off)Bridge-side hard cap per call, in minutes (fractional allowed). Deepgram knows nothing about your budget - enforce limits here.
GOODBYE_TEXTa default lineThe goodbye the bridge-side governor speaks.
GOODBYE_GRACE_MS8000How long to let the goodbye play out before ending the call when its duration is unknown (agent-spoken fallback). Always hard-bounded.

The Voice Agent API is audio-only, so the bridge answers look itself - and only via your endpoint:

EnvDefaultMeaning
VISION_API_URLunsetAny OpenAI-compatible chat-completions endpoint with image input. The raw frame is sent to this endpoint (never to Deepgram) - run a local model (Ollama/vLLM) if frames must not leave your infrastructure. Without it, look reports vision unavailable. Validated at startup.
VISION_API_KEYunsetBearer key for the vision endpoint (local endpoints may not need one).
VISION_MODELunsetVision model name (required when VISION_API_URL is set).
VISION_REQUIRES_RECORDINGfalseCompliance gate: when true, the bridge refuses to send caller video frames to the vision endpoint unless Teams recording is active.
EnvDefaultMeaning
PORT8080TCP port the bridge listens on.
BIND0.0.0.0Bind address.
TLS_CERT_PATH / TLS_KEY_PATHunsetPEM cert/key for native TLS (wss://). Without both, the bridge serves plain WS and MUST be fronted by a TLS terminator.
HMAC_FRESHNESS_MS60000Allowed clock skew for the HMAC timestamp.
MAX_CONNECTIONS0 (= 64)Max concurrent connections.
MAX_CONNECTIONS_PER_IP0 (= MAX_CONNECTIONS)Per-IP cap. Defaults to the total cap (effectively off) because StandIn dials from a small set of IPs; set explicitly (with TRUST_PROXY_XFF=true behind a proxy you control) for a real limit.
TRUST_PROXY_XFFfalseKey the per-IP cap on the first X-Forwarded-For hop. Only behind a proxy you control.
PRE_START_TIMEOUT_MS0 (= 10000)Drop a connection that authenticates but never sends session.start.
WORKER_IDLE_TIMEOUT_MS0 (= 90000)Dead-peer window: end the call after this long without any worker message (the worker heartbeats every 30 s). Frees the call id for reconnect and closes the billed agent session.
LOG_TRANSCRIPTSfalseLog transcripts (ConversationText; still gated on Teams recording.status == "active").
LOG_LEVELinfodebug | info | warn | error. An invalid value falls back to info.

The bridge also exposes GET /metrics (Prometheus text format, no auth): calls total/active, a call-duration histogram (bridge_call_duration_seconds, for p50/p95/p99) plus the cumulative seconds counter, upgrade rejections by cause, frames relayed each way, backpressure drops, and Deepgram connect failures. Like /healthz it is served on the same port - keep the port private to your network or scrape through your ingress.

Audio formats are not configurable: the wire is PCM 16 kHz by contract and the Voice Agent session is pinned to linear16 at 16 kHz both ways (the copy-only property).