Aurex Python SDK - In-process AI runtime layer for AI applications and agents
Project description
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
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
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 aurex_sdk-0.4.2.tar.gz.
File metadata
- Download URL: aurex_sdk-0.4.2.tar.gz
- Upload date:
- Size: 50.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac3a8a8c4973ffc217902f2b211aa4d96850f83055628e754ed6f8ce600373e6
|
|
| MD5 |
004135572eeead452f97c3b15db93639
|
|
| BLAKE2b-256 |
0908daa209abdae18d490bf0ec12f3bf4815fe6c97babe04ea47e172630d258a
|
File details
Details for the file aurex_sdk-0.4.2-py3-none-any.whl.
File metadata
- Download URL: aurex_sdk-0.4.2-py3-none-any.whl
- Upload date:
- Size: 53.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3bac8ff7412f5875faceb2d3b77a44319ad0be9d253d5ecd2eb5e3765613bec
|
|
| MD5 |
2b1003563cfc120fc8eb7ae3c8fe5e13
|
|
| BLAKE2b-256 |
18d6846d7c3f154526febc053e976c54f6b70d953c9ed21f521e6a8963280042
|