Skip to main content

Prela SDK

Fire-and-forget trace ingestion SDK for TraceShield.

Installation

pip install prela

Quick Start

from prela import Prela

prela = Prela(
    api_key="ts_ingest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    endpoint="https://api.traceshield.example.com",
)

# Manual trace
prela.trace(
    input="What is my account balance?",
    output="I don't have access to account information.",
)

# OpenAI integration
from prela.integrations.openai import PrelaOpenAI
from openai import OpenAI

client = PrelaOpenAI(OpenAI(), prela)
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)

# Before process exit
prela.shutdown()

Design

  • Fire-and-forget: Never blocks the agent's response path
  • Zero dependencies: Only requires httpx
  • Batching: Buffers traces and sends every 500ms or 50 traces
  • Resilient: Drops traces on failure, logs warnings, never raises

Telemetry

Send runtime events from your AI agent:

import prela

# Configure once
prela.configure_telemetry(
    api_key="ts-key-...",
    org_id="org-...",
    agent_id="agent-...",
)

# Track events throughout your code
prela.track("llm_call", {"model": "gpt-4", "tokens": 150, "latency_ms": 1200})
prela.track("policy_violation", {"rule": "R-001", "input": "..."}, severity="warning")
prela.track("error", {"message": "Timeout connecting to API"}, severity="error")

# Flush before exit
prela.flush()

Events are batched (default: every 5s or 10 events) and sent to TraceShield's telemetry API.

License

Private. All rights reserved.

Metadata

Release files for orithos-prela 0.2.0

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

Source distribution (sdist)

Source distribution for orithos-prela 0.2.0
File Size Uploaded
orithos_prela-0.2.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orithos-prela 0.2.0
File Interpreter ABI Platform
orithos_prela-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / orithos_prela-0.2.0.tar.gz

Download URL orithos_prela-0.2.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b83878368c4234a658dc5c667dc4f1321d42eaf9c0fc468980fb551e94890286
BLAKE2b-256 checksum
How to use checksums
573c4a0eeb682d36ddcd47571b2165ae77226659827f12805d87e8615d194a31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / orithos_prela-0.2.0-py3-none-any.whl

Download URL orithos_prela-0.2.0-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2f1d28f2b46477d1dbe5b7981e92862e205a123833e2231f5652a6d26adc050
BLAKE2b-256 checksum
How to use checksums
0f2d2348e64e882b69766a3aeb7a30145ecb02390f07280e7934bad1fca1e409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.2.0 This release

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