OpenInference Portkey AI Instrumentation
Project description
OpenInference Portkey AI Instrumentation
This package provides instrumentation for the Portkey AI library using OpenInference.
Installation
pip install openinference-instrumentation-portkey
Usage
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from openinference.instrumentation.portkey import PortkeyInstrumentor
# Set up the tracer provider
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
SimpleSpanProcessor(ConsoleSpanExporter())
)
# Instrument Portkey AI
PortkeyInstrumentor().instrument()
# Use Portkey AI as usual
# ...
# Uninstrument when done
PortkeyInstrumentor().uninstrument()
Features
- Automatic instrumentation of Portkey AI API calls
- Capture of input messages, output messages, and model information
- Integration with OpenTelemetry for distributed tracing
Requirements
- Python 3.9+
- Portkey AI 0.1.0+
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openinference_instrumentation_portkey-0.1.3.tar.gz
.
File metadata
- Download URL: openinference_instrumentation_portkey-0.1.3.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8bcdfcdfa88745b9c9bbe31a515a36f9506167a9afec509e8a700029c2a0514 |
|
MD5 | 761768dc3a96e1702176f28accbc5069 |
|
BLAKE2b-256 | 65dc90a69c8e92791c743c86feae840ca09b6a6331ed53d4cedb4ec04abd8513 |
File details
Details for the file openinference_instrumentation_portkey-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: openinference_instrumentation_portkey-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99de9e9cf4a583318210f290b7628a38e515cef55b8678e38334959e6406ebe7 |
|
MD5 | 4bf0b7a138a7929fdf9f16752760f1b8 |
|
BLAKE2b-256 | fabebb27ecd633c70d6196bc4306781e51685087c2b9499a1793aaf9e20e93c2 |