Compare commits

...

1 Commits

Author SHA1 Message Date
cokemine
fe2bf02b57 fix(models): correct probed_url selection logic
Updated the logic for determining the probed_url in the probe_api_models function to use the first tried URL instead of the last. This change ensures that the most relevant URL is returned when probing for models. Additionally, improved the output message in the _model_flow_custom function to provide clearer guidance based on the suggested_base_url.
2026-04-09 02:26:38 -07:00
2 changed files with 6 additions and 2 deletions

View File

@@ -1474,7 +1474,11 @@ def _model_flow_custom(config):
f"Hermes will still save it." f"Hermes will still save it."
) )
if probe.get("suggested_base_url"): if probe.get("suggested_base_url"):
print(f" If this server expects /v1, try base URL: {probe['suggested_base_url']}") suggested = probe["suggested_base_url"]
if suggested.endswith("/v1"):
print(f" If this server expects /v1 in the path, try base URL: {suggested}")
else:
print(f" If /v1 should not be in the base URL, try: {suggested}")
# Select model — use probe results when available, fall back to manual input # Select model — use probe results when available, fall back to manual input
model_name = "" model_name = ""

View File

@@ -1532,7 +1532,7 @@ def probe_api_models(
return { return {
"models": None, "models": None,
"probed_url": tried[-1] if tried else normalized.rstrip("/") + "/models", "probed_url": tried[0] if tried else normalized.rstrip("/") + "/models",
"resolved_base_url": normalized, "resolved_base_url": normalized,
"suggested_base_url": alternate_base if alternate_base != normalized else None, "suggested_base_url": alternate_base if alternate_base != normalized else None,
"used_fallback": False, "used_fallback": False,