Skip to content

Add a neutral "Custom OpenAI-compatible" preset for LLM profiles #648

Done

Description

@kalt2212

Problem

Users who run a self-hosted or third-party OpenAI-compatible endpoint (a local gateway, a relay/proxy, or a custom model name) must currently pick the generic "openai" format and know the base URL and model conventions themselves. The docs cover this in README ("Base URL gotcha"), but the profile form gives no guided path. Reports of confusion and wrong base URLs (for example, a trailing /v1 or a pasted /chat/completions) are the common failure mode.

Proposal

Add a neutral preset named "Custom OpenAI-compatible" to the LLM profile form in System -> LLM. The preset does three things and nothing more:

  1. Selects the existing openai format (no new wire format, no schema migration).
  2. Pre-fills an empty base URL placeholder that shows the expected shape (https://<host>/v1), without a vendor name or a baked endpoint.
  3. Shows a one-line hint that the base must end in /v1 for OpenAI-format endpoints, and that the path /chat/completions is appended by the provider.

No vendor logos, no vendor-specific environment variables, no promotional content, no hard-coded endpoints. This matches CONTRIBUTING.md ("provider convenience goes in as a neutral preset (name and base URL) or a docs recipe").

Non-goals

  • No new wire format and no schema change. This is a form-level preset only.
  • No ChatGPT-subscription or session-token auth. Only API-key based endpoints are in scope.
  • No automatic model discovery. A user types the model name.

Behavior spec

  • Preset is selectable in the profile form. Choosing it sets format to openai and fills the base URL placeholder.
  • Saving with an empty base URL falls back to the existing behavior (the public OpenAI endpoint), so behavior for current profiles is unchanged.
  • Trailing /chat/completions in the base URL is stripped, as ConfigFrom already does for openai.
  • Existing profiles are not modified.

Rationale

  • Reduces setup errors for any OpenAI-compatible backend without adding vendor-specific code.
  • Keeps the generic provider pattern in agent/provider.go intact.
  • Scope is one focused change, consistent with the one-change-per-PR rule.

Test plan (TDD: failing test first)

  1. Unit test (Go, agent package): ConfigFrom("openai", ...) given a base URL with a trailing /chat/completions returns a base URL with it stripped. This already exists in behavior; add a regression test pinning it so the preset cannot regress it.
  2. Profile save/load test (db package): save an openai profile with a custom base URL and a custom model name, reload it, and assert base URL, model, and format round-trip unchanged.
  3. Frontend test: selecting the preset sets format to openai and the base URL placeholder; saving an empty base URL does not write a value.
  4. Live connection test: run the existing connection test against a local OpenAI-compatible endpoint and confirm HTTP 200 and a model reply.

Order: write tests 1-3 first, watch them fail, then implement the preset, then watch them pass. Run go vet ./... and go test ./..., and the frontend test suite.

Verification status

Not yet run. This issue is a proposal. The code change has not been written or tested.

Open questions for maintainers

  • Should the preset appear only under "Advanced" in the form, or on the main format selector?
  • Is a placeholder hint enough, or should the form validate that the base URL ends in /v1 for the openai format?

Activity

  1. github-actions commented on Nov 28, 2026

    @github-actions

    This requests adding a neutral "Custom OpenAI-compatible" preset to the System -> LLM profile form that selects the existing openai format, pre-fills a https://<host>/v1 base URL placeholder, and shows a short /v1 hint without vendor-specific code or schema changes.


    🤖 automated reply from the repo bot. A human maintainer reads everything. Ping me in any comment with @artex-bot.

  2. BaaRai commented on Nov 28, 2026

    @BaaRai
    Owner

    Implemented with @Dukotah in #677, landed in becc47a. The format selector offers a neutral Custom OpenAI-compatible preset that selects the openai format, shows the expected base-URL shape (https://<host>/v1) and a one-line hint, with nothing prefilled and no vendor host. The preset is re-derived from the saved base URL when a profile reopens. Thanks @kalt2212 for the request.

  3. added a commit that references this issue on Nov 28, 2026
    24f40c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions