Real-time bi-directional English ↔ Mandarin translation system powered by LiveKit and OpenAI.
YinLink is a voice AI translation system that acts as an invisible translator between English and Mandarin speakers. The agent follows the "Ghost Protocol" - functioning as a transparent logic layer with zero personality, translating speech in real-time without adding commentary or responding to commands.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ User A │────▶│ YinLink │────▶│ User B │
│ (English) │◀────│ Agent │◀────│ (Mandarin) │
└─────────────┘ └─────────────┘ └─────────────┘
│
┌──────┴──────┐
│ │
┌────▼────┐ ┌────▼────┐
│ OpenAI │ │ LiveKit │
│ API │ │ Cloud │
└─────────┘ └─────────┘
| File | Description |
|---|---|
agent.py |
LiveKit Agents worker with Ghost Protocol translation |
sip_dispatch.json |
SIP ingress configuration for telephony |
frontend/ |
Next.js mobile web app with real-time transcript |
- Python 3.9+
- Node.js 18+
- LiveKit Cloud account (or self-hosted LiveKit server)
- OpenAI API key
- SIP trunk provider (for telephony features)
# Backend
cd Nexthacks
pip install -r requirements.txt
# Frontend
cd frontend
npm installBackend (.env):
cp .env.example .envEdit .env:
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
OPENAI_API_KEY=sk-your-openai-api-key
SIP_OUTBOUND_TRUNK_ID=your_sip_trunk_idFrontend (frontend/.env.local):
cd frontend
cp .env.local.example .env.localEdit frontend/.env.local:
NEXT_PUBLIC_LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret- Go to your LiveKit Cloud dashboard
- Navigate to SIP → Trunks
- Create an inbound trunk and note the trunk ID
- Create an outbound trunk and note the trunk ID
- Update
SIP_OUTBOUND_TRUNK_IDin your.env
To apply the dispatch rules:
lk sip dispatch create sip_dispatch.jsonpython agent.py devThe agent will:
- Connect to LiveKit Cloud
- Wait for participants to join rooms with
call-prefix - Provide real-time translation between English and Mandarin
cd frontend
npm run devOpen http://localhost:3000 on your mobile device.
- Call whoever you want to call
- The call is routed to a LiveKit room
- The agent translates all speech automatically
./
├── agent.py # LiveKit agent with Ghost Protocol
├── sip_dispatch.json # SIP routing configuration
├── requirements.txt # Python dependencies
├── .env.example # Environment template
├── frontend/
│ ├── src/
│ │ ├── app/
│ │ │ ├── page.tsx # Main app page
│ │ │ ├── layout.tsx # App layout
│ │ │ ├── globals.css # Styles
│ │ │ └── api/token/route.ts # Token API
│ │ └── components/
│ │ ├── TranscriptPanel.tsx # Live transcript
│ │ └── ControlBar.tsx # Call controls
│ ├── package.json
│ └── .env.local.example
└── README.md
- LiveKit Agents: Voice pipeline framework
- GPT-4o-realtime: Translation LLM for live audio to audio translation
- Next.js: Frontend framework
- Tailwind CSS: Styling
Feel free to learn more about our project here:
https://devpost.com/software/yinlink?ref_content=user-portfolio&ref_feature=in_progress
MIT