Skip to main content

AKHU Observer SDK — Evidence infrastructure adapter for AI systems

Project description

akhu-observer (Python)

𓅂 AKHU Observer SDK — Evidence infrastructure adapter for AI systems.

Zero-dependency Python SDK for connecting AI applications to the AKHU evidence ledger.

Install

pip install akhu-observer

With provider support:

pip install "akhu-observer[openai]"      # OpenAI wrapper
pip install "akhu-observer[anthropic]"   # Anthropic wrapper

Quick Start

Direct Client

from akhu_observer import AkhuClient

client = AkhuClient(url="http://akhu-api:3000", channel_id="my-system")
client.observe("DOCUMENT_PROCESSED", {"doc_id": "abc-123", "pages": 12})

OpenAI Wrapper

from openai import OpenAI
from akhu_observer import observe_openai

client = observe_openai(OpenAI(), akhu_url="http://akhu-api:3000")
response = client.chat.completions.create(model="gpt-4o", messages=[...])
# Observation sent automatically — response unmodified

Anthropic Wrapper

from anthropic import Anthropic
from akhu_observer import observe_anthropic

client = observe_anthropic(Anthropic(), akhu_url="http://akhu-api:3000")
response = client.messages.create(model="claude-sonnet-4-20250514", max_tokens=1024, messages=[...])

Environment Variables

export AKHU_URL="http://akhu-api:3000"
export AKHU_CHANNEL_ID="my-channel"
# No config needed — reads from environment
client = AkhuClient()

Architecture

  • Zero runtime dependencies — uses only Python stdlib (http.client, threading, json)
  • Fail-open — observation failures never affect the observed system
  • Privacy by default — content redacted unless explicitly opted in
  • Security always — credentials stripped even with capture_content=True
  • Thread-safe — safe to use from any thread, background flush via daemon threads

Full API reference: OBSERVER-SDK-REFERENCE.md

Development

cd packages/observer-python
pip install -e ".[dev]"
pytest
pytest tests/invariants/       # Property-based tests
pytest tests/adversarial/      # Injection/attack resistance

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

akhu_observer-0.1.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

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

akhu_observer-0.1.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akhu_observer-0.1.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for akhu_observer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 951f7696094051160a4f47cfea0aaa2a6a703308170943957af2320d95b403cb
MD5 7ba0f551fb8df0609327e5ab37b3b120
BLAKE2b-256 3aa3c9674d3dc04171e28153a6dd57b4244ebd880ab928f808b0589f5844e2bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: akhu_observer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for akhu_observer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4285ae129a84b549d38f6263dae88378b8b4864f18ec493f7f418375d62f50e5
MD5 83959d5b8ddfc0aa68addd5b35668e96
BLAKE2b-256 a167f9f66af83100561c36e3fa2f66adb2654869220f18ed58d0b1a2b48274c4

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