Skip to main content

Aurex Python SDK - In-process AI runtime layer for AI applications and agents

Project description

Aurex Logo

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.

  1. Backend Server: Runs on FastAPI at http://localhost:8000.
  2. Analytics Dashboard: Next.js UI running at http://localhost:3000.

To run the local control plane during development, clone the repository and refer to the full deployment documentation at http://localhost:3000/docs.


License and Documentation

  • Interactive Documentation: http://localhost:3000/docs
  • GitHub Repository: https://github.com/heyaurex/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

aurex_sdk-0.4.1.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aurex_sdk-0.4.1-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file aurex_sdk-0.4.1.tar.gz.

File metadata

  • Download URL: aurex_sdk-0.4.1.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

Hashes for aurex_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 512a214e3adf88c948522fd08ea907cae8e5a24258692f8257b09c4ee1e449fb
MD5 fb6483ba5e19b79b06283cb5b9606c4a
BLAKE2b-256 896fb8c3ebb1d7151038cd039e4f2da291091abe96423a15a4f0c498b3b6d74f

See more details on using hashes here.

File details

Details for the file aurex_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: aurex_sdk-0.4.1-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

Hashes for aurex_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51ba7d654a286c2bec2d5d935a2a5a2bb3b614d6a571e449959cad4da19e1221
MD5 1558779b266504a6d83fed4def08f1a1
BLAKE2b-256 1d2cac5cef727caeb0be5837b355a4defc43b7eaf9312352dffaa7c944175190

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page