Skip to content

feat: add live per-provider model discovery - #22

Merged
outofcoffee merged 3 commits into
mainfrom
worktree-live-model-discovery
Aug 1, 2026
Merged

outofcoffee merged 3 commits into
mainfrom
worktree-live-model-discovery

Conversation

@outofcoffee

@outofcoffee outofcoffee commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Learn each provider's current models on demand from its own endpoint, instead of curating them in the catalogue.

Summary

  • Add internal/discovery: Models(provider, override, resolve) queries the provider's OpenAI-compatible GET {baseURL}/models, parses data[].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 plain outfit list stays entirely offline.
  • Model tab-completion (--model/-m) sources ids from discovery, scoped to the typed --provider, and stays quiet on any failure.
  • Best-effort throughout: unreachable/timeout/non-2xx/bad-body all yield "no models", never an error; a provider with no resolvable base URL (AWS Bedrock) is 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 /models shape (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 that retire-model-families removed, sourced live rather than curated, and is why the catalogue could shed its model lists in the first place. Delivered as the live-model-discovery OpenSpec change (proposal, design, tasks, and the new model-discovery spec).

@outofcoffee outofcoffee added the enhancement New feature or request label Jul 29, 2026
@outofcoffee outofcoffee changed the title Propose: live per-provider model discovery docs: propose live per-provider model discovery Jul 29, 2026
@outofcoffee outofcoffee changed the title docs: propose live per-provider model discovery feat: add live per-provider model discovery Jul 29, 2026
@outofcoffee
outofcoffee force-pushed the worktree-live-model-discovery branch from 4ea8157 to 9510938 Compare August 1, 2026 00:15
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
outofcoffee force-pushed the worktree-live-model-discovery branch from bea653c to 33b9631 Compare August 1, 2026 18:10
@outofcoffee
outofcoffee marked this pull request as ready for review August 1, 2026 18:11
@outofcoffee
outofcoffee merged commit e7a9505 into main Aug 1, 2026
1 check passed
@outofcoffee
outofcoffee deleted the worktree-live-model-discovery branch August 1, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant