Add LOCAL_PROVIDER_DEFAULT_ENDPOINTS canonical default endpoints#5
Merged
Conversation
Canonical default endpoints for Ollama and LM Studio, exported from the local-providers subpath entrypoint only (not the browser-reachable root). LM Studio is the bare server root -- LMStudioClient appends /v1 itself.
LMStudioClient appends /v1 itself (and the model fetcher joins v1/models), so the /v1-suffixed default produced /v1/v1 URLs wherever the catalog default reached the client. Converges on the same bare-root shape as LOCAL_PROVIDER_DEFAULT_ENDPOINTS.
The configured endpoint now carries the version segment (default http://localhost:1234/v1), like other OpenAI-compatible providers, instead of the client appending /v1 itself. All three consumers (LMStudioClient, the model fetcher, testLMStudioProvider) use normalizeProviderBaseUrl, so the exact bare default host still gets /v1 appended for backward compatibility with previously stored endpoints. Ollama is unchanged: its client uses the native API (/api/...) where no version segment exists.
Main's #4 moved bare-host correction out of the clients: base-url.ts owns the policy and clients trust URLs as given. The merge silently removed the bare-host courtesy from normalizeProviderBaseUrl, which CI caught in provider-test.test.ts. - Add lmstudio to KNOWN_HOSTS (LMSTUDIO_HOST/LMSTUDIO_API_VERSION in base-url.ts, re-exported from LMStudioClient for provider modules) - LMStudioClient no longer normalizes; endpoint trusted as given - The config read seam for stored endpoints is LocalProviderManager .getEndpoint, which corrects a stored bare default host to /v1 so previously stored values keep working - testLMStudioProvider corrects raw pre-save user input the same way
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.
Changes for posit-dev/assistant#1587:
LOCAL_PROVIDER_DEFAULT_ENDPOINTS), exported from thelocal-providerssubpath entrypoint only (kept off the browser-reachable root entrypoint)./v1(fixes posit-dev/assistant#1760), following the same convention as other OpenAI-compatible base URLs and Move bare-host base URL correction out of the clients into a public helper #4's architecture: the configured endpoint carries the version segment (defaulthttp://localhost:1234/v1) and clients trust it as given. lmstudio joinsKNOWN_HOSTSinbase-url.ts; the bare default host is corrected at the config read seam —LocalProviderManager.getEndpointfor stored values (back-compat with previously stored bare endpoints) andtestLMStudioProviderfor raw pre-save input. This replaces the old behavior whereLMStudioClientappended/v1itself, which combined with the/v1-suffixed ai-config default to produce/v1/v1URLs. Ollama is unchanged (native/api/...API, bare root).Includes a merge of main (#4's base-url policy refactor), whose semantic conflict with the original client-side normalization was caught by CI on the merge commit.