From b7590bcee54eb1568a690ea05701f40c5e8f755d Mon Sep 17 00:00:00 2001 From: jerilynzheng Date: Sun, 15 Mar 2026 22:36:47 -0700 Subject: [PATCH] feat: add AI Gateway to hermes model CLI and model metadata Wire AI Gateway into the interactive model selection menu and add context lengths for AI Gateway model IDs in model_metadata.py. --- agent/model_metadata.py | 9 +++++++++ hermes_cli/main.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/agent/model_metadata.py b/agent/model_metadata.py index a609ea030a..755bc81b09 100644 --- a/agent/model_metadata.py +++ b/agent/model_metadata.py @@ -40,6 +40,8 @@ DEFAULT_CONTEXT_LENGTHS = { "anthropic/claude-opus-4.6": 200000, "anthropic/claude-sonnet-4": 200000, "anthropic/claude-sonnet-4-20250514": 200000, + "anthropic/claude-sonnet-4.5": 200000, + "anthropic/claude-sonnet-4.6": 200000, "anthropic/claude-haiku-4.5": 200000, # Bare Anthropic model IDs (for native API provider) "claude-opus-4-6": 200000, @@ -50,11 +52,18 @@ DEFAULT_CONTEXT_LENGTHS = { "claude-opus-4-20250514": 200000, "claude-sonnet-4-20250514": 200000, "claude-haiku-4-5-20251001": 200000, + "openai/gpt-5": 128000, + "openai/gpt-4.1": 1047576, + "openai/gpt-4.1-mini": 1047576, "openai/gpt-4o": 128000, "openai/gpt-4-turbo": 128000, "openai/gpt-4o-mini": 128000, + "google/gemini-3-pro-preview": 1048576, + "google/gemini-3-flash": 1048576, + "google/gemini-2.5-flash": 1048576, "google/gemini-2.0-flash": 1048576, "google/gemini-2.5-pro": 1048576, + "deepseek/deepseek-v3.2": 65536, "meta-llama/llama-3.3-70b-instruct": 131072, "deepseek/deepseek-chat-v3": 65536, "qwen/qwen-2.5-72b-instruct": 32768, diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 15f546cb1d..006551e5f4 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -760,6 +760,7 @@ def cmd_model(args): active = "custom" provider_labels = { + "ai-gateway": "AI Gateway", "openrouter": "OpenRouter", "nous": "Nous Portal", "openai-codex": "OpenAI Codex", @@ -779,6 +780,7 @@ def cmd_model(args): # Step 1: Provider selection — put active provider first with marker providers = [ + ("ai-gateway", "AI Gateway (Vercel — 200+ models, pay-per-use)"), ("openrouter", "OpenRouter (100+ models, pay-per-use)"), ("nous", "Nous Portal (Nous Research subscription)"), ("openai-codex", "OpenAI Codex"), @@ -855,7 +857,7 @@ def cmd_model(args): _model_flow_anthropic(config, current_model) elif selected_provider == "kimi-coding": _model_flow_kimi(config, current_model) - elif selected_provider in ("zai", "minimax", "minimax-cn"): + elif selected_provider in ("zai", "minimax", "minimax-cn", "ai-gateway"): _model_flow_api_key_provider(config, selected_provider, current_model)