Repository navigation
feat(ai): auto-discover models from /v1/models for custom inference endpoints - #11731
Draft
david-engelmann wants to merge 2 commits into
Draft
david-engelmann wants to merge 2 commits into
david-engelmann wants to merge 2 commits into
Conversation
Wires a "Fetch from endpoint" button into the custom inference modal so users no longer have to type model names by hand once they've entered an endpoint URL and API key. The fetch hits <base>/models with bearer auth, parses the OpenAI-compatible response shape, and merges new IDs into the model rows (case-insensitive dedup against what's already configured). Implements warpdotdev#11514. Co-Authored-By: Claude Opus 4.7 <[email protected]>
…s discovery Documents the already-built custom-inference model auto-discovery feature: PRODUCT.md captures the user-facing behavior, status states, invariants, and out-of-scope items; TECH.md grounds the discover_models helper, the merge logic, modal wiring, cancellation, and the security envelope in the current code. Refs warpdotdev#11514. Duplicate request tracked in warpdotdev#11586. Co-Authored-By: Claude Opus 4.7 <[email protected]>
6 tasks
3 tasks done
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.
Status: DRAFT — spec-first, awaiting
ready-to-implementon #11514Opening as a draft deliberately so it doesn't kick off review before the
linked issue is promoted. #11514
is currently
ready-to-spec; this PR supplies that spec (and theimplementation it describes) for review. Please don't treat it as
ready-to-review until #11514 carries
ready-to-implement.What this adds
A "Fetch from endpoint" button in the custom inference endpoint modal that
calls the provider's OpenAI-compatible
GET /modelscatalog and populates themodel rows, so users don't type every model ID by hand. Builds on #10781
(custom inference endpoints / BYOK).
This also covers the independently-filed #11586,
which requests the same feature.
Specs
specs/gh-11514/PRODUCT.md— user-facing behavior, status states, invariants, out-of-scope.specs/gh-11514/TECH.md—discover_modelshelper, merge logic, modal wiring, cancellation, security envelope.Implementation summary
app/src/ai/discover_models.rs—discover_models(client, base_url, api_key)hits
<base>/modelswith bearer auth, parses the OpenAI-compatible{ "data": [{ "id": … }] }shape, bounds the body at 1 MiB, and filtersblank IDs.
new_model_idsmerges results case-insensitively without touchingexisting rows or aliases.
app/src/settings_view/custom_inference_modal.rs— the button + inlinestatus (
Fetching…/Added N models/No new models/Fetch failed: …),run as a cancellable background task. Reuses the modal's existing URL
validation, so discovery inherits the same HTTPS/non-private allow-list as
Save.
No change to persisted
CustomEndpointdata or the request wire format. Gatedby the existing
CustomInferenceEndpointsfeature flag.Tests
14 unit tests for
discover_models(happy path + 401/404/network/non-JSON/missing-
data/empty/blank-ID/trailing-slash, plus the three merge cases)against a
mockitoserver.cargo test -p warp --lib ai::discover_modelspasses; clippy + fmt clean.
Refs #11514. Refs #11586.