Skip to main content

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 (or chat, 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

litellm_wzrd_momentum-0.3.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litellm_wzrd_momentum-0.3.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file litellm_wzrd_momentum-0.3.0.tar.gz.

File metadata

  • Download URL: litellm_wzrd_momentum-0.3.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for litellm_wzrd_momentum-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f2bc3cf44b27e683e8f57d69d7b58fa641b29d22b553dd60edac5ef51699b624
MD5 475d9d959a9ec6d00343e9f859728bde
BLAKE2b-256 16d579b5dfe8e85e35aa70cb7b90071a78da37984beb1e77588ec1817ac9f5c9

See more details on using hashes here.

File details

Details for the file litellm_wzrd_momentum-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for litellm_wzrd_momentum-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae6cf856891bd9f82473d87b76f59012787e29463b3c969cfeaa65422c0a77a
MD5 3629b642985a90d824678f3803bc23c8
BLAKE2b-256 399dbec56b4f683e4442f932316750042ee87d7603a47ebc10cb276032040b5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page