Skip to content

Add LOCAL_PROVIDER_DEFAULT_ENDPOINTS canonical default endpoints#5

Merged
wch merged 5 commits into
mainfrom
local-provider-default-endpoints
Jul 9, 2026
Merged

Add LOCAL_PROVIDER_DEFAULT_ENDPOINTS canonical default endpoints#5
wch merged 5 commits into
mainfrom
local-provider-default-endpoints

Conversation

@wch

@wch wch commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Changes for posit-dev/assistant#1587:

  1. Canonical default endpoints for Ollama and LM Studio (LOCAL_PROVIDER_DEFAULT_ENDPOINTS), exported from the local-providers subpath entrypoint only (kept off the browser-reachable root entrypoint).
  2. LM Studio endpoints now include /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 (default http://localhost:1234/v1) and clients trust it as given. lmstudio joins KNOWN_HOSTS in base-url.ts; the bare default host is corrected at the config read seam — LocalProviderManager.getEndpoint for stored values (back-compat with previously stored bare endpoints) and testLMStudioProvider for raw pre-save input. This replaces the old behavior where LMStudioClient appended /v1 itself, which combined with the /v1-suffixed ai-config default to produce /v1/v1 URLs. 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.

wch added 5 commits July 8, 2026 17:39
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
@wch
wch merged commit a69a1e8 into main Jul 9, 2026
1 check passed
@wch
wch deleted the local-provider-default-endpoints branch July 9, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant