Thin, zero-dependency Python client for SentioGate — the zero-markup, OpenAI-compatible LLM router for your own provider keys (BYOK). It picks a suitable model for each request and automatically falls back to another model if one fails.
- 🐍 PyPI Package:
https://pypi.org/project/sentiogate-python/ - 📦 TypeScript SDK (NPM):
https://www.npmjs.com/package/@sentiogate/sdk - 🌐 Developer Hub & Simulator:
https://sentiogate.github.io
pip install sentiogate-python(Zero external dependencies: uses Python standard library for maximum reliability and minimal container footprint).
import os
from sentiogate import AutoRouterClient
client = AutoRouterClient(
api_key=os.environ.get("SENTIOGATE_API_KEY"),
)
response = client.chat(
model="auto", # SentioGate picks the model; cheapest suitable by default
messages=[
{"role": "system", "content": "You are a helpful software architect."},
{"role": "user", "content": "What is the difference between gRPC and REST?"}
]
)
print(response["choices"][0]["message"]["content"])import os
from sentiogate import AutoRouterClient
client = AutoRouterClient(api_key=os.environ.get("SENTIOGATE_API_KEY"))
for chunk in client.stream_chat(
model="auto",
messages=[{"role": "user", "content": "Write a binary search in Python."}],
extra_body={"route_preference": "latency"}, # "cost" (default), "quality" or "latency"
):
delta = chunk.get("choices", [{}])[0].get("delta", {}).get("content", "")
print(delta, end="", flush=True)
print()Send model="auto" and set route_preference through extra_body to "cost" (default), "quality" or
"latency". You can also request a specific provider/model. SentioGate automatically falls back to another
model if one fails.
Retries are off by default. Set max_retries to retry transient 429s after the server's Retry-After
(the server may ask you to wait); waits longer than max_retry_wait raise RouterClientError instead.