Skip to main content

OpenInference Instructor Instrumentation

pypi

Python auto-instrumentation library for the Instructor library.

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

Installation

pip install openinference-instrumentation-instructor

Quickstart

This quickstart shows you how to instrument Instructor

Install required packages.

pip install instructor arize-phoenix opentelemetry-sdk opentelemetry-exporter-otlp

Start Phoenix 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. (Phoenix does not send data over the internet. It only operates locally on your machine.)

python -m phoenix.server.main serve

Set up InstructorInstrumentor to trace your application and send the traces to Phoenix at the endpoint defined below.

from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor

endpoint = "http://127.0.0.1:6006/v1/traces"
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
from openinference.instrumentation.instructor import InstructorInstrumentor
from openinference.instrumentation.openai import OpenAIInstrumentor

InstructorInstrumentor().instrument(tracer_provider=tracer_provider)

# Optionally instrument the OpenAI SDK to get additional observability
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)

Simple Instructor example

import instructor
from pydantic import BaseModel
from openai import OpenAI


# Define your desired output structure
class UserInfo(BaseModel):
    name: str
    age: int


# Patch the OpenAI client
client = instructor.from_openai(OpenAI())

# Extract structured data from natural language
user_info = client.chat.completions.create(
    model="gpt-3.5-turbo",
    response_model=UserInfo,
    messages=[{"role": "user", "content": "John Doe is 30 years old."}],
)

More Info

Metadata

Release files for openinference-instrumentation-instructor 0.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openinference-instrumentation-instructor 0.1.30
File Size Uploaded Provenance Actions
openinference_instrumentation_instructor-0.1.30.tar.gz 15.0 kB With provenance Details for openinference_instrumentation_instructor-0.1.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openinference-instrumentation-instructor 0.1.30
File Interpreter ABI Platform Actions
openinference_instrumentation_instructor-0.1.30-py3-none-any.whl Python 3 none any Details for openinference_instrumentation_instructor-0.1.30-py3-none-any.whl

Total release size: 31.5 kB

Release files / openinference_instrumentation_instructor-0.1.30.tar.gz

Download URL openinference_instrumentation_instructor-0.1.30.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f446be7a8ca32a1a1bda19c1349335c906f20ac9e5fce8a1c17afc1193036af7
BLAKE2b-256 checksum
How to use checksums
4100f55e04e6320fbe13cbdf64ec275b6bff02ea1b17dd39425c5c7bcdac5d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / openinference_instrumentation_instructor-0.1.30-py3-none-any.whl

Download URL openinference_instrumentation_instructor-0.1.30-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d304e8dd2334ec7fb34bfd283f874b7e46a81636fd375e91569b419de4477f7
BLAKE2b-256 checksum
How to use checksums
e87863256517bc67b59a5f74ec1c3ebe7d563a449e5864d529e5a55216b1294c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for openinference-instrumentation-instructor 0.1.30

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openinference_instrumentation_instructor-0.1.30.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.30 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page