Skip to main content
Pipecat is a framework for building real-time voice AI pipelines. Braintrust traces Pipecat pipelines to capture LLM turns, speech-to-text transcriptions, text-to-speech responses, and tool calls.
Requires pipecat-ai v1.3.0 or later and Python 3.11 or later.

Setup

1

Install packages

2

Set your environment variables

.env

Auto-instrumentation

Call auto_instrument() before creating your pipeline to trace all PipelineWorker instances automatically.
agent.py
To instrument Pipecat without auto-instrumenting other libraries, use setup_pipecat() instead of auto_instrument():
If you use auto_instrument() for other libraries but want to exclude Pipecat, pass pipecat=False:
By default, audio is not stored as attachments. To attach user and agent audio to spans, set these environment variables:
You can also configure this when calling setup_pipecat():

Manual instrumentation

To add a BraintrustPipecatObserver to a specific PipelineWorker rather than patching globally, pass it explicitly:

What Braintrust traces

Braintrust attaches a BraintrustPipecatObserver to each PipelineWorker and emits spans as frames flow through the pipeline.
  • Pipeline spans (pipecat_pipeline), the root span covering the full pipeline run, with audio sample rate and format metadata.
  • LLM response spans (pipecat_llm_response), nested under the pipeline span, with input messages, output text or tool calls, token usage, time to first token, and model name and provider.
  • Tool spans (named by the function), with tool arguments and result.
  • STT transcription spans (stt_transcription), with transcript text and language.
  • TTS response spans (tts_response), with input text and, when enabled, an audio attachment.
  • User speaking spans (user_speaking), with optional user audio attachment.

Resources