Repository navigation
feat: add live per-provider model discovery - #22
Merged
Merged
Conversation
outofcoffee
force-pushed
the
worktree-live-model-discovery
branch
from
August 1, 2026 00:15
4ea8157 to
9510938
Compare
Add an OpenSpec change proposal for a best-effort discovery layer that fetches a provider's currently-served models from the provider's own endpoint (OpenAI-compatible /models, Ollama /api/tags), surfaced via `outfit list --models` and shell completion. Replaces the static model lists with a self-updating source; degrades quietly offline and caches per endpoint. Introduces a new `model-discovery` capability spec. No code changes yet — implementation follows via the apply flow. Builds on and follows the retire-model-families change. Claude-Session: https://claude.ai/code/session_01WmyqktzL3xrG4bVQYoP7aT
Implement the live-model-discovery change. With the catalogue reduced to
provider plumbing, models are learned on demand from each provider's own
OpenAI-compatible /models endpoint instead of being curated.
- internal/discovery: Models(provider, override, resolve) queries
{baseURL}/models, parses data[].id, sorts, and caches per endpoint for
60s behind a 3s timeout. Best-effort — any failure yields an error the
callers treat as "no models". A provider with no resolvable base URL
(Bedrock) is ErrNotDiscoverable. A resolved key is sent as a Bearer
header, never stored.
- outfit list --models [provider]: prints each listed provider's live
models (or "(none found)"). Plain list stays offline.
- completion: --model/-m sources ids from discovery, scoped to the typed
--provider; quiet on failure.
- docs and the change's spec/design/tasks updated to the uniform
OpenAI-compatible approach (Ollama serves /v1/models, so no separate
/api/tags adapter).
Implements the live-model-discovery OpenSpec change.
Claude-Session: https://claude.ai/code/session_01WmyqktzL3xrG4bVQYoP7aT
outofcoffee
force-pushed
the
worktree-live-model-discovery
branch
from
August 1, 2026 18:10
bea653c to
33b9631
Compare
outofcoffee
marked this pull request as ready for review
August 1, 2026 18:11
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.
Learn each provider's current models on demand from its own endpoint, instead of curating them in the catalogue.
Summary
internal/discovery:Models(provider, override, resolve)queries the provider's OpenAI-compatibleGET {baseURL}/models, parsesdata[].id, returns them sorted, and caches per endpoint (60s) behind a 3s timeout.outfit list --models [provider]prints each listed provider's live models (or(none found)); a plainoutfit liststays entirely offline.--model/-m) sources ids from discovery, scoped to the typed--provider, and stays quiet on any failure.ErrNotDiscoverable. A resolved API key is sent as a Bearer header, never written to disk.Implementation details
Every discoverable provider — OpenRouter, vLLM, llama.cpp, the generic openai-compatible endpoint, and Ollama — answers the same OpenAI-compatible
/modelsshape (Ollama's compatibility layer serves/v1/models), so one query path covers them all with no per-provider protocol switch or catalogue field; "discoverable" reduces to whether a base URL resolves. This restores the browsable model list thatretire-model-familiesremoved, sourced live rather than curated, and is why the catalogue could shed its model lists in the first place. Delivered as thelive-model-discoveryOpenSpec change (proposal, design, tasks, and the newmodel-discoveryspec).