enable model discovery for local Ollama BYOK providers - #6079
Conversation
|
Hey @dpeterson01 — keeping Ollama discovery loopback-only while reusing the existing fetch-model flow is a nice, well-scoped direction for this PR. Since this touches user-facing model selection, I’ve marked it for a manual QA pass before merge; we’ll loop that in once it’s merge-ready. |
9d9de2a to
f959caa
Compare
PerishCode
left a comment
There was a problem hiding this comment.
@dpeterson01 I reviewed the complete changed ranges across the daemon discovery path and all four web model-selection entry points. The implementation keeps discovery loopback-only, preserves the existing SSRF validation boundary, avoids requiring credentials for local /api/tags, rejects cloud Ollama before upstream egress, and includes focused coverage for the daemon response plus the web support gates. The state and cache-key wiring remain consistent with the existing provider-model flow. Nice, well-contained addition—thanks for carrying the behavior through each user-facing picker.
|
CI block tracked in #6289 — the |
|
Thanks for the pointer — understood. We'll treat the current block as the runner-pool issue tracked in #6289 rather than anything specific to this diff, and keep this PR parked until the |
Wire up daemon provider-model discovery for the ollama protocol (GET /api/tags + response parser), gated to local/loopback base URLs so Ollama Cloud keeps its existing unsupported fallback. Remove the frontend short-circuits that blocked Fetch models for local Ollama across onboarding, settings, the inline switcher, and the avatar menu, reusing the existing isLocalOllamaBaseUrl helper. Local Ollama needs no API key. Adds daemon and web tests.
f959caa to
ba4e978
Compare
|
Rebased onto current One transparency note: I couldn't run the test suite for this rebase. My build box is offline and my current network is blocking the npm registry, so |
Fixes #6077
Why
I hit this running Open Design against a local Ollama server through BYOK: every other provider protocol can pull its catalogue with "Fetch models," but Ollama couldn't, even though Ollama exposes a discovery endpoint (
GET /api/tags). The button was disabled and the daemon returnedunsupported_ollama, so I had to type each model id by hand.Per the discussion in #6077 with @lefarcen, this keeps the scope to local Ollama only (loopback base URLs). Ollama Cloud (
ollama.com) keeps its existing "not available" fallback. Remote/LAN andhost.docker.internalare left as a separate future expansion.What users will see
When the Ollama Base URL is a loopback host (
localhost/127.0.0.1/::1), the Fetch models button is now enabled and populates the model picker from the running Ollama's installed models. No API key is required for local Ollama. Nothing changes for Ollama Cloud, which still shows the existing unsupported message. The behavior is consistent across the surfaces that offer model discovery: onboarding BYOK, Settings, the inline model switcher, and the avatar menu.Surface area
POST /api/provider/models. The daemon now supports theollamaprotocol there (loopback-gated) and no longer requires an API key for local Ollama discoveryScreenshots
Onboarding → Bring your own key → Ollama, local base URL. After Fetch models, the picker lists the installed models pulled from

/api/tags:Bug fix verification
Not a bug fix, but the change is covered by falsifiable tests:
apps/daemon/tests/connection-test.test.ts: local Ollama lists models from/api/tags; Ollama Cloud is rejected as unsupported without calling upstream fetch.apps/web/tests/components/SettingsDialog.test.ts:canFetchProviderModels/isProviderModelDiscoveryUnsupportedreturn the expected results for loopback vs cloud Ollama.Validation
pnpm --filter @open-design/daemon exec vitest run tests/connection-test.test.ts: 158/158pnpm --filter @open-design/web test: 4762 passed, 7 skippedpnpm guard: passpnpm typecheck(root, all workspaces): passImplementation notes
apps/daemon/src/integrations/provider-models.ts): added an Ollama/api/tagsURL, a response parser, and a loopback-only guard so cloud endpoints keep the existing unsupported result.apps/daemon/src/routes/chat.ts):POST /api/provider/modelsrequired an API key for every protocol except AIHubMix/Bedrock; local Ollama is now also exempt since/api/tagsis unauthenticated.isLocalOllamaBaseUrlhelper (apps/web/src/utils/byokProvider.ts), so the loopback definition stays in one place.