Skip to main content

RELIA Python SDK

Unified observability and AI agent monitoring for Python. One SDK for APM tracing, LLM cost tracking, and agent workflow monitoring — with zero-config auto-instrumentation.

Install

pip install relia-sdk

Quick Start

Option 1: CLI Setup (Recommended)

python -m relia init

The interactive wizard detects your framework, creates a project, and generates all config files automatically.

Option 2: One Import

import relia.auto  # Auto-instruments everything

Option 3: Manual Integration

FastAPI

from relia.integrations.fastapi import ReliaFastAPIMiddleware

app.add_middleware(ReliaFastAPIMiddleware)

Flask

from relia.integrations.flask import ReliaFlask

ReliaFlask(app)

Django

MIDDLEWARE = ["relia.django.ReliaMiddleware", ...]

AI Agent Monitoring

Auto-captures every LLM call (OpenAI, Anthropic, Google, DeepSeek, Groq, Mistral, Cohere, Together, Perplexity, xAI, Fireworks, OpenRouter) with token usage, costs, and latency — no code changes needed.

Decorators (Explicit Control)

from relia import trace, tool

@trace(model="gpt-4o")
def run_agent(prompt: str):
    response = openai.chat.completions.create(...)
    return response

@tool()
def search_db(query: str):
    return db.execute(query)

Context Manager

from relia import trace_run

with trace_run(name="my-agent", model="claude-sonnet-4-20250514") as run:
    result = llm.call(...)
    run.add_step("search", input=query, output=result)

LangChain

from relia.agent.wrappers.langchain import ReliaCallbackHandler

handler = ReliaCallbackHandler(agent_name="my-agent")
llm = ChatOpenAI(model="gpt-4o", callbacks=[handler])

Features

  • Zero-code LLM interception — patches httpx and requests to capture all API calls automatically
  • Smart conversation tracking — groups multi-turn and tool-calling chains into single runs
  • Cost estimation — built-in pricing for 24+ models (GPT-4o, Claude, Gemini, DeepSeek, etc.)
  • Sensitive data redaction — auto-redacts passwords, tokens, API keys, credit cards before export
  • Non-blocking reporting — background thread pool, never slows your app
  • SSE streaming support — captures tool calls and usage from streaming completions
  • Cloudflare/Vercel geo enrichment — extracts client IP, country, city from proxy headers

CLI Commands

python -m relia init      # Interactive project setup
python -m relia whoami    # Show current user
python -m relia logout    # Remove credentials

Environment Variables

Variable Description
RELIA_PROJECT_ID Your RELIA project ID
RELIA_SERVICE_NAME Service name for APM (default: backend)
RELIA_OTLP_ENDPOINT Custom OTLP collector URL
RELIA_AGENT_ENDPOINT Agent run ingestion URL
RELIA_ENV Environment label (default: production)

The SDK also reads from .env / .env.local files automatically.

Links

Support

License

MIT

Metadata

Release files for relia-sdk 0.1.1

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

Source distribution (sdist)

Source distribution for relia-sdk 0.1.1
File Size Uploaded
relia_sdk-0.1.1.tar.gz 30.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for relia-sdk 0.1.1
File Interpreter ABI Platform
relia_sdk-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.9 kB

Release files / relia_sdk-0.1.1.tar.gz

Download URL relia_sdk-0.1.1.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e1ef42ef8154b7f8add0804e005cd484f2db7537650ea530f3fb381a228e005
BLAKE2b-256 checksum
How to use checksums
d8133f05d0f7517bb14b16a813687192b74c5b35bdc5ddd2cd27728e266e878d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / relia_sdk-0.1.1-py3-none-any.whl

Download URL relia_sdk-0.1.1-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
547db7806d966799c7730fe6f625382c9a4f3f4d9abf8e4554fdb5a29fcc0c8e
BLAKE2b-256 checksum
How to use checksums
6b3f1af0c8d637da8ca8b7ba84f18d55767b9c0bd9099098901fddeacdc84733
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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