Skip to content

feat: auto discover models from custom providers#18110

Open
luiz290788 wants to merge 1 commit intoanomalyco:devfrom
luiz290788:LP/auto-discover-models
Open

feat: auto discover models from custom providers#18110
luiz290788 wants to merge 1 commit intoanomalyco:devfrom
luiz290788:LP/auto-discover-models

Conversation

@luiz290788
Copy link
Contributor

@luiz290788 luiz290788 commented Mar 18, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a discover field to the Provider configuration to allow auto-discovering models for custom providers using the /v1/models endpoint for @ai-sdk/openai-compatible providers (e.g., Ollama, vLLM).

During initialization, the provider checks the endpoint and dynamically populates the available models that are not already explicitly configured by the user. Discovered models default to reasonable settings (e.g. 128K context window, standard tool support enabled) making it extremely simple to set up a local provider without listing all models manually.

How did you verify your code works?

Tested locally by configuring an openai-compatible provider with discover: true and validating that models fetched from the /v1/models endpoint successfully populate the configuration list.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Mar 18, 2026
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found two potentially related PRs:

  1. PR feat(opencode): add LiteLLM provider with auto model discovery #14468: feat(opencode): add LiteLLM provider with auto model discovery

  2. PR feat(opencode): add dynamic model fetching for OpenAI-compatible provider #14277: feat(opencode): add dynamic model fetching for OpenAI-compatible provider

These PRs may have relevant implementation patterns or context that could inform or be consolidated with PR #18110's broader auto-discovery feature.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 18, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant