Repository navigation
docs: define v0.3 model selection and override contract - #19
Merged
Merged
Conversation
AviBackToBlack
added a commit
that referenced
this pull request
Sep 14, 2026
## Summary Implement the first production slice of the v0.3 model-selection contract from #19 without enabling compatibility overrides yet. This PR: - adds optional top-level `model_globs` configuration while keeping existing exact `models` semantics unchanged - allows glob-only configs without requiring a dummy `models = []` - expands globs with case-sensitive `fnmatchcase` semantics - preserves exact selectors first, then glob declaration order, with lexical ordering inside each glob - de-duplicates by first selection and retains `exact:<name>` / `glob:<pattern>` provenance - keeps the existing `select_model_groups()` API as a compatibility wrapper - routes production build/list/explain through the provenance-aware selector - carries selection provenance through prepared/generated groups and exposes it in `explain` - keeps glob-selected groups behind the existing aggregation eligibility/fail-closed boundary - preserves fail-fast `explain` rejection for models outside all configured selectors - fails closed if `model_overrides` is configured before the follow-up override implementation exists ## Scope boundary This PR does **not** apply any compatibility/evidence overrides and does not change exact/foreign mapping rules. The follow-up slice will implement the strict override whitelist against aggregated group evidence. ## Tests Regressions cover exact-only compatibility, glob-only config, duplicate/empty patterns, strict unmatched globs, case sensitivity, lexical deterministic expansion, first-selector de-duplication/provenance, LiteLLM row-order independence, ineligible glob-selected groups failing aggregation, selection provenance surviving generation/explain, configured list ordering, and fail-fast explain behavior. Refs #5 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/avibacktoblack/litellm-codex-models/pull/20" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=3"> <img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=3" alt="Devin Review"> </picture> </a> <!-- devin-review-badge-end -->
AviBackToBlack
added a commit
that referenced
this pull request
Sep 14, 2026
## Summary Implement the second production slice of the v0.3 model-selection/override contract from #19. This PR: - adds strict exact-keyed `model_overrides` configuration - validates a closed whitelist of capability booleans, token limits, supported OpenAI parameters, and reasoning effort sets - rejects unknown fields, invalid values, selector-uncovered targets, and contradictory override tables - applies overrides only after deterministic model-group aggregation, preserving exact-template identity and deployment evidence - retains original aggregate evidence beside configured and effective override values in `explain` - applies dependency closure after overrides (`supports_reasoning=false` disables reasoning transport/efforts; `supports_function_calling=false` prevents parallel calls) - allows explicit context overrides to unblock otherwise-unsynthesizable foreign multi-deployment groups - keeps exact Codex context fields authoritative even when `max_input_tokens` evidence is overridden - keeps foreign Codex web search disabled even when effective web-search evidence is true - repairs generated-field provenance so configured assertions are not misreported as LiteLLM observations - preserves `strict=false` semantics when a selector-covered override target is temporarily absent from the current LiteLLM payload - documents `model_globs` and `model_overrides` in README/config.example now that both v0.3 slices are implemented ## Tests Regression coverage includes config validation/normalization, selector-covered targets, contradiction handling, exact capability restoration, exact reasoning restriction including medium/high levels, reasoning/function dependency closure, foreign context blocker replacement, foreign web-search hard-disable, foreign verbosity transport, exact context ownership, CLI explain original/effective evidence, and strict=false absent-target behavior. Refs #5 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/avibacktoblack/litellm-codex-models/pull/21" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=3"> <img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=3" alt="Devin Review"> </picture> </a> <!-- devin-review-badge-end -->
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.
Summary
Define the v0.3 contract for deterministic model globs and explicit per-model compatibility overrides before production implementation.
The design keeps the existing
models = ["..."]list strictly exact and backwards-compatible, then adds separatemodel_globsand exact-keyedmodel_overridesconcepts.Key decisions:
explainprovenanceThe document also defines selection provenance and row-order determinism requirements, then splits implementation into selector/config and evidence-override slices.
Refs #5