openinference-instrumentation-llama-index 4.7.11


pip install openinference-instrumentation-llama-index

  Latest version

Released: Nov 21, 2026

Project Links

Meta
Author: OpenInference Authors
Requires Python: <3.16,>=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: Apache Software License

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3.15

OpenInference LlamaIndex Instrumentation

Python auto-instrumentation library for LlamaIndex.

These traces are fully OpenTelemetry compatible and can be sent to an OpenTelemetry collector for viewing, such as Arize Phoenix or Arize AX.

pypi

Installation

pip install openinference-instrumentation-llama-index

Compatibility

llama-index version openinference-instrumentation-llama-index version
>=0.12.3 >=4.0
>=0.11.0 >=3.0
>=0.10.43 >=2.0, <3.0
>=0.10.0, <0.10.43 >=1.0, <0.2
>=0.9.14, <0.10.0 0.1.3

Quickstart

Install packages needed for this demonstration.

python -m pip install --upgrade \
    openinference-instrumentation-llama-index \
    opentelemetry-sdk \
    opentelemetry-exporter-otlp \
    "opentelemetry-proto>=1.12.0" \
    arize-phoenix

Start the Phoenix app in the background as a collector. By default, it listens on http://localhost:6006. You can visit the app via a browser at the same address.

The Phoenix app does not send data over the internet. It only operates locally on your machine.

python -m phoenix.server.main serve

The following Python code sets up the LlamaIndexInstrumentor to trace llama-index and send the traces to Phoenix at the endpoint shown below.

from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import SimpleSpanProcessor

endpoint = "http://127.0.0.1:6006/v1/traces"
tracer_provider = trace_sdk.TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))

LlamaIndexInstrumentor().instrument(tracer_provider=tracer_provider)

To demonstrate tracing, we'll use LlamaIndex below to query a document.

First, download a text file.

import tempfile
from urllib.request import urlretrieve
from llama_index.core import SimpleDirectoryReader

url = "https://raw.githubusercontent.com/Arize-ai/phoenix-assets/main/data/paul_graham/paul_graham_essay.txt"
with tempfile.NamedTemporaryFile() as tf:
    urlretrieve(url, tf.name)
    documents = SimpleDirectoryReader(input_files=[tf.name]).load_data()

Next, we'll query using OpenAI. To do that you need to set up your OpenAI API key in an environment variable.

import os

os.environ["OPENAI_API_KEY"] = "<your openai key>"

Now we can query the indexed documents.

from llama_index.core import VectorStoreIndex

query_engine = VectorStoreIndex.from_documents(documents).as_query_engine()
print(query_engine.query("What did the author do growing up?"))

Visit the Phoenix app at http://localhost:6006 to see the traces.

More Info

4.7.11 Nov 21, 2026
4.7.10 Nov 20, 2026
4.7.9 Nov 19, 2026
4.7.8 Nov 19, 2026
4.7.7 Nov 16, 2026
4.7.6 Nov 12, 2026
4.7.5 Nov 12, 2026
4.7.4 Nov 11, 2026
4.7.3 Nov 11, 2026
4.7.2 Nov 05, 2026
4.7.1 Nov 04, 2026
4.7.0 Oct 29, 2026
4.6.2 Oct 29, 2026
4.6.1 Oct 23, 2026
4.6.0 Oct 09, 2026
4.5.4 Oct 01, 2026
4.5.3 Oct 01, 2026
4.5.2 Sep 10, 2026
4.5.1 Sep 09, 2026
4.5.0 Sep 04, 2026
4.4.8 Aug 28, 2026
4.4.7 Aug 25, 2026
4.4.6 Aug 24, 2026
4.4.5 Aug 07, 2026
4.4.4 Jul 30, 2026
4.4.3 Jun 30, 2026
4.4.2 May 18, 2026
4.4.1 May 14, 2026
4.4.0 May 13, 2026
4.3.10 May 10, 2026
4.3.9 Nov 18, 2025
4.3.8 Oct 23, 2025
4.3.7 Oct 15, 2025
4.3.6 Oct 10, 2025
4.3.5 Sep 12, 2025
4.3.4 Aug 01, 2025
4.3.3 Jul 29, 2025
4.3.2 Jul 23, 2025
4.3.1 Jun 27, 2025
4.3.0 May 29, 2025
4.2.1 Apr 11, 2025
4.2.0 Apr 10, 2025
4.1.0 Apr 03, 2025
4.0.0 Mar 28, 2025
3.3.3 Mar 18, 2025
3.3.2 Mar 14, 2025
3.3.1 Feb 19, 2025
3.3.0 Feb 18, 2025
3.2.0 Feb 13, 2025
3.1.4 Feb 04, 2025
3.1.3 Jan 09, 2025
3.1.2 Dec 20, 2024
3.1.1 Dec 17, 2024
3.1.0 Dec 12, 2024
3.0.4 Nov 12, 2024
3.0.3 Oct 31, 2024
3.0.2 Sep 06, 2024
3.0.1 Sep 05, 2024
3.0.0 Aug 27, 2024
2.2.4 Aug 10, 2024
2.2.3 Aug 06, 2024
2.2.2 Aug 06, 2024
2.2.1 Aug 01, 2024
2.2.0 Jul 31, 2024
2.1.1 Jul 25, 2024
2.1.0 Jul 15, 2024
2.0.0 Jun 10, 2024
1.4.2 Jun 03, 2024
1.4.1 May 21, 2024
1.4.0 May 17, 2024
1.3.0 May 06, 2024
1.2.2 Apr 23, 2024
1.2.1 Mar 18, 2024
1.2.0 Mar 13, 2024
1.1.1 Mar 04, 2024
1.1.0 Feb 24, 2024
1.0.1 Feb 15, 2024
1.0.0 Feb 13, 2024
0.1.3 Feb 12, 2024
0.1.2 Feb 09, 2024
0.1.1 Jan 27, 2024
0.1.0 Jan 22, 2024
Extras:
Dependencies:
openinference-instrumentation (>=0.1.82)
openinference-semantic-conventions (>=0.1.46)
opentelemetry-api
opentelemetry-instrumentation
opentelemetry-semantic-conventions
typing-extensions
wrapt