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

The SDK is configured through an external YAML file specified by the OBSERVICIA_CONFIG_FILE environment variable.

Steps to Configure

  1. Create a YAML configuration file (e.g., observicia_config.yaml) with the desired settings:
service_name: patient-rag-app
otel_endpoint: null
opa_endpoint: http://opa-server:8181/
policies:
  - name: pii_check
    path: policies/pii
    description: Check for PII in responses
    required_trace_level: enhanced
    risk_level: high
  - name: prompt_compliance
    path: policies/prompt_compliance
    description: Check for prompt compliance
    required_trace_level: basic
    risk_level: medium
log_file: null
trace_console: false
  1. Set the OBSERVICIA_CONFIG_FILE environment variable to the path of the configuration file:
export OBSERVICIA_CONFIG_FILE=/path/to/observicia_config.yaml
  1. Initialize the SDK in your code without specifying additional parameters:
from observicia import init

# Initialize Observicia
init()

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.2.tar.gz (33.2 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.2-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: observicia-0.1.2.tar.gz
  • Upload date:
  • Size: 33.2 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.2.tar.gz
Algorithm Hash digest
SHA256 c9bc6eb613130fc5b2922163e676742db11b6778a9c1bc9f0370cef9d2fdbcef
MD5 29cc324eb8de385419e8f58aa9da0bec
BLAKE2b-256 b74357f7b1ccf0965caceef05555a8452edf4bd5c9223e64f164a165dd4e1c28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: observicia-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 40.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 42997435f86e7449d119ab9a8082f81cae6601a47d5c358207f63281d06c1a07
MD5 c7c5b010b3a210999a9fdccd122060d1
BLAKE2b-256 d620ceabaad2fd6c6b74869526bb74ed62497e9535fe13cd948fccacad9c07be

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