Skip to content

feat: support custom provider endpoint URL#389

Merged
hanneshapke merged 3 commits into
mainfrom
hanneshapke/custom-openai-endpoint
May 1, 2026
Merged

feat: support custom provider endpoint URL#389
hanneshapke merged 3 commits into
mainfrom
hanneshapke/custom-openai-endpoint

Conversation

@hanneshapke
Copy link
Copy Markdown
Collaborator

@hanneshapke hanneshapke commented Apr 30, 2026

Summary

  • Adds a Custom Endpoint URL field to the OpenAI section of the Settings modal so users can point at OpenAI-compatible servers (LM Studio, Ollama, vLLM, Together, etc.). Validated to require an http(s):// scheme and persisted in the existing Electron config alongside model and the encrypted API key.
  • Wires the persisted provider config (API keys + base URLs for all providers) into the Go backend by injecting them as the env vars loadApplicationConfig already understands (OPENAI_API_KEY, OPENAI_BASE_URL, …) when the Go binary is spawned.
  • Adds a restart-backend IPC + a stopGoBinaryAsync / restartGoBinary pair, and the modal calls it after a successful save so changes apply without restarting the whole app.

Test plan

  • Open Settings → OpenAI: enter https://api.openai.com/v1 (or an LM Studio/Ollama URL) and a key, save, verify the success message and that requests now hit the configured endpoint.
  • Save with an invalid URL (no scheme) → expect a validation error from the IPC handler.
  • Save with EXTERNAL_BACKEND=true → expect the "externally managed" error from restart-backend.
  • Confirm previously-saved API keys still work after the restart path is exercised.

User Interface

Screenshot 2026-04-29 at 7 57 47 PM Screenshot 2026-04-29 at 7 57 25 PM

Lets users point the OpenAI provider at any OpenAI-compatible server
(LM Studio, Ollama, vLLM, etc.) from the Settings modal. The saved
base URL plus all provider API keys are now injected as env vars when
the Go backend is spawned, and the modal triggers a backend restart
on save so changes take effect without restarting the app.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hanneshapke hanneshapke changed the title feat: custom OpenAI endpoint URL in Settings feat: support custom provider endpoint URL Apr 30, 2026
@hanneshapke hanneshapke requested review from Davidnet and nmartorell and removed request for Davidnet April 30, 2026 00:27
hanneshapke and others added 2 commits April 29, 2026 17:51
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Warning

This PR touches 3+ distinct areas of the codebase.

Consider splitting into smaller, focused PRs — each covering a single semantic type.
This makes reviews easier and keeps the git history clean.

Categories found:

code:

  • src/backend/config/config.go
  • src/backend/main.go
  • src/backend/providers/custom.go
  • src/backend/providers/provider.go
  • src/backend/proxy/handler.go
  • src/backend/server/server.go
  • src/frontend/src/components/modals/SettingsModal.tsx
  • src/frontend/src/components/privacy-proxy-ui.tsx
  • src/frontend/src/electron/electron-main.js
  • src/frontend/src/electron/electron-preload.js
  • src/frontend/src/electron/electron.d.ts
  • src/frontend/src/hooks/useElectronSettings.ts
  • src/frontend/src/types/provider.ts
  • src/frontend/src/utils/providerHelpers.ts

chore:

  • package-lock.json

test:

  • src/backend/config/config_test.go
  • src/backend/providers/provider_test.go
  • src/backend/providers/providers_test.go
  • src/backend/proxy/handler_test.go

@nmartorell
Copy link
Copy Markdown
Contributor

@hanneshapke code changes looks reasonable :)
Going to perform a quick functional test now before approving.

Copy link
Copy Markdown
Contributor

@nmartorell nmartorell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional tests for new custom provider all worked as expected.

@hanneshapke hanneshapke merged commit 4cea8bb into main May 1, 2026
9 of 14 checks passed
@hanneshapke hanneshapke deleted the hanneshapke/custom-openai-endpoint branch May 1, 2026 15:57
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.

2 participants