Repository navigation
Description
Problem
Custom Inference endpoint setup currently requires users to manually type every model name and optional alias, even when the provider exposes an OpenAI-compatible GET /models catalog. This makes setup slower and error-prone, especially for providers that expose many model IDs or rotate models often.
Repo-grounded contract summary
The current saved request contract can remain unchanged:
CustomEndpointpersistsname,url,api_key, andmodels.CustomEndpointModelpersists the provider model name, optional alias, and stableconfig_key.- Saved custom models become synthetic
LLMInfoentries keyed byconfig_key; labels already use alias when present and fall back to the raw model name. - Agent requests serialize
custom_model_providers.providers[].models[]as{ slug, config_key }.
That means model discovery only needs to help fill the modal rows. It does not need to change how endpoints are saved or how agent requests are built.
Prototype approach
A local prototype on branch codex/custom-inference-model-probe adds a secondary Fetch models action to the Custom Endpoint modal:
- Enabled only when URL and API key are present and the URL passes existing validation.
- Builds
{base_url.trim_end_matches('/')}/models. - Sends
Authorization: Bearer <api_key>when a key is present. - Parses OpenAI-style responses shaped like
{ "object": "list", "data": [{ "id": "..." }] }. - Preserves provider ordering, de-dupes model IDs, ignores blank IDs, and returns explicit errors for non-2xx, invalid JSON, and empty lists.
- Merges discovered models into modal rows:
- preserve existing model rows, aliases, and
config_keys by matching model name - replace the initial blank row for new endpoints
- append new discovered models with blank aliases
- keep aliases optional because
CustomEndpointModel::display_label()already falls back to model name
- preserve existing model rows, aliases, and
- Shows inline loading, success, and error status in the modal.
OpenCode endpoint evidence
Tested against https://opencode.ai/zen/go/v1/ without including credentials in logs or this issue.
GET https://opencode.ai/zen/go/v1/models returned HTTP 200 with 15 model IDs:
minimax-m2.7minimax-m2.5kimi-k2.6kimi-k2.5glm-5.1glm-5deepseek-v4-prodeepseek-v4-flashqwen3.6-plusqwen3.5-plusmimo-v2-promimo-v2-omnimimo-v2.5-promimo-v2.5hy3-preview
GET https://opencode.ai/zen/go/v1//models returned HTTP 404, so trimming trailing slashes before appending /models is required.
Acceptance criteria
- Users can add a Custom Inference endpoint and click
Fetch modelsto populate model rows from an OpenAI-compatible/modelsendpoint. - Existing manually-entered rows are not overwritten.
- Existing aliases and stable
config_keys survive repeated fetches. - The initial blank model row is replaced on first successful fetch.
- Newly discovered models are appended with blank aliases.
- The button is disabled for invalid URL, missing API key, and in-flight fetch states.
- Non-2xx, invalid JSON, and empty lists surface clear inline errors.
- Saved endpoint and request contracts remain unchanged.
Local validation
Prototype validation run locally:
cargo test -p warp custom_inference_modal --libpassed: 17 tests.cargo test -p warp custom_inference_model_probe --libpassed: 7 tests.cargo test -p warp llms --libpassed: 16 tests.cargo test -p ai api_keyspassed: 24 tests.cargo fmt --checkpassed.git diff --checkpassed.
The Cargo target emitted repeated incremental-cache hard-link warnings because the local target directory is on a filesystem that does not support hard links; tests still passed.
Related follow-up
DeepSeek thinking-mode failures observed through this endpoint appear to be a separate provider conversation/history issue, not part of model autofill. Tracking separately in a follow-up issue.
Activity
warp-for-oss commentedon May 23, 2026
@thesammykins
Here's what I found while triaging this issue:
The current Custom Inference setup appears to require manually entering model IDs. Importing models from an OpenAI-compatible
/modelsresponse would be an enhancement to that setup rather than a regression in the saved endpoint/request contract.Maintainer details
I concluded that custom inference endpoint setup currently lacks a model-discovery action, so users must manually enter provider model IDs even when the provider exposes an OpenAI-compatible /models catalog..
Triage summary
This is an enhancement request for the Custom Inference endpoint setup flow. The current implementation lets users persist endpoint URL/API key plus manually-entered model rows, and those rows already flow into custom model picker/request data, but the modal does not currently expose a way to query an OpenAI-compatible
GET /modelscatalog and merge discovered IDs into the form.Reproducibility
High for the feature gap. The behavior is visible from the current settings modal implementation: the model list is populated from saved
CustomEndpointModelentries or blank manual rows, and the only model-list action is adding another blank row.Likely implementation area
app/src/settings_view/custom_inference_modal.rsowns the endpoint modal UI, manual model rows, URL validation, and save events.app/src/settings_view/ai_page.rswires modal events intoApiKeyManager.crates/ai/src/api_keys.rs,app/src/ai/llms.rs, andapp/src/ai/agent/api.rsconfirm that the saved/request contracts can remain model-row based: discovered model IDs can be used to fill rows without changing the wire shape.A closely related existing issue is #11514, which requests auto-discovering models from
/v1/models. Under the current duplicate-detection workflow, I found only that one likely duplicate, so I am not applying theduplicatelabel.Follow-up needed
No reporter follow-up is needed for initial routing; the desired behavior and acceptance criteria are already specific.
This is my automated analysis and may be incorrect. A maintainer will verify the details.
Powered by Oz
thesammykins commentedon May 23, 2026
DeepSeek thinking-mode follow-up: #11587
david-engelmann commentedon May 27, 2026
This overlaps directly with #11514, which I filed on the same
/modelsauto-discovery idea. To avoid two people building it twice: I've written up the product + tech spec and opened a draft PR with a working implementation — #11731.It does what you describe here: a "Fetch from endpoint" button in the custom inference modal that calls the provider's OpenAI-compatible
GET /models, parsesdata[].id, and merges the results into the model rows (case-insensitive dedup, existing rows/aliases untouched). The savedCustomEndpoint/CustomEndpointModelcontract you outlined stays unchanged — discovery only fills in the same rows a user would type. Failure modes (401/404/network/non-JSON/empty) each surface an inline status.The DeepSeek thinking-mode point in your follow-up (#11587) is out of scope for this — it's model-capability metadata, whereas this is just ID discovery.
Happy to fold any specifics from this issue into the spec. Suggest we converge on #11514 + #11731 as the implementation track for the
/modelsimport itself.danielpeng2 commentedon Jul 30, 2026
Thanks for the feature request! I'm going to close out this issue as a duplicate of #11514.