Metrics
Learn how to monitor performance and LLM/TTS usage with Pipecat.
When developing real-time, multimodal AI applications, monitoring two key factors is crucial: performance (latency) and LLM/TTS usage. Performance impacts user experience, while usage can affect operational costs. Pipecat offers built-in metrics for both, which can be enabled with straightforward configuration options.
Enabling performance metrics
Set enable_metrics=True
in PipelineParams
when creating a task:
Once enabled, Pipecat logs the following metrics:
Metric | Description |
---|---|
TTFB | Time To First Byte in seconds |
Processing Time | Time taken by the service to respond in seconds |
Limiting TTFB responses
If you only want the first TTFB measurement for each service, you can
optionally pass report_only_initial_ttfb=True
in PipelineParams
:
Note:
enable_metrics=True
is required for this setting to have an effect.
Enabling LLM/TTS Usage Metrics
Set enable_usage_metrics=True
in PipelineParams when creating a task:
Pipecat will log the following as applicable:
Metric | Description |
---|---|
LLM Usage | Number of prompt and completion tokens used |
TTS Usage | Number of characters processed |
Note: Usage metrics are recorded per interaction and do not represent running totals.