[Plugin] livekit-plugins-sherpa: local TTS on sherpa-onnx (Kokoro, Kitten, Piper)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- ai-infra-agents
Línea de trabajo
The issue links a working implementation at mahimairaja/local-livekit under livekit-plugins/livekit-plugins-sherpa and reports 70 tests, including real-model speech and STT round trips through tts.StreamAdapter. Start by reading that implementation and its tests, then compare its package structure and API with the existing LiveKit agents plugins. Done means a sherpa-onnx TTS plugin supports the described models and streaming behavior; linked pull request #7749 indicates work is already underway.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feature Type
Would make my life easier
Feature Description
Every TTS plugin in livekit/agents calls a hosted API. The common local route, Kokoro behind an OpenAI-compatible server through openai.TTS, breaks streaming (#6184), and it needs a separate service.
Proposal: TTS in the same livekit-plugins-sherpa package (STT side: #7746), on sherpa-onnx. In process, ONNX Runtime only, no torch or GPU, no system espeak (the phonemizer data ships with each model).
sherpa.TTS, Kokoro v1.0 by default (82M, int8, 54 voices as typed names). Kokoro's English phonemes come from misaki's dictionaries, with espeak-ng for unknown words.voicetakes the model's own speaker names or a speaker id, so other sherpa-onnx voices work too. Built in: Kitten nano (about 15M, 8 voices) and Piper en_US amy.engine=takes anysherpa_onnx.OfflineTts(VITS, Matcha, newer Kokoro).streaming=False:AgentSessionwraps it intts.StreamAdapter. Each sentence's audio is pushed throughAudioEmitterchunk by chunk as sherpa-onnx produces it, and an interruption stops generation at the next chunk.- Models are pinned to Hugging Face commits and fetched by
download-files.
Tested on real models: Kokoro, Kitten nano and Piper amy each speak a sentence, and a local STT must transcribe it back (character error rate check), directly and through tts.StreamAdapter.
In a full local agent on an M-series Mac mini, CPU only: Kokoro's first audio arrives about 2.2 s into a 3.4 s voice-to-voice turn, so TTS is the largest share of latency.
Workarounds / Alternatives
openai.TTS(base_url=...)against a local Kokoro server: streaming breaks on the framing mismatch described in #6184, and it is an extra service.- A Kokoro-only plugin as asked in #6184 would fix one model; sherpa-onnx covers Kokoro, Kitten, Piper/VITS and Matcha with one dependency.
Additional Context
Working implementation, 70 tests, mypy strict: https://github.com/mahimairaja/local-livekit (livekit-plugins/livekit-plugins-sherpa)
Write-up with measurements: https://mahimai.ca/blog/local-livekit-voice-agent-offline
No word-level alignment (aligned_transcript=False): sherpa-onnx does not expose phoneme durations.
Happy to open a PR adding it with the STT.
- Lenguaje dominante
- Python
- Estrellas
- 14.6k
- Forks
- 3.9k
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 177
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de livekit/agents
-
Assistant markup is stripped from chat history when expressive mode is offPosiblemente ocupada @ShivamSharma43 la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsQuizá libre de nuevo @AbarnaaSree la tomó hace 46 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Tool argument errors put the argument values in the log message body, outside `lk.pii.*`Posiblemente ocupada @Li-john1021 la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 25/100
livekit/agents#7801 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Google Realtime (Vertex AI): update_instructions() appends a model turn instead of replacing the system instructionPosiblemente ocupada @Li-john1021 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
livekit/agents#7785 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
elevenlabs: text-to-dialogue (v3/v4) alignment timestamps are chunk-relative, breaking synced transcriptsPosiblemente ocupada @satheeshk50 la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
livekit/agents#7773 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de livekit/agents
Issues similares
-
documentation pkg: sphinx-needs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
useblocks/sphinx-needs#2255 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
home-assistant/core#186538 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
btclib-org/btclib-secp256k1#1181 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pyrite-wiki/pyrite#917 ·
Los mantenedores suelen responder en 1 día