Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.

Commit 847aa36

Browse files
yysjasmineclaude
andcommitted
configure-llm: let the user override the model ID during setup
The Linux / macOS interactive prompt accepted provider + API key but silently used defaults.json's default_model without ever asking the user. That shipped "nousresearch/hermes-3-llama-3.1-8b" as the OpenRouter default for every user — an uncommon choice that forces them to edit ~/.hermes/config.yaml after install just to pick a real model. Windows already showed an editable Model field per provider; now Linux / macOS match. Behavior: - Bundled provider (openrouter/openai/anthropic): prompt "Model ID [<default>]: " — Enter accepts default, any string overrides. - Custom endpoint: prompt is required (no default to fall back to) and whitespace-stripped. Loops until non-empty. No whitelist / validation — both Hermes and OpenClaw surface a clear "Unknown model" error at runtime if the id isn't recognized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c8bfaf1 commit 847aa36

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

linux/lib/configure-llm.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,50 @@ collect_llm_config() {
4343
read -rp "Choice [1]: " choice
4444
choice="${choice:-1}"
4545

46-
local provider base_url model
46+
local provider base_url default_model
4747
case "$choice" in
4848
1) provider="openrouter"
4949
base_url="$(_cfg "['llm_providers']['openrouter']['base_url']")"
50-
model="$(_cfg "['llm_providers']['openrouter']['default_model']")"
50+
default_model="$(_cfg "['llm_providers']['openrouter']['default_model']")"
5151
;;
5252
2) provider="openai"
5353
base_url="$(_cfg "['llm_providers']['openai']['base_url']")"
54-
model="$(_cfg "['llm_providers']['openai']['default_model']")"
54+
default_model="$(_cfg "['llm_providers']['openai']['default_model']")"
5555
;;
5656
3) provider="anthropic"
5757
base_url="$(_cfg "['llm_providers']['anthropic']['base_url']")"
58-
model="$(_cfg "['llm_providers']['anthropic']['default_model']")"
58+
default_model="$(_cfg "['llm_providers']['anthropic']['default_model']")"
5959
;;
6060
4) provider="custom"
6161
read -rp "Base URL: " base_url
62-
read -rp "Model name: " model
62+
default_model=""
6363
;;
6464
*) echo "Invalid choice, defaulting to OpenRouter."
6565
provider="openrouter"
6666
base_url="$(_cfg "['llm_providers']['openrouter']['base_url']")"
67-
model="$(_cfg "['llm_providers']['openrouter']['default_model']")"
67+
default_model="$(_cfg "['llm_providers']['openrouter']['default_model']")"
6868
;;
6969
esac
7070

71+
# Model ID: let the user override the default (e.g. "gpt-4o" instead of
72+
# "gpt-4o-mini", a specific OpenRouter route, a custom MiniMax id). We
73+
# intentionally accept any free-form string and don't whitelist — both
74+
# Hermes and OpenClaw will surface a clear error at runtime if the id
75+
# isn't recognized by the provider. For custom endpoints we require a
76+
# value (provider catalogs don't cover it); for bundled ones the default
77+
# is usable out of the box.
78+
local model=""
79+
echo ""
80+
if [ "$provider" = "custom" ]; then
81+
while [ -z "$model" ]; do
82+
read -rp "Model name (required for custom endpoint): " model
83+
model="$(printf '%s' "$model" | tr -d '[:space:]')"
84+
done
85+
else
86+
read -rp "Model ID [$default_model]: " model
87+
model="${model:-$default_model}"
88+
fi
89+
7190
local signup_url
7291
signup_url="$(_cfg "['llm_providers']['$provider']['signup_url']")"
7392
if [ -n "$signup_url" ]; then

0 commit comments

Comments
 (0)