Add model allow/deny policy helpers to ai-config - #92
Closed
melissa-barca wants to merge 5 commits into
Closed
Conversation
Expose pure ai-config helpers for resolving model IDs, checking discovery policy, and filtering discovered model rows through the existing model resolver pipeline.
Keep model policy helpers on the package root export instead of maintaining a duplicate public subpath.
Document that discovery policy drops discovered IDs only and custom models still participate in model ID resolution.
Treat same-id custom model declarations as replacements for discovered model entries, preserving discovered optional metadata that the custom declaration does not set. Remove the discovered-row filter helper that encoded the opposite assumption.
Keep resolveModels's existing pipeline unchanged: a custom model declaration and a discovered model sharing an id remain separate candidates, as on main. The new policy helpers wrap that pipeline as-is rather than changing what it does with a same-id collision.
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.
First piece of posit-dev/positron#15417
Adds helpers to
ai-configthat let a host application check whether a model ID is allowed under a provider's configured allow/deny policy, resolve a full list of model IDs through that policy, and check whether a provider should run discovery at all.ai-config's package root now exports these helpers alongsideresolveModels.