feat: self-hosted providers — connection test + model discovery (#3260)#3409
Closed
theherrovn-sys wants to merge 6 commits into
Closed
feat: self-hosted providers — connection test + model discovery (#3260)#3409theherrovn-sys wants to merge 6 commits into
theherrovn-sys wants to merge 6 commits into
Conversation
…uena#3260) Add Settings → Providers cards for Ollama, LM Studio, and custom OpenAI-compatible endpoints with base URL probe, model selection, and optional API key. Persist via POST /api/providers/self-hosted without rerunning onboarding; keep local Ollama independent of OLLAMA_API_KEY used for Ollama Cloud (nesquena#1410).
Fix ja/zh/tr/it/pt/fr/zh-Hant locale parity tests after providers panel keys were only added to English fallback blocks.
Split self-hosted cards onto a separate filter line so panels.js still contains filter(p=>p.configurable||p.is_oauth||p.is_custom) (nesquena#1202, nesquena#3260).
…ed cards (nesquena#3260) Implements GPT 5.5 provider adapter architecture on top of PR nesquena#3406: - New api/provider_adapters.py with test_connection() and list_models() for Ollama (GET /api/tags), LM Studio (GET /v1/models), and custom OpenAI-compatible endpoints (GET /models). Includes 5-min TTL cache. - New API routes: GET /api/providers/test?provider=&base_url= and GET /api/providers/models?provider=&base_url=&refresh=true. - Enhanced Settings → Providers self-hosted cards with: * "Test Connection" button → validates connectivity, shows status banner * Per-card status indicator (✅ connected / ❌ failed / ⏳ testing) * Gray-out + red border when server is unreachable * Model discovery dropdown populated from live provider API * Model refresh ↻ button for re-discovering models on demand * Graceful fallback — offline servers show clear error, never crash Verified on real NVIDIA DGX Atom (GB10, SM121, aarch64) with Ollama serving 15 models on port 11434.
Added _normalize_base_url() helper that strips trailing /v1 suffix before constructing endpoint URLs, preventing double paths like /v1/v1/models when user supplies base URL ending in /v1. Applied to: _lmstudio_test_connection, _lmstudio_list_models, _custom_test_connection, _custom_list_models Verified on DGX Atom with Ollama (15 models, /api/tags).
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.
Summary
Layers provider adapter architecture with live connection testing on top of PR #3406 (the maintainer-preferred broader base) to add live connection testing and model discovery for Ollama, LM Studio, and custom OpenAI-compatible endpoints in Settings -> Providers.
Architecture
1. Provider adapter module (
api/provider_adapters.py)test_connection(provider_id, base_url)-> probes connectivity, returns{ok, endpoint, error, tested_at}list_models(provider_id, base_url, refresh=False)-> discovers models with 5-min TTL cacheGET {root}/api/tags(strips/v1suffix to reach native API)GET {base_url}/v1/modelsGET {base_url}/models2. New API endpoints (
api/routes.py)GET /api/providers/test?provider=ollama&base_url=http://localhost:11434/v1-> connection testGET /api/providers/models?provider=ollama&base_url=...&refresh=true-> model discovery3. Enhanced Settings UI (
static/panels.js)4. CSS (
static/style.css).provider-card-connected/.provider-card-failed/.provider-card-testingstates.provider-card-conn-status- inline emoji indicator.provider-card-refresh-btn- model refresh button stylingHardware Verified
Tested on real NVIDIA DGX Atom (GB10 Grace Blackwell):
Changes from PR #3406
This branch is directly rebased on PR #3406 (4 commits including the self-hosted providers base). Our new commits add:
api/provider_adapters.pyapi/routes.pystatic/panels.jsstatic/style.cssRelated