Problem
ModelInfo.from_openrouter turns OpenRouter's variable price ("-1") and missing prices into 0.0. Such a model then:
- passes any
Limits(max_cost_usd=...), including a cap of $0
- is described to Jev as
$0.00/M, so it looks like the cheapest choice
Live examples today: openrouter/auto, openrouter/fusion, openrouter/pareto-code (variable), plus models priced per request or per output type rather than per token.
Reproduce
from model_router import ModelInfo
m = ModelInfo.from_openrouter({"id": "x/y", "context_length": 100000,
"pricing": {"prompt": "-1", "completion": "-1"}})
m.cost(10_000, 1_000) # 0.0
Suggested fix
- Store unknown prices as
None instead of 0.0
ModelInfo.cost() returns None when a price is unknown
Router._reject_reason: when max_cost_usd is set, reject models with an unknown cost ("price unknown")
jev._describe: print price unknown instead of $0.00
Done when
Problem
ModelInfo.from_openrouterturns OpenRouter's variable price ("-1") and missing prices into0.0. Such a model then:Limits(max_cost_usd=...), including a cap of $0$0.00/M, so it looks like the cheapest choiceLive examples today:
openrouter/auto,openrouter/fusion,openrouter/pareto-code(variable), plus models priced per request or per output type rather than per token.Reproduce
Suggested fix
Noneinstead of0.0ModelInfo.cost()returnsNonewhen a price is unknownRouter._reject_reason: whenmax_cost_usdis set, reject models with an unknown cost ("price unknown")jev._describe: printprice unknowninstead of$0.00Done when
tests/test_models.pyandtests/test_router.py