Skip to main content
A standalone Python script for evaluating Lightning v3.1 synthesis performance over WebSocket. Connects to the streaming endpoint, sends text for synthesis, measures time-to-first-byte (TTFB), and saves the output as a WAV file. Use this to benchmark latency in your own environment, validate audio output quality, or integrate into automated evaluation pipelines.

Prerequisites

Configuration

Script

Usage

  1. Replace <YOUR_API_KEY> with your Smallest AI API key.
  2. Adjust VOICE_ID, SAMPLE_TEXT, SAMPLE_RATE, and other parameters as needed.
  3. Run the script:
Expected output:

What It Measures