fix: extend invalid-model hint for qwen prefix to mention local Ollama path

When users type bare qwen model names (e.g., qwen3.5:9b), the validator
already suggested qwen/ prefix for DashScope. Now it also documents the
local Ollama path: use openai/ prefix with OPENAI_BASE_URL and
OPENAI_API_KEY=ollama.

This addresses the confusion observed when debugging Ollama integration
after the upstream merge, where users might follow the DashScope hint
but actually want to run models locally via Ollama.
This commit is contained in:
root 2026-04-24 11:12:04 +09:00 committed by Heo, Sung
parent eaa2e320d9
commit d1b9e4598c
1 changed files with 5 additions and 0 deletions

View File

@ -2943,6 +2943,11 @@ fn validate_model_syntax(model: &str) -> Result<(), String> {
err_msg.push_str("\nDid you mean `qwen/");
err_msg.push_str(trimmed);
err_msg.push_str("`? (Requires DASHSCOPE_API_KEY env var)");
err_msg.push_str("\nOr for a local Ollama server: use `openai/");
err_msg.push_str(trimmed);
err_msg.push_str(
"` with OPENAI_BASE_URL=http://127.0.0.1:11434/v1 and OPENAI_API_KEY=ollama",
);
} else if trimmed.starts_with("grok") {
err_msg.push_str("\nDid you mean `xai/");
err_msg.push_str(trimmed);