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

Uploaded Python 3

File details

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

File metadata

  • Download URL: observicia-0.1.4.tar.gz
  • Upload date:
  • Size: 33.1 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.4.tar.gz
Algorithm Hash digest
SHA256 596db9a8d3a1231b249dd446676b12e70d5613bc2ba9c905dc23ea38add94024
MD5 6baf87feec9c0d58b80ec74093d4d471
BLAKE2b-256 a4a2ea0d8e66c44e7248ca077512cb4bd01a01bdf34c7e8b15562d8c1ccb05a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: observicia-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a49ddce68941fe11e2eceb632676dc005e94e4e365f19881a3aee91553e4817
MD5 200a78576e192ae0af6f71861ccd205b
BLAKE2b-256 4e0d97654adc5aba843e9c85620107a2985f0e6a78d990d7d8b34ee6fed7b4d1

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