Add OpenAI-compatible custom endpoints (Ollama, vLLM, etc.)#14
Open
mfellner wants to merge 4 commits intominghinmatthewlam:mainfrom
Open
Add OpenAI-compatible custom endpoints (Ollama, vLLM, etc.)#14mfellner wants to merge 4 commits intominghinmatthewlam:mainfrom
mfellner wants to merge 4 commits intominghinmatthewlam:mainfrom
Conversation
Register Ollama, vLLM, or other OpenAI-compatible servers from Settings → Providers. Endpoints are stored under ~/.pi/agent/models.json via a new CustomProviderStore in pi-sdk-driver (atomic writes, placeholder API key when auth is not required). Driver rejects IDs that collide with built-in API-key or OAuth providers; URL validation parses with the URL constructor. Main-process probe handler uses Electron net.fetch to list /models with a 5s timeout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A disabled "Managed externally" button on environment-variable and models.json-override provider rows was visual noise. Render no action cell when the provider can't be managed from the app; keep the description text that already explains the state. Update the two provider-settings specs that asserted on the disabled button to check that the control cell is absent instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verify the feature end-to-end on the Electron surface: seeded workspace with no existing custom providers, drive Settings → Providers → Custom endpoints → Add, fill the form with a manual model ID, assert the entry renders and ~/.pi/agent/models.json round-trips the expected provider config. Also exercise edit and delete. A second spec covers collision-with-existing-provider validation, invalid base URL rejection, and ESC dismiss. No probe coverage here — the Detect-models flow makes a real HTTP request and belongs in a live/native spec; add later. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@mfellner is attempting to deploy a commit to the dev Team on Vercel. A member of the Team first needs to authorize it. |
# Conflicts: # packages/pi-sdk-driver/src/runtime-deps.ts
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.
Hey! This one scratches a personal itch. I wanted to point pi-gui at my local Ollama without hand-editing models.json, and
it turned into a general "add any OpenAI-compatible server from the settings pane" thing. Should also cover vLLM, LM
Studio, and similar setups. Happy to iterate on the UX if anything feels off.
Summary
any
/v1-style endpoint). Backed by a newCustomProviderStoreinpi-sdk-driverthat atomically writes entries into~/.pi/agent/models.jsonand surfaces them through the existingRuntimeSupervisorsnapshot.GET /models) flows, with validation against provider-ID collisions (both API-key andOAuth built-ins) and
URL-parsed base URLs. Non-auth servers like Ollama save with an"unused"placeholder key so thestorage format stays happy.
models.json-override provider rows. Thedescription text already explains the state, the button was noise and doesn't compose well with the new custom-endpoints
section.
Test plan
pnpm --filter @pi-gui/pi-sdk-driver run typecheckpnpm --filter @pi-gui/desktop run typecheckpnpm --filter @pi-gui/desktop run buildapps/desktop/tests/core/custom-endpoints.spec.ts- add / edit / delete round-trip with on-diskmodels.jsonassertions, plus validation + ESC dismiss.
apps/desktop/tests/core/provider-settings.spec.ts- updated assertions for the removed action cell; allfour tests pass.
corePlaywright lane: 53 passing. Two pre-existingtimeline-pinning.spec.tsfailures reproduced on a cleanHEADworktree (5/5 there), unrelated to this change.Out of scope
net.fetchagainst a user-supplied URL, so it needs a live ornative spec. Not added here.
contextWindowediting: the type and store round-trip the field, but no UI input exposes it yet.