Proposal: opt-in /models discovery for custom OpenAI-compatible providers #1669
maxsonderby
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal: opt-in
/modelsdiscovery for custom OpenAI-compatible providersCustom OpenAI-compatible providers currently require every model ID to be copied into
~/.prime/agent/models.json. That catalog becomes stale whenever a local server or proxy adds, removes, or renames a model.I propose one opt-in provider field:
{ "providers": { "local": { "baseUrl": "http://localhost:8000/v1", "api": "openai-completions", "apiKey": "local", "discoverModels": true } } }When enabled, existing async catalog refresh paths request
GET <baseUrl>/models, parse the standarddata[].idshape, and synthesize entries with the same defaults already used for minimal custom model definitions. Explicitmodelsentries win.modelOverridescan add capability metadata for discovered IDs.Compatibility boundary:
openai-completionsproviders are supported initially.--offlineperforms no discovery requests.--provider/--modeldiscovery targets only the requested provider.The implementation is isolated to the coding-agent model registry/resolver, with mocked tests for absent-flag behavior, auth/headers, mapping/defaults, explicit override precedence, caching, failure/offline behavior, config-reload races, targeted refresh consistency, and CLI model selection.
Related: #1394 proposes live discovery for the bundled OpenRouter provider. This proposal is narrower and separate: it changes no built-in provider and only activates for user-defined providers that opt in.
Would maintainers accept this scope as a PR?
All reactions