Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions agent/auxiliary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def _fixed_temperature_for_model(model: Optional[str]) -> Optional[float]:
_PROVIDER_VISION_MODELS: Dict[str, str] = {
"xiaomi": "mimo-v2-omni",
"zai": "glm-5v-turbo",
"nous": "xiaomi/mimo-v2-omni",
}

# OpenRouter app attribution headers
Expand Down Expand Up @@ -908,14 +909,23 @@ def _try_nous(vision: bool = False) -> Tuple[Optional[OpenAI], Optional[str]]:
model = _NOUS_MODEL
# Free-tier users can't use paid auxiliary models — use the free
# models instead: mimo-v2-omni for vision, mimo-v2-pro for text tasks.
# For vision tasks, always use mimo-v2-omni regardless of tier —
# Nous inference API does not support image inputs for gemini models.
try:
from hermes_cli.models import check_nous_free_tier
if check_nous_free_tier():
model = _NOUS_FREE_TIER_VISION_MODEL if vision else _NOUS_FREE_TIER_AUX_MODEL
logger.debug("Free-tier Nous account — using %s for auxiliary/%s",
model, "vision" if vision else "text")
elif vision:
model = _NOUS_FREE_TIER_VISION_MODEL
logger.debug("Nous vision task — using %s (gemini models lack "
"image support on Nous inference API)", model)
except Exception:
pass
if vision:
model = _NOUS_FREE_TIER_VISION_MODEL
if vision:
logger.debug("Nous vision: final model = %s", model)
return (
OpenAI(
api_key=_nous_api_key(nous),
Expand Down Expand Up @@ -1552,7 +1562,13 @@ def _wrap_if_needed(client_obj, final_model_str: str, base_url_str: str = ""):

# ── Nous Portal (OAuth) ──────────────────────────────────────────
if provider == "nous":
client, default = _try_nous()
# Detect vision tasks: either explicit model override from
# _PROVIDER_VISION_MODELS, or caller passed a known vision model.
_is_vision = (
model in _PROVIDER_VISION_MODELS.values()
or (model or "").strip().lower() == "mimo-v2-omni"
)
client, default = _try_nous(vision=_is_vision)
if client is None:
logger.warning("resolve_provider_client: nous requested "
"but Nous Portal not configured (run: hermes auth)")
Expand Down