Generate Speech from Text with ElevenLabs
Promptfoo config comparing ElevenLabs TTS model tiers - Flash, Turbo, Multilingual, and streaming - on the same voice and prompts.
Why it matters
Create high-quality synthetic speech using ElevenLabs TTS models. Test and compare different voice settings to find the best fit for your content.
Outcomes
What it gets done
Test ElevenLabs TTS models
Compare voice settings
Generate speech from text
Evaluate audio output
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-elevenlabs-tts | bash Overview
Elevenlabs Tts
This Promptfoo example compares ElevenLabs text-to-speech models - Flash v2.5, Turbo v2.5, Multilingual v2, and a streaming variant - on the same voice and prompts, checking generation success against cost and latency thresholds. Use it as a template when comparing ElevenLabs TTS model tiers for speed, quality, and multilingual support, including streaming mode.
What it does
This Promptfoo config compares ElevenLabs text-to-speech models on the same Rachel voice across three text prompts: a product tagline, a pangram-style tongue-twister, and a short multi-sentence passage about AI. Four provider variants are configured: Flash v2.5 (fastest, lowest latency), Turbo v2.5 (high quality and fast), Multilingual v2 (best for non-English text), and a streaming variant of Flash v2.5. The Flash v2.5 config also sets explicit voice parameters - stability 0.5, similarity_boost 0.75, style 0.0, speaker boost enabled, speed 1.0.
Assertions check that generation actually succeeded, via JavaScript checks for "Generated"/"characters of speech" text in one test and "characters"/"speech" text in another, and enforce a $0.01 cost ceiling and a 5000ms latency ceiling on the first test.
When to use - and when NOT to
Use it as a template for comparing ElevenLabs TTS model tiers - speed versus quality versus multilingual support - and streaming versus non-streaming output, on the same voice. Do not use it if you only need one fixed TTS model/voice combination, or if you're not using ElevenLabs.
Inputs and outputs
Input: the YAML config - prompt text, the four provider/model variants, optional voice settings, and a streaming flag. Output: Promptfoo's evaluation report, checking successful audio generation plus cost and latency thresholds.
Integrations
Uses Promptfoo's elevenlabs:tts provider across ElevenLabs' Flash v2.5, Turbo v2.5, and Multilingual v2 models, plus its cost and latency assertion types.
Who it's for
Teams choosing between ElevenLabs TTS model tiers who want to compare speed, quality, and multilingual support, including streaming mode, before picking a default.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.