Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hermes_cli/model_cost_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ def expensive_model_warning(
if not model:
return None

# Custom providers (custom:xxx) use their own pricing that differs from
# the models.dev catalog (which stores OpenRouter prices). Triggering
# the expensive-model warning on inaccurate catalog data blocks model
# switching silently — skip the check entirely for custom providers.
# See #54348.
if provider and provider.startswith("custom:"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This excludes only named custom:<name> providers. The current switch path also deliberately supports the bare custom endpoint (hermes_cli/model_switch.py:1155,1208), so it can still reach this guard; include provider == "custom" as well.

return None

input_cost, output_cost, source = _pricing_from_model_info(model_info)
if input_cost is None and output_cost is None and provider:
try:
Expand Down