Velocity-aware model routing callback for LiteLLM. Routes via WZRD attention signals, earns CCM.
Project description
litellm-wzrd-momentum
Velocity-aware model routing callback for LiteLLM. Routes to the model the ecosystem is converging on using real-time WZRD attention signals. Optionally earns CCM tokens by reporting inference outcomes.
Install
pip install litellm-wzrd-momentum
Usage
import litellm
from litellm_wzrd_momentum import WzrdCallback
litellm.callbacks = [WzrdCallback()]
Every LiteLLM completion call now fetches the latest velocity signal, ranks models by momentum, and exposes the top pick via kwargs["wzrd_signal"]. No config required -- works out of the box with the free signal tier.
Standalone (no LiteLLM)
from litellm_wzrd_momentum import pick_model
signal = {"models": [{"model": "gpt-4o", "trend": "surging", "score": 0.9, "confidence": "normal"}]}
print(pick_model(signal)) # "gpt-4o"
Earn CCM
Install with the earn extra and point to your agent keypair:
pip install 'litellm-wzrd-momentum[earn]'
export WZRD_AGENT_KEYPAIR_PATH=~/.config/wzrd/keypair.json
The callback reports inference outcomes to the WZRD protocol. Reports accumulate into merkle roots and become claimable CCM.
Environment Variables
| Variable | Default | Description |
|---|---|---|
WZRD_PREMIUM |
false |
Set true for enriched signal (trend, confidence, score) |
WZRD_CAPABILITY |
- | Filter models by capability: code, chat, reasoning, vision |
WZRD_AGENT_KEYPAIR_PATH |
- | Ed25519 keypair path for CCM earning via inference reports |
WZRD_EARN_ENABLED |
true |
Set false to disable reporting (signal routing still works) |
Signal API
Live velocity signals powering the router:
- Free:
GET https://api.twzrd.xyz/v1/signals/momentum - Premium:
GET https://api.twzrd.xyz/v1/signals/momentum/premium - Filtered: append
?capability=code(orchat,reasoning,vision)
Signals refresh every 300s from 4-platform ingestion (HuggingFace, GitHub, ArtificialAnalysis, OpenRouter).
How Ranking Works
Models are scored by a composite of:
- Trend -- surging (+3), accelerating (+2), stable (0), decelerating (-1), cooling (-2)
- Score -- normalized velocity (0-1), weighted at 0.3x
- Confidence -- normal (1x), low (0.5x), insufficient (0x)
The top-ranked model is surfaced as kwargs["wzrd_signal"]["top_model"] in LiteLLM callbacks.
License
MIT
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
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 litellm_wzrd_momentum-0.3.1.tar.gz.
File metadata
- Download URL: litellm_wzrd_momentum-0.3.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ed8aa086096bcc37ab1e047c0f70fb3977a2086f885ea4fe3ab4b96510602bd
|
|
| MD5 |
fc317b0a24182d57f1f59e8e7d93ee12
|
|
| BLAKE2b-256 |
1992b1b791b0839ce1e544157b976f0dc608d326413f74dc0521b83ba529a3bc
|
File details
Details for the file litellm_wzrd_momentum-0.3.1-py3-none-any.whl.
File metadata
- Download URL: litellm_wzrd_momentum-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7305ec1c4cda61bc32e6c4989925a18aefcc4aebac48a68201f3567a87e65c33
|
|
| MD5 |
d02766acadd1b129c865ed28d64ee929
|
|
| BLAKE2b-256 |
ee44f2692e4599310dc6252831ed9a36a0ed68d4ef9a82294abb7f46c8d42f19
|