Skip to main content

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

Metadata

Release files for openaxi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for openaxi 0.1.0
File Interpreter ABI Platform Actions
openaxi-0.1.0-py3-none-any.whl Python 3 none any Details for openaxi-0.1.0-py3-none-any.whl

Release files / openaxi-0.1.0-py3-none-any.whl

Download URL openaxi-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b3491fc9ff3becc26a88b9702f83790c92190d03928d7d5a0307e1ffcaee604
BLAKE2b-256 checksum
How to use checksums
0b814fc6d849e186b664d271bb60f6ce36cc654012f6fd18b0809230808115c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for openaxi 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page