Skip to main content

Plan model fallback chains from capability, cost, and health data. Python port of @mukundakatta/model-fallback-planner.

Project description

model-fallback-planner-py

Plan model fallback chains from capability, cost, and health data. Pure Python, zero deps. Python port of @mukundakatta/model-fallback-planner.

pip install model-fallback-planner-py
from model_fallback_planner import plan_fallbacks, choose_fallback

models = [
    {"name": "claude-sonnet", "capabilities": ["chat", "tools"], "cost": 3, "priority": 5, "healthy": True},
    {"name": "claude-haiku", "capabilities": ["chat", "tools"], "cost": 1, "priority": 3, "healthy": True},
    {"name": "gpt-5", "capabilities": ["chat"], "cost": 5, "priority": 8, "healthy": True},
]

choose_fallback(models, capabilities=["tools"], max_cost=4)
# FallbackChoice(model={...claude-sonnet...}, chain=[...claude-sonnet, claude-haiku])

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

model_fallback_planner_py-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

model_fallback_planner_py-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file model_fallback_planner_py-0.1.0.tar.gz.

File metadata

File hashes

Hashes for model_fallback_planner_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3fa8bb344589c7c3f95a228c54ccfb88ab5f16e61adb282be6a2c30e5a75883
MD5 dcf66f7e1dcc75174df110359cbd828f
BLAKE2b-256 9f173bd67b632cab73f8ba1906e3929e86df126150509e70e69ab8444817a42e

See more details on using hashes here.

File details

Details for the file model_fallback_planner_py-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for model_fallback_planner_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63c5ae84f320b2040913896e3a55f07ce911fa781b4711ede4601ba670d329d2
MD5 f6d7fcc375418d902949d3b12075beb2
BLAKE2b-256 14c52ac6ff3dcb1bdbb505ff8bbcf24de363a19bdf289d2af62768fc630b38d2

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