Smart AI router — filters requests to the right model, saving 40-80% on costs
Project description
Sievellm
Smart AI router — automatically routes to the right model.
🚧 Early Development — Works, feedback welcome!
Stop overpaying for AI. Sievellm uses AI to detect query complexity and routes simple questions to cheap models, complex ones to capable models — saving you 40-80% on API costs.
Why Sievellm?
| LiteLLM | Sievellm | |
|---|---|---|
| Setup | Docker, Postgres, YAML | pip install sievellm |
| Routing | Manual rules you configure | AI auto-detects complexity |
| Code | Proxy server + config | One line: route("question") |
Installation
pip install sievellm
Quick Start
from sieve import route
# Simple query → automatically routes to cheap model (gpt-4o-mini)
response = route("What is 2+2?")
print(response) # 4
print(f"Model: {response.model_used}") # gpt-4o-mini
print(f"Cost: ${response.cost_usd:.6f}") # ~$0.000007
# Complex query → automatically routes to capable model (gpt-4-turbo)
response = route("Explain the trade-offs between microservices and monoliths")
print(f"Model: {response.model_used}") # gpt-4-turbo
Setup
export OPENAI_API_KEY="sk-..."
How It Works
- AI Classification — Uses GPT-4o-mini to rate query complexity (costs ~$0.00001)
- Smart Routing — Routes to cheap/mid/expensive tier based on complexity
- Cost Tracking — Returns actual cost per request
Options
from sieve import Router
router = Router(
smart_routing=True, # AI-powered (default) or keyword-based
force_tier="cheap", # Force a specific tier (optional)
)
Roadmap
- AI-powered complexity detection
- Anthropic Claude support
- Multi-provider routing (cheapest across OpenAI + Anthropic + Google)
- Streaming responses
- Budget limits & alerts
License
MIT
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 sievellm-0.3.0.tar.gz.
File metadata
- Download URL: sievellm-0.3.0.tar.gz
- Upload date:
- Size: 42.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e921ab84fdd7da29a94d17e6ae789d3df3b6eeae2ab74fec6b9ef2d8f91abcb
|
|
| MD5 |
fd1a5fcf47db4e0a7318beddcb1bb7b4
|
|
| BLAKE2b-256 |
3d8441ab1b4352aa5f7e2f95ae3c8bfd77382b4a5e06c7a1467372da3340351c
|
File details
Details for the file sievellm-0.3.0-py3-none-any.whl.
File metadata
- Download URL: sievellm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4935ac830d2e3604e338876ba8a8f8051b5c456790805b4ab2ceced65fef376d
|
|
| MD5 |
71dca3dadfa1b377d7b402ecae77583f
|
|
| BLAKE2b-256 |
ac6ce825c1924b091225bd4b879e8c35bf92ee499a8428c1261e23578d4166e9
|