Skip to main content

ai-auto-router-client

A lightweight, zero-external-dependency Python client for the AI Auto Router BYOK gateway.

Connects your application directly to your AI Auto Router instance using standard library primitives (urllib). Completely decouples client-side request orchestration from your private routing algorithms, Jev decision trees, and provider quality scoring.

Installation

pip install ai-auto-router-client

Quick Start (3-Line Drop-in)

from ai_auto_router_client import AutoRouterClient

router = AutoRouterClient(base_url="http://localhost:8000")
resp = router.chat(
    messages=[{"role": "user", "content": "Explain raft consensus in 2 sentences"}],
    provider_keys={"openai": "sk-...", "anthropic": "sk-ant-..."}
)
print(resp["choices"][0]["message"]["content"])

Streaming Support

for chunk in router.stream_chat(
    messages=[{"role": "user", "content": "Write a quicksort in Python"}],
    provider_keys={"openai": "sk-..."}
):
    delta = chunk.get("choices", [{}])[0].get("delta", {}).get("content", "")
    print(delta, end="", flush=True)

Key Benefits

  • Zero Third-Party Dependencies: Written entirely in pure Python standard library (urllib, json). No httpx, requests, or heavy runtime bloat.
  • Strict Privacy / Core Isolation: Client never contains internal scoring logic or proprietary provider decision weights. All routing decisions are executed server-side.
  • Provider Key Forwarding: Passes keys transiently via HTTPS to your router; zero persistence of keys on disk.
  • Telemetry Outcome Reporting: Report user accept/reject outcomes to power your adaptive router learning.

License

Apache-2.0

Metadata

Release files for ai-auto-router-client 1.0.0

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

Source distribution (sdist)

Source distribution for ai-auto-router-client 1.0.0
File Size Uploaded
ai_auto_router_client-1.0.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-auto-router-client 1.0.0
File Interpreter ABI Platform
ai_auto_router_client-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / ai_auto_router_client-1.0.0.tar.gz

Download URL ai_auto_router_client-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
112be72d4554a59091cac35f42b2ea47fad955bc3bc96273a5ea0ffd94cdd7b8
BLAKE2b-256 checksum
How to use checksums
e3aa1ee80467947b1f32de807b940484a76f24a3cd2e9c47d98c911b56b4803c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / ai_auto_router_client-1.0.0-py3-none-any.whl

Download URL ai_auto_router_client-1.0.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be8ec072224f4c49667f4444b883b02d6d011c811844aff6c8b9943cafa393e6
BLAKE2b-256 checksum
How to use checksums
bf6fdd4b5959220f518d9158056b781d3ca5dcce6b3e504bb7888161c44a2691
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

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