feat: warn users when loading non-agentic Hermes LLM models (#5378)

Nous Research Hermes 3 & 4 models lack tool-calling capabilities and
are not suitable for agent workflows. Add a warning that fires in two
places:

- /model switch (CLI + gateway) via model_switch.py warning_message
- CLI session startup banner when the configured model contains 'hermes'

Both paths suggest switching to an agentic model (Claude, GPT, Gemini,
DeepSeek, etc.).
This commit is contained in:
Teknium 2026-04-05 18:41:03 -07:00 committed by GitHub
parent e9ddfee4fd
commit fc15f56fc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 1 deletions

16
cli.py
View file

@ -2358,6 +2358,22 @@ class HermesCLI:
"[dim] Fix: Set model.context_length in config.yaml, or increase your server's context setting[/]"
)
# Warn if the configured model is a Nous Hermes LLM (not agentic)
model_name = getattr(self, "model", "") or ""
if "hermes" in model_name.lower():
self.console.print()
self.console.print(
"[bold yellow]⚠ Nous Research Hermes 3 & 4 models are NOT agentic and are not "
"designed for use with Hermes Agent.[/]"
)
self.console.print(
"[dim] They lack tool-calling capabilities required for agent workflows. "
"Consider using an agentic model (Claude, GPT, Gemini, DeepSeek, etc.).[/]"
)
self.console.print(
"[dim] Switch with: /model sonnet or /model gpt5[/]"
)
self.console.print()
def _preload_resumed_session(self) -> bool:

View file

@ -51,6 +51,25 @@ from agent.models_dev import (
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Non-agentic model warning
# ---------------------------------------------------------------------------
_HERMES_MODEL_WARNING = (
"Nous Research Hermes 3 & 4 models are NOT agentic and are not designed "
"for use with Hermes Agent. They lack the tool-calling capabilities "
"required for agent workflows. Consider using an agentic model instead "
"(Claude, GPT, Gemini, DeepSeek, etc.)."
)
def _check_hermes_model_warning(model_name: str) -> str:
"""Return a warning string if *model_name* looks like a Hermes LLM model."""
if "hermes" in model_name.lower():
return _HERMES_MODEL_WARNING
return ""
# ---------------------------------------------------------------------------
# Model aliases -- short names -> (vendor, family) with NO version numbers.
# Resolved dynamically against the live models.dev catalog.
@ -619,6 +638,14 @@ def switch_model(
# --- Get full model info from models.dev ---
model_info = get_model_info(target_provider, new_model)
# --- Collect warnings ---
warnings: list[str] = []
if validation.get("message"):
warnings.append(validation["message"])
hermes_warn = _check_hermes_model_warning(new_model)
if hermes_warn:
warnings.append(hermes_warn)
# --- Build result ---
return ModelSwitchResult(
success=True,
@ -628,7 +655,7 @@ def switch_model(
api_key=api_key,
base_url=base_url,
api_mode=api_mode,
warning_message=validation.get("message") or "",
warning_message=" | ".join(warnings) if warnings else "",
provider_label=provider_label,
resolved_via_alias=resolved_alias,
capabilities=capabilities,