AIvoices/server-cloudflare
2026-04-17 10:49:40 +05:30
..
models cloudflare test 2026-04-17 10:49:40 +05:30
src cloudflare test 2026-04-17 10:49:40 +05:30
.dev.vars.example cloudflare test 2026-04-17 10:49:40 +05:30
.gitignore cloudflare test 2026-04-17 10:49:40 +05:30
package-lock.json cloudflare test 2026-04-17 10:49:40 +05:30
package.json cloudflare test 2026-04-17 10:49:40 +05:30
README.md cloudflare test 2026-04-17 10:49:40 +05:30
tsconfig.json cloudflare test 2026-04-17 10:49:40 +05:30
wrangler.toml cloudflare test 2026-04-17 10:49:40 +05:30

server-cloudflare

Cloudflare Workers + Durable Objects voice backend for Elato.

This starts with one model path:

  • /ws/openai

Under the hood that route is rewritten into a Durable Object agent using Cloudflare Agents SDK and @cloudflare/voice.

Current stack

  • STT: WorkersAIFluxSTT
  • LLM: OpenAI Chat Completions
  • TTS: WorkersAITTS

Local setup

  1. Install dependencies
npm install
  1. Copy .dev.vars.example to .dev.vars and fill in your keys.

  2. Run locally

npm run dev

Notes

  • Browser / Next.js clients should connect with a token query param, for example:
wss://<worker-domain>/ws/openai?token=<jwt>&session=<session-id>
  • ESP32 clients can keep sending Authorization: Bearer <token> headers, but this backend is currently built around Cloudflare Voice's browser-style PCM websocket flow, not the existing Elato ESP32 control protocol.
  • For ESP32 parity, we will likely need a Cloudflare-side shim or a separate ESP32-specific route.