services
Service constructors for the eval harness.
Each function builds a concrete pipecat service (TTS, STT, or judge LLM) from a
scenario’s config mapping. They are the dispatch targets behind the service:
name in pipecat.evals.speech.EvalSpeech.from_config(),
pipecat.evals.transcribe.EvalTranscriber.from_config(), and
pipecat.evals.judge.EvalJudge.from_config(). The heavy provider imports
stay lazy inside each function so importing this module stays cheap.
- pipecat.evals.services.kokoro_service(voice_cfg: dict, sample_rate: int) TTSService[source]
Build a local Kokoro TTS service from the
user_audioconfig.Kokoro runs an ONNX model locally (no API key, no per-run cost), so the eval suite synthesizes user audio for free. The model files are downloaded once on first use and cached under
~/.cache/kokoro-onnx.
- pipecat.evals.services.cartesia_service(voice_cfg: dict, sample_rate: int) TTSService[source]
Build a Cartesia TTS service from the
user_audioconfig.
- pipecat.evals.services.whisper_service(config: dict) STTService[source]
Build a local Whisper STT service from the
bot_audioconfig.Runs on the CPU by default (
device: cpu): the GPU is reserved for the judge LLM and the per-run audio models, and bot-speech transcription happens once per turn off the hot path, so the extra latency is fine. This frees enough GPU memory to run a larger, more accurate model (e.g.distil-mediumorlarge-v3-turbo) at higher concurrency. Override withdevice: cuda(andcompute_type) in thetranscriptionconfig if you have GPU headroom.The eval transcribes audio it already knows is the bot speaking (the harness captures it between
bot-started-speakingandbot-stopped-speaking), so Whisper’s non-speech filter is counterproductive here: the defaultno_speech_prob=0.4drops correct transcriptions of synthetic/TTS speech, whoseno_speech_probjitters across ~0.4-0.6 run to run (a dropped segment yields noTranscriptionFrame, so the harness then waits out the whole transcription timeout). Disable the filter with a permissive threshold.
- pipecat.evals.services.moonshine_service(config: dict) STTService[source]
Build a local Moonshine STT service from the
bot_audioconfig.Moonshine runs on the CPU via ONNX Runtime (no GPU, no API key) and is small and fast. On the short, isolated bot-answer segments the harness transcribes, it tends to keep the answer where Whisper sometimes drops it.
modelselects the architecture (aModelvalue or string; defaultModel.SMALL_STREAMING).
- pipecat.evals.services.ollama_service(config: dict) LLMService[Any][source]
Build a local Ollama LLM service from the
judge:config.
- pipecat.evals.services.openai_service(config: dict) LLMService[Any][source]
Build an OpenAI LLM service from the
judge:config.