Skip to main content

Client SDK for the routewise cost-aware LLM router

Project description

routewise (Python SDK)

Thin client for the routewise cost-aware LLM router. No routing logic lives here -- it's a convenience wrapper around HTTP calls to the real API.

Install

pip install routewise

Usage

from routewise import RouteWiseClient

client = RouteWiseClient(api_key="rw_your_key_here")

result = client.ask("What is the capital of France?")
print(result["response"])
print(result["routed_to"], result["cost_usd"])

# Force a specific tier instead of letting the difficulty model decide
result = client.ask("Explain quantum computing", override_tier="frontier")

# Get aggregate usage stats
stats = client.stats()
print(stats["total_requests"], stats["cache_hit_rate"])

Errors

All non-2xx responses raise RouteWiseError with the API's error detail message, e.g. invalid key, rate limit exceeded, empty query.

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

routewise-0.1.2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

routewise-0.1.2-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file routewise-0.1.2.tar.gz.

File metadata

  • Download URL: routewise-0.1.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for routewise-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c5ad00fb22e1896a5158b2de65fe6543b9994b027b9295c6cc8004c883c78b4f
MD5 46ab1a6e8c5ed1df663d03e1e25b26be
BLAKE2b-256 d7d5795cc068cc556e94fc336eafe71f989f27bdfd825cf12a1d6cf20c5129f2

See more details on using hashes here.

File details

Details for the file routewise-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: routewise-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.2

File hashes

Hashes for routewise-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0ac58cc6f8affa6fcf68806cb4a38016b1fff52c07935d4f1613cbd99e4668a
MD5 4a3acd67c6caea67fe225820ad0aeb4f
BLAKE2b-256 d524d0d1ac8aff159095b5136013b3d90ba61f2d4f3344add7886849b37bc2cd

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