fix(desktop): onboarding can configure a local/custom endpoint without an API key - #38265
Closed
xxxigm wants to merge 2 commits into
Closed
fix(desktop): onboarding can configure a local/custom endpoint without an API key#38265xxxigm wants to merge 2 commits into
xxxigm wants to merge 2 commits into
Conversation
xxxigm
force-pushed
the
fix/desktop-onboarding-local-endpoint
branch
from
June 3, 2026 14:41
b905b82 to
86179fe
Compare
The runtime resolver reads model.base_url from config and ignores the OPENAI_BASE_URL env var, so a self-hosted endpoint could not be configured from the GUI. Two changes enable it: - POST /api/model/set accepts an optional base_url and persists it as model.base_url when provider=custom (still clearing stale base_url for hosted providers). - POST /api/providers/validate now returns the model ids a custom endpoint advertises at /v1/models, so the GUI can auto-pick a default without asking the user to type a model name. Refs desktop onboarding "Local / custom endpoint" bug.
…I changes Onboarding's "Local / custom endpoint" only wrote the OPENAI_BASE_URL env var, which runtime resolution ignores — so a self-hosted endpoint was never wired in and setup failed with "No usable credentials found for custom" even though local servers need no key. Route the local option through saveOnboardingLocalEndpoint: probe the endpoint, auto-discover a model from /v1/models, persist provider=custom + base_url + model via /api/model/set, then verify the runtime directly (not via completeWithModelConfirm, which would re-assign the model without base_url and wipe it). No onboarding form/UI changes — the existing single URL field is enough.
xxxigm
force-pushed
the
fix/desktop-onboarding-local-endpoint
branch
from
June 4, 2026 00:01
86179fe to
5c3d63b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes Hermes Desktop onboarding's Local / custom endpoint option actually work — including the common case where a self-hosted endpoint needs no API key — without any onboarding UI/form changes (the existing single URL field is enough).
The bug (from Discord support thread)
Selecting "Local / custom endpoint" failed with:
…and would not let the user continue, even though local LLM servers (vLLM, llama.cpp, Ollama, …) typically require no key.
Root cause
The onboarding "local" option only wrote the
OPENAI_BASE_URLenv var (saveOnboardingApiKey→setEnvVar). But runtime resolution deliberately ignoresOPENAI_BASE_URL—hermes_cli/runtime_provider.pyis explicit:So setting it did nothing: resolution fell through to the default provider (no key) and
setup.runtime_checkreported "No usable credentials found for custom". There was also no API path to persistmodel.base_urlfrom the GUI (/api/model/setactively cleared base_url).Changes Made
Backend (
hermes_cli/web_server.py)POST /api/model/setaccepts an optionalbase_url. Forprovider=customit persistsmodel.base_url(and echoes it back); for hosted providers it still clears any stale base_url. This is the missing primitive that wires a local endpoint into resolution.POST /api/providers/validatenow returns the model ids a custom endpoint advertises at/v1/models(tolerant of OpenAI/vLLM/llama.cpp shapes via_parse_model_ids), so the GUI can auto-pick a default.Frontend (
apps/desktop/src/…) — no onboarding form/UI changessaveOnboardingLocalEndpoint: probe the endpoint, auto-discover the model from/v1/models, persistprovider=custom+base_url+modelvia/api/model/set, then verify the runtime directly. It does not route throughcompleteWithModelConfirm, which would re-assign the model without a base_url and wipe it.ModelAssignmentRequest.base_url?, validate responsemodels?).How to Test
Manual: onboarding → "Local / custom endpoint" → paste
http://127.0.0.1:8000/v1→ Connect → model auto-discovered, no "No usable credentials" error, chatting works with no API key.Tests added
_parse_model_idstolerates OpenAI/bare/list shapes and never raises;/api/model/setpersists base_url forcustomand clears stale base_url for hosted providers.saveOnboardingLocalEndpointerrors when no models are advertised, auto-discovers + persistsprovider=custom+base_url+modeland completes, and surfaces the runtime reason on failure.Scope note
A Nous maintainer mentioned in the support thread they'd improve this onboarding experience. This PR is a focused, self-contained fix for the local/custom no-key path that leaves the onboarding UI untouched; happy to rebase/trim if it overlaps with in-flight work.