Real-time voice calls with an AI that listens.
A self-hostable stack for talking to AI over WebRTC. Pion handles media in Go, FastAPI orchestrates, and Gemini Live answers, with natural turn-taking and barge-in.
$ docker compose up -d --build
// features
Everything a voice agent needs, nothing it doesn't.
Small, readable services you can fork and swap out piece by piece.
Low latency
Opus over WebRTC with 20ms frames, paced in real time by the Pion SFU.
Natural turn-taking
Server-side voice activity detection. Interrupt the AI mid-sentence and it stops.
Echo mode
No API key yet? The pipeline echoes your voice so you can test the full media path.
Self-hosted
One docker compose command runs the whole stack on your machine.
gRPC contract
A small protobuf interface between media and AI. Swap either side freely.
Model agnostic
Ships with Gemini Live. The AI client is four small methods, so you can bring your own.
// architecture
How a call flows
Media stays in Go, intelligence stays in Python. They talk over bidirectional gRPC streams.
Browser
Captures the mic and plays AI audio over a WebRTC peer connection.
Pion SFU
Decodes Opus, resamples 48k to 16k and back, paces playback.
FastAPI
WebSocket signaling and the audio pipeline between SFU and model.
Gemini Live
Streams speech in and speech out, with built-in barge-in.
// quick start
Running locally in three steps
- Clone the repoRequires Docker with Compose v2.
- Add your keyLeave it blank to try echo mode first.
- Start and callOpen localhost:3000 and press Start call.
$ git clone https://github.com/AnjalLLL/parley $ cd parley $ cp .env.example .env # set GEMINI_API_KEY=... (or leave empty for echo mode) $ docker compose up -d --build # open http://localhost:3000