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.
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
- 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
- Set the
OBSERVICIA_CONFIG_FILEenvironment variable to the path of the configuration file:
export OBSERVICIA_CONFIG_FILE=/path/to/observicia_config.yaml
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file observicia-0.1.3.tar.gz.
File metadata
- Download URL: observicia-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e47e4b91df1b6b0375cbfc59c0c2a38f534a5dd334f73b174819151646301fdf
|
|
| MD5 |
0ea679b839e5d2ad8b2bf1cadeaf661a
|
|
| BLAKE2b-256 |
886138ce071ff5750f81cfb6ccc8aeb41c8b1e8945d3b8b56878fc50f18f0072
|
File details
Details for the file observicia-0.1.3-py3-none-any.whl.
File metadata
- Download URL: observicia-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af75511b3ebef615557dbee15f6833d8f354b499ff2cb5c43b9fb3b7cfde96ef
|
|
| MD5 |
88653576f176ef668e1de2be5495fc19
|
|
| BLAKE2b-256 |
bda2a7d10a6764d0ab962a7189b619196078df5c9ec11b5172234f21679bbcb2
|