Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

observio-0.1.0.tar.gz (235.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

observio-0.1.0-py3-none-any.whl (309.5 kB view details)

Uploaded Python 3

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

Hashes for observio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4767c26329637888365ae8d9610b177c6144ee6f288a022def66dce869e222f
MD5 6bdfe15c234e4ce360edb8ec48673bd2
BLAKE2b-256 8d60ddb505a27fab98ff921902c2f7bca2af713c7ccaf691579f1ef983adf987

See more details on using hashes here.

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

Hashes for observio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40f60c47541e32210676bba53194648cab76281845a0f5e7b90b55f0ea081da5
MD5 db82afb0965baf1aef5c0fc69063ebae
BLAKE2b-256 123c351d3d69fdedeae6e5eb215657393e12534b1b9edc484aab9e41f4e03a7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page