fix(cli): clarify unverified custom model warning
This commit is contained in:
@@ -276,6 +276,12 @@ def _validate_custom(req: _Request) -> dict[str, Any]:
|
||||
if anthropic_style:
|
||||
message += ("\n Many Anthropic-compatible proxies do not implement the Models API (GET /v1/models). "
|
||||
"The model name has been accepted without verification.")
|
||||
if req.api_mode == "chat_completions":
|
||||
message += (
|
||||
"\n The model name was accepted without verification — inference may fail "
|
||||
"if this provider does not serve it. Check the provider's model catalog "
|
||||
"or model name."
|
||||
)
|
||||
if probe.get("suggested_base_url"):
|
||||
message += f"\n If this server expects `/v1`, try base URL: `{probe.get('suggested_base_url')}`"
|
||||
# Chat-completions and Anthropic-style proxies may both omit /v1/models.
|
||||
|
||||
@@ -836,6 +836,9 @@ class TestValidateCustomUnreachableFallback:
|
||||
assert result["persist"] is True
|
||||
assert result["recognized"] is False
|
||||
assert "could not reach" in result["message"]
|
||||
assert "accepted without verification" in result["message"]
|
||||
assert "inference may fail" in result["message"]
|
||||
assert "provider's model catalog" in result["message"]
|
||||
|
||||
def test_named_custom_chat_completions_accepted_when_unreachable(self):
|
||||
result = self._validate(
|
||||
@@ -846,6 +849,9 @@ class TestValidateCustomUnreachableFallback:
|
||||
assert result["persist"] is True
|
||||
assert result["recognized"] is False
|
||||
assert "could not reach" in result["message"]
|
||||
assert "accepted without verification" in result["message"]
|
||||
assert "inference may fail" in result["message"]
|
||||
assert "provider's model catalog" in result["message"]
|
||||
|
||||
def test_unreachable_warning_includes_suggested_base_url_hint(self):
|
||||
result = self._validate(
|
||||
@@ -854,6 +860,9 @@ class TestValidateCustomUnreachableFallback:
|
||||
)
|
||||
assert result["accepted"] is True
|
||||
assert "If this server expects `/v1`" in result["message"]
|
||||
assert "accepted without verification" in result["message"]
|
||||
assert "inference may fail" in result["message"]
|
||||
assert "provider's model catalog" in result["message"]
|
||||
|
||||
def test_anthropic_messages_fallback_unchanged(self):
|
||||
result = self._validate(
|
||||
|
||||
Reference in New Issue
Block a user