Skip to content

docs: define v0.3 model selection and override contract - #19

Merged
AviBackToBlack merged 1 commit into
mainfrom
docs/v0.3-selection-overrides-design
Sep 14, 2026
Merged

AviBackToBlack merged 1 commit into
mainfrom
docs/v0.3-selection-overrides-design

Conversation

@AviBackToBlack

@AviBackToBlack AviBackToBlack commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

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 separate model_globs and exact-keyed model_overrides concepts.

Key decisions:

  • exact strings are never reinterpreted as patterns
  • glob expansion is case-sensitive, deterministic, lexical within each pattern, and stable first-match de-duplicated
  • selected glob groups still pass through the existing fail-closed aggregation eligibility checks
  • overrides apply to aggregate compatibility evidence, not deployment rows or arbitrary Codex fields
  • the override surface is a strict whitelist of capability booleans, token limits, supported OpenAI parameters, and reasoning efforts
  • exact-template identity cannot be forced by overrides
  • original aggregate evidence is retained alongside the effective override in explain provenance
  • existing reasoning/function-calling dependency rules still apply after overrides
  • foreign web search remains disabled even if effective web-search evidence is true
  • unused exact override targets and contradictory override tables fail closed

The document also defines selection provenance and row-order determinism requirements, then splits implementation into selector/config and evidence-override slices.

Refs #5


Devin Review

Copilot AI lite review requested due to automatic review settings September 14, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@AviBackToBlack
AviBackToBlack merged commit e83e3ab into main Sep 14, 2026
9 checks passed
@AviBackToBlack
AviBackToBlack deleted the docs/v0.3-selection-overrides-design branch September 14, 2026 10:48
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants