Skip to content

About

Official Zero-Dependency Python Client SDK for SentioGate AI Router

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

SentioGate Python SDK (sentiogate-python)

PyPI version Python versions License: Apache-2.0 Website Live Benchmarks

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.


⚡ Installation

pip install sentiogate-python

(Zero external dependencies: uses Python standard library for maximum reliability and minimal container footprint).


🚀 Quickstart

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"])

🌊 Streaming Completions

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()

🛠️ Routing preference

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.


🔗 Useful Links

About

Official Zero-Dependency Python Client SDK for SentioGate AI Router

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages