Unified Python SDK for chat completions across multiple AI providers
Project description
LLM-Router
Unified Python SDK for chat completions across OpenAI, Anthropic, and Google Gemini. All requests/responses use OpenAI format.
Clone the Project
git clone https://github.com/Deeptechs-ai/LLM-Router
Installation
uv sync
Terminal Usage
from gateway import chat_complete, ChatCompletionRequest, Message
request = ChatCompletionRequest(
model="claude-sonnet-4-20250514",
messages=[Message(role="user", content="Hello!")],
max_tokens=100,
)
response = chat_complete(
provider="anthropic", # or "openai", "google"
api_key="your-api-key",
request=request,
)
print(response.choices[0].message.content)
Guardrails
Regex Guardrails
Regex guardrails let you block or flag sensitive content (SSNs, emails, credit cards, etc.) in both input and output messages using pattern matching.
Setup
- Create a YAML config file (see
guardrails.example.yaml):
Each rule requires:
name: Identifier for the rulepattern: Regex pattern to matchdescription: Human-readable descriptionaction:block(raisesGuardrailsError) orflag(logs a warning but allows the request)
- Set the environment variable to enable automatic loading:
GUARDRAILS_FILE_PATH=path-to-guardrails-config-yaml-file
Usage
Guardrails are applied automatically when GUARDRAILS_FILE_PATH is set. Both user input and LLM output are checked against all rules.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rezunate_llm_sdk-0.1.0.tar.gz.
File metadata
- Download URL: rezunate_llm_sdk-0.1.0.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a37cd8fb7f4ba2b8a867d2d4feaa09e351d872e7819fd14c624320000dcbd0b2
|
|
| MD5 |
73a34167b2f17c3c60795a1fa3763cdc
|
|
| BLAKE2b-256 |
4f2f8a0f18bee031959cd569e924b54f12f8c318a04b5fca0cfd2363c6cdc41f
|
File details
Details for the file rezunate_llm_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rezunate_llm_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb0fc36f59afd036719209ecacc5c3069aaf909ca3929b0f6af0be31a3299633
|
|
| MD5 |
af2b2e894cdccbff229da4a70ee5074a
|
|
| BLAKE2b-256 |
e060b45d6e1f51037d35c931889846b91204b5b5c82795da8070620b91339a47
|