Repository navigation
fix(schema): accept override_dates on off_peak_pricing windows - #42893
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
A window rule may carry override_dates, YYYY-MM-DD dates on which it alone decides, so the generated schema, the OffPeakWindow TypedDict, and the Rust model catalog now model it.
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Draft
4 of 6 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
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.
what to review
Cost map rows cannot carry holiday dates yet because the schema rejects the key. This teaches the schema, the types and the Rust catalog about
override_datesso #42880 can ship the DeepSeek datessummary
override_dateson a window rule is typed as a non-empty array ofYYYY-MM-DDstringsdecisions
off_peak_pricingschema the same waydeprecation_dateinstead of copiedTLDR
Problem this solves:
How it solves it:
override_datesadded to the schema generator and regeneratedschema.jsonOffPeakWindowTypedDict and Rust struct gain the optional fieldtest_utils.pyaccepts the keyUser Flow
Before: a proxy admin who adds
override_datesto a window rule inmodel_infogets it, but the shipped cost map cannot carry it{"hours_utc": "00:00-00:00", "override_dates": ["2026-10-01"]}to a window rule in the cost mappython ci_cd/generate_model_prices_schema.py --checkfails withAdditional properties are not allowed ('override_dates' was unexpected)After: the same row validates and a typo in the date fails the check
python ci_cd/generate_model_prices_schema.py --checkpasses2026-10-1or an empty list fails the check with the pattern orminItemserrorRelevant issues
Prerequisite for #42880
Linear ticket
Part of LIT-8177
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Schema only, so the proof is the generated schema accepting and rejecting a probe row with
jsonschema.validateagainstmodel_prices_and_context_window.schema.jsonBefore (main)
override_dates: ["2026-10-01"]on a window rule:Additional properties are not allowed ('override_dates' was unexpected)After (ecfcf0b)
uv run --no-sync python ci_cd/generate_model_prices_schema.py --check:model_prices_and_context_window.schema.json is in sync and model_prices_and_context_window.json validates against itoverride_dates: ["2026-10-01"]: validoverride_dates: ["2026-10-1"]:'2026-10-1' does not match '^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$'override_dates: "2026-10-01":'2026-10-01' is not of type 'array'override_dates: []:[] should be non-emptyuv run --no-sync python ci_cd/cost_map_guard.py --base origin/main --head HEAD --head-ref litellm_off_peak_override_dates_schema: passed, cost map untouchedType
🧹 Refactoring
Caveats (if any)
Low
test_model_prices_schema.pynow tolerates trailing override rules so feat(cost): add override_dates to off_peak_pricing windows for holidays and make-up workdays #42880's rows pass itFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/3e4563b49e964e089f8abcee782456ec
Open in Devin Desktop: https://app.devin.ai/desktop/session/3e4563b49e964e089f8abcee782456ec?variant=devin
Requested by: @shreshth-berri