OpenAIProvider::kimi / ::zai / ::minimax differ only by base_url; provider() reports "openai" and the native model ids carry no vendor prefix (kimi-k2.5, glm-5, MiniMax-M2.5). Budget pricing candidates therefore never reach the feeds' vendor-keyed rows (("moonshotai","kimi-k2.5") etc.), and the static table files those models under slugs — so a feed-only native-endpoint model prices to None and can never trip max_cost_usd (documented fail-open; no wrong price is ever produced).
A model-id prefix map (kimi-* → moonshotai, …) was considered and rejected: a wrong vendor guess silently prices a run at another vendor's rate.
The localized, authoritative fix: the vendor IS known at construction from base_url (the BASE_URL_KIMI/BASE_URL_ZAI/BASE_URL_MINIMAX constants exist, and code already branches on base_url.contains("api.z.ai")). Add an additive, defaulted trait method on LlmProvider:
fn pricing_key(&self) -> Option<(String, String)> { None }
overridden by OpenAIProvider only when its base_url is one of those endpoints (e.g. ("moonshotai", "kimi-k2.5")), threaded into the budget the same way the cost estimator was (TurnContext + the contextless checks). Re-keys nothing in the static table; changes no audit/wire provenance.
Adjacent (same underlying gap — provenance does not name the serving backend): wrapper provenance for FallbackProvider/ModelRouter, documented as a residual on PR #368.
Refs: PR #368 (source-major pricing lookup), issue #356.
OpenAIProvider::kimi/::zai/::minimaxdiffer only bybase_url;provider()reports"openai"and the native model ids carry no vendor prefix (kimi-k2.5,glm-5,MiniMax-M2.5). Budget pricing candidates therefore never reach the feeds' vendor-keyed rows (("moonshotai","kimi-k2.5")etc.), and the static table files those models under slugs — so a feed-only native-endpoint model prices toNoneand can never tripmax_cost_usd(documented fail-open; no wrong price is ever produced).A model-id prefix map (kimi-* → moonshotai, …) was considered and rejected: a wrong vendor guess silently prices a run at another vendor's rate.
The localized, authoritative fix: the vendor IS known at construction from
base_url(theBASE_URL_KIMI/BASE_URL_ZAI/BASE_URL_MINIMAXconstants exist, and code already branches onbase_url.contains("api.z.ai")). Add an additive, defaulted trait method onLlmProvider:overridden by
OpenAIProvideronly when its base_url is one of those endpoints (e.g.("moonshotai", "kimi-k2.5")), threaded into the budget the same way the cost estimator was (TurnContext + the contextless checks). Re-keys nothing in the static table; changes no audit/wire provenance.Adjacent (same underlying gap — provenance does not name the serving backend): wrapper provenance for FallbackProvider/ModelRouter, documented as a residual on PR #368.
Refs: PR #368 (source-major pricing lookup), issue #356.