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.0.tar.gz (29.8 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.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for observicia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b46c14619c8594e09411eadd6c5170eab3f43e00e58398e82184ed51b501e49
MD5 fd6f705203ffa620cd5fa144643baa63
BLAKE2b-256 284df4046627bcea10aa2cae90479ee1f3c36b061838c373528282fe729d7a2e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for observicia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29837ba5b205f9c1917cedfbd81e856a3df5894f1169284751d76a72cd5f2768
MD5 52ad7ca0a80131780f1c879212ef2923
BLAKE2b-256 e0e70aea99ee966091a44b82cde764e9d94bb1a491d0a51a38ccc488698b259d

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