Metadata-Version: 2.4
Name: openaxi
Version: 0.1.0
Summary: OpenAxi Python SDK — hybrid LLM router & governance client
Project-URL: Homepage, https://github.com/promptgtm/openaxi
Project-URL: Repository, https://github.com/promptgtm/openaxi
Author: OpenAxi
License: MIT
Keywords: ai,firewall,governance,llm,pii,router,telemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```bash
pip install openaxi
```

## Quick Start

```python
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
