Observio Python SDK
Project description
Observio Python SDK
Observio is an open-source, full-stack LLM observability and evaluation platform. It helps you trace agentic workflows, capture nested tool invocations, log input/output tokens, and attribute costs across multiple AI models seamlessly.
Features
- Full-Stack Tracing: Capture backend, tool, and LLM layers with zero friction.
- Dynamic Auto-Decorators: Decorate functions using
@observe()to automatically start and stop tracing spans. - OpenTelemetry Standard: Built on standard OpenTelemetry semantic conventions for AI.
- Cost & Token Attribution: Track precise model pricing and token counts on spans.
Installation
Install the SDK via pip:
pip install observio
Quick Start
1. Initialization
Initialize the SDK at the start of your application:
from observio import Observio
Observio.initialize(
project_api_key="your-observio-project-api-key",
base_url="http://localhost:8000", # Base URL of your local or hosted Observio instance
force_http=True # Set to True for local development
)
2. Tracing Functions
Use the @observe() decorator to trace any function or RAG component:
from observio import observe
@observe()
def call_llm(prompt: str):
# Traced under a single span
return "This response is traced"
@observe()
def process_rag_pipeline(query: str):
context = retrieve_context(query)
response = call_llm(query)
return response
3. Adding Span Attributes
Enhance your spans with rich context metadata:
from opentelemetry import trace
from observio import observe
@observe()
def embed_text(text: str):
span = trace.get_current_span()
# Categorize the layer
span.set_attribute("observio.layer", "ai")
# Log usage metrics
span.set_attribute("gen_ai.usage.input_tokens", len(text) // 4)
span.set_attribute("lmnr.span.total_cost", 0.0001)
return [0.1, 0.2, 0.3]
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file observio-0.1.0.tar.gz.
File metadata
- Download URL: observio-0.1.0.tar.gz
- Upload date:
- Size: 235.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4767c26329637888365ae8d9610b177c6144ee6f288a022def66dce869e222f
|
|
| MD5 |
6bdfe15c234e4ce360edb8ec48673bd2
|
|
| BLAKE2b-256 |
8d60ddb505a27fab98ff921902c2f7bca2af713c7ccaf691579f1ef983adf987
|
File details
Details for the file observio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: observio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 309.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f60c47541e32210676bba53194648cab76281845a0f5e7b90b55f0ea081da5
|
|
| MD5 |
db82afb0965baf1aef5c0fc69063ebae
|
|
| BLAKE2b-256 |
123c351d3d69fdedeae6e5eb215657393e12534b1b9edc484aab9e41f4e03a7c
|