Enabling performance metrics
Setenable_metrics=True in PipelineParams when creating a task:
Example config
| Metric | Description |
|---|---|
| TTFB | Time To First Byte in seconds |
| Processing Time | Time taken by the service to respond in seconds |
Sample output
Limiting TTFB responses
If you only want the first TTFB measurement for each service, you can optionally passreport_only_initial_ttfb=True in PipelineParams:
Example config
Note: enable_metrics=True is required for this setting to have an
effect.
Enabling LLM/TTS Usage Metrics
Setenable_usage_metrics=True in PipelineParams when creating a task:
Example config
| Metric | Description |
|---|---|
| LLM Usage | Number of prompt and completion tokens used |
| TTS Usage | Number of characters processed |
Sample output
Note: Usage metrics are recorded per interaction and do not represent running totals.
Capturing Metrics Data
When metrics are enabled, Pipecat will emit aMetricsFrame for each interaction. The MetricsFrame contains:
- TTFB data
- Processing time
- Token usage for LLMs
- Character usage for TTS
- Smart Turn prediction data
MetricsFrames.