Skip to main content

Cloud Native Observability SDK for LLM applications

Project description

Observicia SDK

Observicia is a Cloud Native observability and policy control SDK for LLM applications. It provides seamless integration with CNCF native observability stack while offering comprehensive token tracking, policy enforcement, and PII protection capabilities.

License OpenTelemetry OPA

Features

  • Comprehensive Token Tracking

    • Real-time token usage monitoring
    • Provider-specific accounting
    • Usage trend analysis
  • Cloud Native Policy Enforcement

    • PII detection and protection
    • Custom policy definition support
  • Cloud Native Observability

    • OpenTelemetry integration
    • Jaeger distributed tracing
    • Custom monitoring dashboards
  • Multi-Provider Support

    • OpenAI
    • Anthropic
    • LiteLLM
    • WatsonX

Architecture

Observicia SDK integrates with your OpenShift environment using native components:

flowchart TB
    App[Application] --> SDK[Observicia SDK]
    SDK --> LLM[LLM Providers]
    SDK --> OPA[Open Policy Agent]
    SDK --> OTEL[OpenTelemetry Collector]
    OTEL --> Prom[Prometheus]
    OTEL --> Jaeger[Jaeger]
    OPA --> PII[PII Detection Service]

Deployment

Prerequisites

  • Kubernetes/OpenShift cluster
  • OpenTelemetry Collector
  • Open Policy Agent
  • Prometheus (optional)
  • Jaeger (optional)

Configuration

Configure the SDK through environment variables or direct initialization:

from observicia import init
from observicia.core.policy_engine import Policy
# Initialize Observicia with policy
policies = [
    Policy(name="pii_check",
           path="policies/pii",
           description="Check for PII in responses",
           required_trace_level="enhanced",
           risk_level="high")
]

init(service_name="patient-rag-app",
     trace_console=False,
     opa_endpoint="http://opa-server:8181/",
     policies=policies)

See example usages in the examples directory.

Policy Definition

Define custom policies using OPA's Rego language

Trace spans include:

  • Token usage per request
  • Policy evaluation results
  • Error information
  • Request/response content

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

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

observicia-0.1.1.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

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

observicia-0.1.1-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file observicia-0.1.1.tar.gz.

File metadata

  • Download URL: observicia-0.1.1.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for observicia-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0f28ce3fb45b48918f7aeb5f037b77820dcd859faeb0ea17c4684201bc641d2d
MD5 725bd6b5a2d7b1f137854c1aa934fa48
BLAKE2b-256 688ac8cb44cd1fccf0e534bf8f9ada7d9ea982b677dd49b47167144b8ed2f28c

See more details on using hashes here.

File details

Details for the file observicia-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: observicia-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for observicia-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cad627feb41d733f1785051a1078a5b215f902120fb9e31267d2dec1d8fb1bf9
MD5 3c9ca6a9549f0e297d21cdd12ae2c771
BLAKE2b-256 d2df441527229b050be0af5496b48be8e873fdbae79a3b858e89522b0779e5c7

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