Registry /
llm-agents / openinference-instrumentation-portkey
Install & Compatibility
Where this runs
tested against v0.1.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.8s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PortkeyInstrumentor
✓ from openinference.instrumentation.portkey import PortkeyInstrumentor
✗ from openinference_instrumentation_portkey import PortkeyInstrumentor
Initialize tracing by setting up an OpenTelemetry TracerProvider and calling PortkeyInstrumentor().instrument() before any Portkey usage.
import os
from openinference_instrumentation_portkey import PortkeyInstrumentor
from opentelemetry import trace as trace_api
# Set up a TracerProvider (e.g., ConsoleSpanExporter for debugging)
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
trace_provider = TracerProvider()
trace_provider.add_span_processor(
SimpleSpanProcessor(OTLPSpanExporter(endpoint=os.environ.get("OTEL_ENDPOINT", "http://localhost:4318/v1/traces")))
)
trace_api.set_tracer_provider(trace_provider)
# Instrument Portkey
PortkeyInstrumentor().instrument()
# Now use Portkey normally - calls will be traced
from portkey_ai import Portkey
client = Portkey(api_key=os.environ.get("PORTKEY_API_KEY", ""))
response = client.completions.create(prompt="Hello", model="gpt-3.5-turbo")
print(response.choices[0].text)
Upgrade
Version history
0.1.11latest on PyPI · released May 18, 2026
Audit
Dependencies
openinference-instrumentationrequiredBase OpenInference instrumentation package providing core tracing APIs
portkey-airequiredPortkey AI client SDK - the instrumented library
opentelemetry-apirequiredOpenTelemetry API for creating spans and traces
wraptrequiredUsed for monkey-patching Portkey methods (compatible with wrapt 2.x)