hermes - 💡(How to fix) Fix Support `provider` routing for custom providers (e.g. Polza.ai) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

What would you like Hermes to be able to do?

Allow providers_allowed, providers_ignored, providers_order, and provider_sort to be passed as extra_body.provider for custom providers, not just OpenRouter.

Why is this useful?

Polza.ai (an officially documented Hermes integration) supports an OpenRouter-compatible provider field in the request body to select upstream providers: { "model": "openai/gpt-4o", "provider": { "only": ["OpenAI"], "ignore": ["DeepInfra"], "order": ["Anthropic", "OpenAI"], "sort": "price" }

This is critical when a model is served by multiple upstream providers and the user wants to pin a specific one (for pricing, latency, or reliability reasons).

Where is the gap?

In agent/transports/chat_completions.py, the build_kwargs legacy path already assembles _prefs dict from providers_allowed/providers_ignored/providers_order/provider_sort in run_agent.py.

But this line only writes extra_body["provider"] for OpenRouter:

if provider_prefs and is_openrouter: extra_body["provider"] = provider_prefs For custom providers (is_custom_provider), the prefs dict is silently discarded.

Proposed fix

Change the condition to also include custom providers:

if provider_prefs and (is_openrouter or is_custom_provider): extra_body["provider"] = provider_prefs The is_custom_provider flag is already computed and passed in params. This is a one-line change.

Additional context

This also aligns with _build_kwargs_from_profile which already pipes provider_preferences through profile.build_extra_body() — the gap is only in the legacy custom-provider path. Any OpenRouter-compatible aggregator (Polza.ai and similar) would benefit from this.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING