Skip to content

Add OpenAI-compatible custom endpoints (Ollama, vLLM, etc.)#14

Open
mfellner wants to merge 4 commits intominghinmatthewlam:mainfrom
mfellner:custom-endpoints
Open

Add OpenAI-compatible custom endpoints (Ollama, vLLM, etc.)#14
mfellner wants to merge 4 commits intominghinmatthewlam:mainfrom
mfellner:custom-endpoints

Conversation

@mfellner
Copy link
Copy Markdown

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

  • New Custom endpoints section under Settings / Providers for registering OpenAI-compatible servers (Ollama, vLLM, or
    any /v1-style endpoint). Backed by a new CustomProviderStore in pi-sdk-driver that atomically writes entries into
    ~/.pi/agent/models.json and surfaces them through the existing RuntimeSupervisor snapshot.
  • Add, edit, delete, and probe (GET /models) flows, with validation against provider-ID collisions (both API-key and
    OAuth built-ins) and URL-parsed base URLs. Non-auth servers like Ollama save with an "unused" placeholder key so the
    storage format stays happy.
  • Drop the disabled Managed externally button on env-variable and models.json-override provider rows. The
    description text already explains the state, the button was noise and doesn't compose well with the new custom-endpoints
    section.
Screenshot from 2026-04-23 22-40-49 Screenshot from 2026-04-23 22-41-07

Test plan

  • pnpm --filter @pi-gui/pi-sdk-driver run typecheck
  • pnpm --filter @pi-gui/desktop run typecheck
  • pnpm --filter @pi-gui/desktop run build
  • New apps/desktop/tests/core/custom-endpoints.spec.ts - add / edit / delete round-trip with on-disk models.json
    assertions, plus validation + ESC dismiss.
  • Existing apps/desktop/tests/core/provider-settings.spec.ts - updated assertions for the removed action cell; all
    four tests pass.
  • Full core Playwright lane: 53 passing. Two pre-existing timeline-pinning.spec.ts failures reproduced on a clean
    HEAD worktree (5/5 there), unrelated to this change.

Out of scope

  • Probe (Detect models) coverage: the handler calls net.fetch against a user-supplied URL, so it needs a live or
    native spec. Not added here.
  • contextWindow editing: the type and store round-trip the field, but no UI input exposes it yet.
  • Timeline-pinning flakes: pre-existing, investigated and filed for a follow-up PR.

mfellner and others added 3 commits April 23, 2026 22:23
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

@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
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