NousResearch/hermes-agent · error · ValueError
Auxiliary compression model {aux_model} has a context window
Error message
Auxiliary compression model {aux_model} has a context window of {aux_context} tokens, which is below the minimum {MINIMUM_CONTEXT_LENGTH} required by Hermes Agent. Choose a compression model with at least {MINIMUM_CONTEXT_LENGTH // 1000}K context (set auxiliary.compression.model in config.yaml), or set auxiliary.compression.context_length to override the detected value if it is wrong. What it means
The model configured for auxiliary compression (auxiliary.compression.model in config.yaml) has a detected context window smaller than MINIMUM_CONTEXT_LENGTH (64,000 tokens, defined in agent/model_metadata.py). The compressor must be able to hold at least a full threshold-sized window of main-model content, and since the main model is already required to meet this floor, the compression model is held to the same standard at ConversationCompression setup time.
Source
Thrown at agent/conversation_compression.py:1698
aux_model,
base_url=aux_base_url,
api_key=aux_api_key,
config_context_length=getattr(agent, "_aux_compression_context_length_config", None),
# Each model must be resolved with its own provider so that
# provider-specific paths (e.g. Bedrock static table, OpenRouter API)
# are invoked for the correct client, not inherited from the main model.
provider=(_aux_cfg_provider if _aux_cfg_provider and _aux_cfg_provider != "auto" else getattr(agent, "provider", "")),
custom_providers=agent._custom_providers,
)
# Hard floor: the auxiliary compression model must have at least
# MINIMUM_CONTEXT_LENGTH (64K) tokens of context. The main model
# is already required to meet this floor (checked earlier in
# __init__), so the compression model must too — otherwise it
# cannot summarise a full threshold-sized window of main-model
# content. Mirrors the main-model rejection pattern.
if aux_context and aux_context < MINIMUM_CONTEXT_LENGTH:
raise ValueError(
f"Auxiliary compression model {aux_model} has a context "
f"window of {aux_context:,} tokens, which is below the "
f"minimum {MINIMUM_CONTEXT_LENGTH:,} required by Hermes "
f"Agent. Choose a compression model with at least "
f"{MINIMUM_CONTEXT_LENGTH // 1000}K context (set "
f"auxiliary.compression.model in config.yaml), or set "
f"auxiliary.compression.context_length to override the "
f"detected value if it is wrong."
)
threshold = agent.context_compressor.threshold_tokens
if aux_context < threshold:
# Auto-correct: lower the live session threshold so
# compression actually works this session. The hard floor
# above guarantees aux_context >= MINIMUM_CONTEXT_LENGTH,
# so the new threshold is always >= 64K.
#
# The compression summariser sends a single user-roleView on GitHub (pinned to c896c09c42)
Solutions
- Set auxiliary.compression.model to a model with at least 64K context (e.g. a modern flash-class model).
- If the detected value is wrong, override it explicitly: set auxiliary.compression.context_length in config.yaml to the true window size.
- Verify the provider profile / context-length catalog entry for the chosen model if you believe the detection is stale.
Example fix
# ~/.hermes/config.yaml
# before
auxiliary:
compression:
model: "old-8k-summarizer"
# after — either a bigger model…
auxiliary:
compression:
model: "gemini-2.5-flash"
# …or override the detected context length if it is wrong
auxiliary:
compression:
model: "old-8k-summarizer"
context_length: 128000 Defensive patterns
Strategy: validation
Validate before calling
# Before starting a session with a custom compression model, check the floor:
from agent.model_metadata import MINIMUM_CONTEXT_LENGTH # 64_000
assert detected_context >= MINIMUM_CONTEXT_LENGTH, (
f"compression model window {detected_context} < {MINIMUM_CONTEXT_LENGTH}") Try / catch
try:
compression = ConversationCompression(agent)
except ValueError as e:
if "below the minimum" in str(e):
# fix config (model or context_length override) and restart
... Prevention
- Pick compression models with documented 64K+ context
- Set auxiliary.compression.context_length when provider metadata is unreliable
- Validate custom provider profiles' context_length metadata before assigning them to compression
When it happens
Trigger: Setting auxiliary.compression.model to a small-context model (e.g. one with an 8K/16K/32K catalog entry) whose detected context_length is below 64,000. Raised in the compression setup path in agent/conversation_compression.py when aux_context is non-zero and below the floor.
Common situations: Config file pins an older or lightweight summarizer model with a small advertised window; a custom provider profile whose metadata lists a low context length; the auto-detected value is stale or wrong for a model that actually supports more.
Related errors
- Model {agent.model} has a context window of {_ctx:,} tokens,
- Hermes install at ${ACTIVE_HERMES_ROOT} is missing or incomp
- Git for Windows is required for Hermes on Windows (provides
- Hermes venv missing at ${VENV_ROOT}. Re-run the desktop inst
- Invalid profile name: ${value}
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/77906ba0621cdbe1.
Report an issue: GitHub.