Hermes hangs (no chat completion call) when provider: custom with LiteLLM proxy as base_url and Ollama models
Related: Possibly extends #7103 (dynamic model discovery) and #10011 (auto-discover models from custom provider endpoints).
Summary
When configuring Hermes Agent with provider: custom pointing to a LiteLLM proxy that fronts Ollama, Hermes performs Ollama/llama.cpp-style endpoint probing (/api/tags, /api/v1/models, /v1/props, /props, /version, /api/show). When all of those return 404 (which is the normal behavior of a generic OpenAI-compatible proxy like LiteLLM), Hermes silently hangs and never issues the actual POST /v1/chat/completions call, eventually hitting request_timeout (60–90s). The chat completion endpoint itself is fully functional — it is never reached.
This is the same silent-fail symptom previously seen when Hermes is invoked from Paperclip with the same provider configuration.
Environment
- Hermes Agent v0.13.0 (2026.5.7) — Windows
- Python 3.12.10, OpenAI SDK 2.24.0
- LiteLLM 1.84.0 (proxy at
http://localhost:4000/v1)
- Ollama 0.x (default port 11434,
qwen3:14b, gemma4:e4b loaded)
Hermes ~/.hermes/config.yaml (relevant section)
model:
default: openrouter/openrouter/free
provider: custom
base_url: http://localhost:4000/v1
api_key: sk-litellm-local-dummy
Reproduction
# Ollama running, qwen3:14b loaded
ollama list # NAME: qwen3:14b ...
# LiteLLM config has a working entry:
# - model_name: qwen3-14b
# litellm_params:
# model: openai/qwen3:14b
# api_base: http://localhost:11434/v1
# api_key: ollama
# Confirm LiteLLM proxy works directly (8–10s warm response):
curl -X POST http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-14b","messages":[{"role":"user","content":"hi"}]}'
# → 200 OK, valid completion
# Now invoke Hermes:
hermes chat -q "hi" -Q -m qwen3-14b
# → hangs ~60-90s, no response, exits with timeout
LiteLLM proxy access log during a Hermes invocation
GET /v1/models/qwen3-14b → 200 OK (model retrieve, works after specific entry added)
GET /v1/models → 200 OK (catalog)
GET /api/v1/models → 404 Not Found ← Ollama-style probing
GET /api/tags → 404 Not Found ← Ollama list models
GET /v1/props → 404 Not Found ← llama.cpp probing
GET /props → 404 Not Found ← llama.cpp
GET /version → 404 Not Found ← Ollama version
POST /api/show → 404 Not Found ← Ollama model info
# (No POST /v1/chat/completions is ever issued — Hermes gives up)
Workaround attempts (all fail)
--provider openai → Python Traceback (cli init error)
--provider openrouter → Python Traceback (cli.py:4474 in _init_agent)
--toolsets file (minimal) → same timeout
--ignore-user-config --ignore-rules → "Stripped provider prefix" warning + tries Codex (wrong provider)
- Adding specific
model_name: qwen3-14b and ollama_chat/qwen3:14b entries to LiteLLM config → model lookup succeeds (200) but Hermes still probes Ollama-native endpoints and hangs
Expected behavior
After receiving 200 OK on GET /v1/models (catalog) and/or GET /v1/models/<id>, Hermes should treat the endpoint as a standard OpenAI-compatible chat-completions backend and call POST /v1/chat/completions, regardless of whether /api/tags / /v1/props / /api/show return 404. The current behavior makes Hermes incompatible with the most common deployment pattern (Hermes → LiteLLM → Ollama).
Suggested fix
In the custom provider profile (plugins/model-providers/custom/__init__.py):
- If
GET /v1/models returns 200 with a valid JSON catalog (OpenAI-compatible shape), stop probing Ollama-native endpoints and proceed straight to POST /v1/chat/completions.
- Make the probing endpoints opt-in (env var like
HERMES_PROBE_OLLAMA_NATIVE=1) rather than the default.
- Or: when all probing returns 404, log a clear error ("not a known provider, falling back to OpenAI-compatible chat completions") and still call
/v1/chat/completions.
Why this matters
This is the canonical multi-provider routing stack documented across the AI agent ecosystem:
Hermes (any LLM) ──→ LiteLLM (router/fallback/budget) ──→ Ollama / OpenRouter / Claude / etc.
Currently the chain breaks at the Hermes → LiteLLM hop for Ollama backends, even when LiteLLM is perfectly functional and Ollama responds within 1 second on direct calls.
Hermes hangs (no chat completion call) when
provider: customwith LiteLLM proxy as base_url and Ollama modelsRelated: Possibly extends #7103 (dynamic model discovery) and #10011 (auto-discover models from custom provider endpoints).
Summary
When configuring Hermes Agent with
provider: custompointing to a LiteLLM proxy that fronts Ollama, Hermes performs Ollama/llama.cpp-style endpoint probing (/api/tags,/api/v1/models,/v1/props,/props,/version,/api/show). When all of those return 404 (which is the normal behavior of a generic OpenAI-compatible proxy like LiteLLM), Hermes silently hangs and never issues the actualPOST /v1/chat/completionscall, eventually hitting request_timeout (60–90s). The chat completion endpoint itself is fully functional — it is never reached.This is the same silent-fail symptom previously seen when Hermes is invoked from Paperclip with the same provider configuration.
Environment
http://localhost:4000/v1)qwen3:14b,gemma4:e4bloaded)Hermes
~/.hermes/config.yaml(relevant section)Reproduction
LiteLLM proxy access log during a Hermes invocation
Workaround attempts (all fail)
--provider openai→ PythonTraceback(cli init error)--provider openrouter→ PythonTraceback (cli.py:4474 in _init_agent)--toolsets file(minimal) → same timeout--ignore-user-config --ignore-rules→ "Stripped provider prefix" warning + tries Codex (wrong provider)model_name: qwen3-14bandollama_chat/qwen3:14bentries to LiteLLM config → model lookup succeeds (200) but Hermes still probes Ollama-native endpoints and hangsExpected behavior
After receiving
200 OKonGET /v1/models(catalog) and/orGET /v1/models/<id>, Hermes should treat the endpoint as a standard OpenAI-compatible chat-completions backend and callPOST /v1/chat/completions, regardless of whether/api/tags//v1/props//api/showreturn 404. The current behavior makes Hermes incompatible with the most common deployment pattern (Hermes → LiteLLM → Ollama).Suggested fix
In the
customprovider profile (plugins/model-providers/custom/__init__.py):GET /v1/modelsreturns 200 with a valid JSON catalog (OpenAI-compatible shape), stop probing Ollama-native endpoints and proceed straight toPOST /v1/chat/completions.HERMES_PROBE_OLLAMA_NATIVE=1) rather than the default./v1/chat/completions.Why this matters
This is the canonical multi-provider routing stack documented across the AI agent ecosystem:
Currently the chain breaks at the Hermes → LiteLLM hop for Ollama backends, even when LiteLLM is perfectly functional and Ollama responds within 1 second on direct calls.