OpenAxi Python SDK — hybrid LLM router & governance client
Project description
OpenAxi Python SDK
Self-improving hybrid LLM router & governance SDK. Tier 1 serverless-compatible Python package for intercepting, masking, firewalling, and intelligently routing outbound LLM calls.
Installation
pip install openaxi
Quick Start
from openaxi import PiiMasker, ShadowEngine, Firewall, PolicyConfigLoader
# PII masking (reversible, fail-closed)
masker = PiiMasker(strict_mode=True)
masked, tokens, confidence, token_map = masker.mask("Contact john@example.com")
unmasked = masker.unmask(masked, token_map)
# Shadow mode with budget pacing
engine = ShadowEngine(shadow_rate=0.05, daily_budget_usd=5.0)
decision = engine.should_execute()
if decision.execute:
engine.record_cost(0.002)
# Firewall (cosine similarity)
from openaxi import Firewall, cosine_similarity
fw = Firewall(rules)
result = fw.evaluate(embedding_vector)
# Config loader with SWR caching
loader = PolicyConfigLoader(base_url="https://cdn.example.com/config")
config = loader.fetch_policy_config()
Modules
| Module | Description |
|---|---|
openaxi.types |
Pydantic models (RouterConfig, FirewallRules, TelemetryPayload, etc.) |
openaxi.pii |
PII masker with reversible tokens and fail-closed confidence |
openaxi.firewall |
Cosine similarity firewall against attack signature embeddings |
openaxi.shadow |
Shadow mode engine with budget pacing and reference sampling |
openaxi.telemetry |
Telemetry payload builder, hasher, and emission |
openaxi.interceptor |
SDK interceptor with before/after/error hooks |
openaxi.config |
Policy config loader with SWR cache, retry, and timeout |
Architecture
Local SDK (in-process) ──► Firewall ──► Router ──► LLM API
│ │
▼ ▼
PII Masker Shadow Mode
│ │
▼ ▼
Telemetry ──► Control Plane (SaaS)
License
MIT
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 openaxi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openaxi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b3491fc9ff3becc26a88b9702f83790c92190d03928d7d5a0307e1ffcaee604
|
|
| MD5 |
4e61b582bf1c7de4f369f00266cc7813
|
|
| BLAKE2b-256 |
0b814fc6d849e186b664d271bb60f6ce36cc654012f6fd18b0809230808115c0
|