Aurex Python SDK
The In-Process AI Runtime Layer for Production Agent Infrastructure
Aurex is an in-process AI runtime layer designed for production LLM applications and autonomous agent frameworks. Embedded directly within your application host process, Aurex intercepts LLM provider calls with under 2 milliseconds of overhead to handle model routing, context compression, behavioral loop detection, and automatic provider failover.
Key Features
- Sub-2ms In-Process Execution: All decisions, loop guards, and routing rules execute locally in memory with zero network hop latency.
- Universal Auto-Patching: Single-line integration for OpenAI, Anthropic, Google Gemini, LiteLLM, Ollama, and Hugging Face.
- Zero Prompt Data Egress: Operates local-first using SHA-256 signatures. Sensitive prompt payloads and LLM responses never leave your application host.
- Adaptive Model Routing: Dynamically routes low-complexity calls to higher-efficiency model tiers (for example, GPT-4o to GPT-4o-mini).
- Behavioral Loop Mitigation: Hybrid structural and semantic detection (F1 score: 0.72) stops infinite agent loops and recursive tool cascades.
Installation
pip install aurex-sdk
For Node.js environments:
npm install aurex-sdk
Quick Start Guide
Option A: Zero-Code Auto-Hook (Recommended)
Attach Aurex runtime hooks at application launch with no modifications to existing codebase logic.
# Register global site-packages import hooks
aurex install-hook
# Configure environment variables and start your application
export AUREX_ENABLED=1
export AUREX_API_KEY=aux_dev_yourkey
python your_app.py
Option B: Programmatic SDK Setup
Initialize the Aurex auditor singleton and auto-patch your LLM clients directly.
import openai
from aurex_sdk import AurexAuditor, patch_all
# Initialize the auditor and patch installed providers
auditor = AurexAuditor()
patch_all()
# Use standard provider clients as usual
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain quantum computing in simple terms."}]
)
# Access runtime health and efficiency metrics
report = auditor.get_score()
print(f"Efficiency Score: {report.value}/100")
Option C: Runtime Guards and Circuit Breakers
Enforce spending limits and pre-call policy routing before sending API calls to providers.
from aurex_sdk import AurexAuditor
auditor = AurexAuditor()
auditor.configure_circuit_breaker({
"max_cost_per_minute": 5.00,
"max_cost_per_session": 50.00,
"on_budget_exceeded": "throw" # Options: "throw", "warn", "webhook"
})
# Pre-call evaluation
decision = auditor.pre_call_check(
model="gpt-4o",
prompt="Generate system report.",
workflow_id="session_4921"
)
if decision.action == "block":
raise Exception(f"Call blocked: {decision.reason}")
elif decision.action == "downgrade":
model = decision.suggested_model # Route to suggested efficient model
Offline CI/CD Quality Gates
Enforce cost and efficiency thresholds during continuous integration builds:
# Scan local ledger for optimization opportunities and fail CI build on policy breach
aurex audit --ledger .aurex/ledger.jsonl --fail-under 85 --mode block
Self-Hosting and Dashboard Setup (Optional)
For local development and self-hosted deployments, telemetry flushes asynchronously to an optional Aurex backend and analytics dashboard.
- Backend Server: FastAPI backend service at
https://heyaurex.com/api/v1. - Analytics Dashboard: Next.js UI running at
https://heyaurex.com.
To run the local control plane during development, clone the repository and refer to the full deployment documentation at https://heyaurex.com/docs.
License and Documentation
- Interactive Documentation:
https://heyaurex.com/docs - GitHub Repository:
https://github.com/bhav09/aurex-sdk
Metadata
Release files for aurex-sdk 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aurex_sdk-0.4.3.tar.gz | 50.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aurex_sdk-0.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.6 kB
Release files / aurex_sdk-0.4.3.tar.gz
| Download URL | aurex_sdk-0.4.3.tar.gz |
|---|---|
| Size | 50.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b6623ec7acfc21c2e38b5159fc9c6d6c6930f1eec2ee299a709bc3fe39bcdb0
|
|
BLAKE2b-256 checksum How to use checksums |
a37bd5e8ec06b058575be75ae88246f71c8d0437857956509491b0fc2a8d5eb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / aurex_sdk-0.4.3-py3-none-any.whl
| Download URL | aurex_sdk-0.4.3-py3-none-any.whl |
|---|---|
| Size | 53.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2183b1447bd59720ce9d2317959cdb5d8aa1d64dd075e6875d4f798e9c4b8bfe
|
|
BLAKE2b-256 checksum How to use checksums |
7fcdd7feb962eb95fbddac7007b009ea24f56cd0e722208f42a139bc5ef4a66f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|