hermes - 💡(How to fix) Fix [Performance] Ollama /api/show probe adds ~1.7s startup delay for non-Ollama providers

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…

When using any provider with a base_url (e.g. OpenRouter), get_model_context_length() unconditionally probes /api/show on the provider server, even for known non-Ollama providers like OpenRouter, OpenAI, Anthropic, etc.

OpenRouter returns HTTP 404 after ~1.2s (SSL handshake + server processing). This adds ~1.7s to every cold startup.

The probe is at agent/model_metadata.py:1665 — the condition is simply if base_url: with no provider filter.

Root Cause

When using any provider with a base_url (e.g. OpenRouter), get_model_context_length() unconditionally probes /api/show on the provider server, even for known non-Ollama providers like OpenRouter, OpenAI, Anthropic, etc.

OpenRouter returns HTTP 404 after ~1.2s (SSL handshake + server processing). This adds ~1.7s to every cold startup.

The probe is at agent/model_metadata.py:1665 — the condition is simply if base_url: with no provider filter.

Fix Action

Workaround

Users can patch agent/model_metadata.py locally by adding a provider check before the probe, but this is overwritten by hermes update.

Code Example

_query_ollama_api_show: 1.722s (single call, blocked on ssl.read x13)
RAW_BUFFERClick to expand / collapse

Description

When using any provider with a base_url (e.g. OpenRouter), get_model_context_length() unconditionally probes /api/show on the provider server, even for known non-Ollama providers like OpenRouter, OpenAI, Anthropic, etc.

OpenRouter returns HTTP 404 after ~1.2s (SSL handshake + server processing). This adds ~1.7s to every cold startup.

The probe is at agent/model_metadata.py:1665 — the condition is simply if base_url: with no provider filter.

Profiling Data

_query_ollama_api_show: 1.722s (single call, blocked on ssl.read x13)

Suggested Fix

Skip the Ollama probe when effective_provider is a known non-Ollama provider. Only probe when effective_provider is None, "", "ollama", or "ollama-cloud".

Impact

Reduces cold-start time by ~1.7s for OpenRouter, OpenAI, Anthropic, and other known providers.

Version

v0.14.0 (2026.5.16)

Workaround

Users can patch agent/model_metadata.py locally by adding a provider check before the probe, but this is overwritten by hermes update.

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

hermes - 💡(How to fix) Fix [Performance] Ollama /api/show probe adds ~1.7s startup delay for non-Ollama providers