> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-source-analytics-user-turn-strategies.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenInference

> OpenTelemetry-based auto-instrumentation that converts Pipecat traces to OpenInference for viewing in Arize Phoenix or Arize AX

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="Arize-ai" maintainerUrl="https://github.com/Arize-ai" repo="https://github.com/Arize-ai/openinference" />

## Overview

`PipecatInstrumentor` is an auto-instrumentation library that converts Pipecat
traces to [OpenInference](https://github.com/Arize-ai/openinference), an
OpenTelemetry-compatible tracing format. It automatically wraps your
`PipelineWorker` to observe frame flow and create spans for LLM, TTS, and STT
services, which you can then view in
[Arize Phoenix](https://github.com/Arize-ai/phoenix) or Arize AX.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat">
    Source code, examples, and issues for the OpenInference Pipecat
    instrumentation
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/openinference-instrumentation-pipecat/">
    The `openinference-instrumentation-pipecat` package on PyPI
  </Card>

  <Card title="OpenInference" icon="book" href="https://arize-ai.github.io/openinference/">
    OpenInference specification and documentation
  </Card>

  <Card title="Arize Phoenix" icon="chart-line" href="https://github.com/Arize-ai/phoenix">
    Open-source LLM observability platform for viewing traces
  </Card>
</CardGroup>

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
pip install openinference-instrumentation-pipecat
```

## Prerequisites

This instrumentation emits OpenTelemetry traces in the OpenInference format, so
you need a backend to send them to. The repository's quickstart uses
[Arize Phoenix](https://github.com/Arize-ai/phoenix) (open source) or Arize AX:

* **Phoenix**: Run Phoenix locally or use a hosted instance, then register a
  tracer provider with `phoenix.otel.register(...)`.
* **Arize AX**: Provide an `ARIZE_SPACE_ID` and `ARIZE_API_KEY` and register
  with `arize.otel.register(...)`.

Because traces are standard OpenTelemetry, any OTLP-compatible backend may be
used. See the [source repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
for the authoritative setup details.

## Usage

Set up a tracer provider and enable the instrumentor at the top of your
application, before building your Pipecat pipeline:

```python theme={null}
from phoenix.otel import register
from openinference.instrumentation.pipecat import PipecatInstrumentor

# Set up the tracer provider
tracer_provider = register(
    project_name="default",  # Phoenix project name
)

# Add the auto-instrumentor at the top of the application
PipecatInstrumentor().instrument(tracer_provider=tracer_provider)

# Build your Pipecat pipeline as usual
pipeline = Pipeline(...)

worker = PipelineWorker(
    pipeline,
    conversation_id=conversation_id,  # used for session tracking in Arize or Phoenix
)

runner = PipelineRunner(handle_sigint=runner_args.handle_sigint)
await runner.run(worker)
```

Once instrumented, the library injects an observer into each `PipelineWorker`,
and exchanges in the running application are logged to your project in Phoenix or
Arize AX.

<Note>
  The instrumentor wraps `PipelineWorker`. The deprecated `PipelineTask` alias
  is a thin subclass of `PipelineWorker` and is covered transparently. See the
  [source
  repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
  for the full example.
</Note>

## Compatibility

The instrumentation tracks Pipecat versions as follows:

| `openinference-instrumentation-pipecat` | `pipecat-ai`           | Python   |
| --------------------------------------- | ---------------------- | -------- |
| `>=2.0`                                 | `>=1.3`                | `>=3.11` |
| `>=1.0, <2.0`                           | `>=1.0, <1.3`          | `>=3.11` |
| `<=0.1.4`                               | `<1.0` (e.g. `0.0.99`) | `>=3.10` |

Pipecat 1.3 deprecated `PipelineTask` in favor of `PipelineWorker`; use `>=2.0`
with `pipecat-ai>=1.3`. Check the [source repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
for the latest tested versions and changelog.
