From 06e5a0189d88e4159d97302b6468ba7c3aa99234 Mon Sep 17 00:00:00 2001 From: shrey kharbanda Date: Thu, 24 Sep 2026 04:09:55 +0000 Subject: [PATCH] feat(cost): schema and PRC 2026 holiday dates for deepseek off_peak_pricing --- ci_cd/generate_model_prices_schema.py | 24 ++++- ...odel_prices_and_context_window_backup.json | 88 +++++++++++++++++++ model_prices_and_context_window.json | 88 +++++++++++++++++++ model_prices_and_context_window.schema.json | 24 ++++- 4 files changed, 219 insertions(+), 5 deletions(-) diff --git a/ci_cd/generate_model_prices_schema.py b/ci_cd/generate_model_prices_schema.py index 8eec07dadda..15ed0a15e01 100644 --- a/ci_cd/generate_model_prices_schema.py +++ b/ci_cd/generate_model_prices_schema.py @@ -20,6 +20,11 @@ NONNEG_INTEGER: JsonSchema = {"type": "integer", "minimum": 0} BOOLEAN: JsonSchema = {"type": "boolean"} STRING: JsonSchema = {"type": "string"} TIME_WINDOW: Final[JsonSchema] = {"type": "string", "pattern": r"^([01]\d|2[0-3]):[0-5]\d-([01]\d|2[0-3]):[0-5]\d$"} +ISO_DATE: Final[JsonSchema] = { + "type": "string", + "format": "date", + "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$", +} WEEKDAY_PATTERN: Final = ( r"(?i)^(mon|monday|tue|tues|tuesday|wed|wednesday|thu|thur|thurs|thursday|fri|friday|sat|saturday|sun|sunday)$" ) @@ -71,6 +76,21 @@ OBJECT_KEYS: dict[str, JsonSchema] = { "type": "string", "description": "IANA zone the weekdays of each window are read on; defaults to UTC.", }, + "off_peak_dates": { + "type": "array", + "items": ISO_DATE, + "minItems": 1, + "description": "Calendar dates, read on weekday_timezone, that are off-peak all day (public holidays).", + }, + "weekday_dates": { + "type": "array", + "items": ISO_DATE, + "minItems": 1, + "description": ( + "Calendar dates, read on weekday_timezone, that follow the Monday-to-Friday rules " + "even when they fall on a weekend (make-up workdays)." + ), + }, "input_cost_per_token": NONNEG_NUMBER, "output_cost_per_token": NONNEG_NUMBER, "output_cost_per_reasoning_token": NONNEG_NUMBER, @@ -258,10 +278,8 @@ def string_key_schemas(modes: tuple) -> dict[str, JsonSchema]: "description": "URL of the provider pricing/model page this entry was taken from.", }, "deprecation_date": { - "type": "string", + **ISO_DATE, "description": "Date the provider deprecates the model, YYYY-MM-DD.", - "format": "date", - "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$", }, "web_search_billing_unit": { "type": "string", diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 18c8578cec8..0f2486ec0fc 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -58222,7 +58222,51 @@ "off_peak_pricing": { "cache_read_input_token_cost": 3e-09, "input_cost_per_token": 1.5e-07, + "off_peak_dates": [ + "2026-01-01", + "2026-01-02", + "2026-01-03", + "2026-02-15", + "2026-02-16", + "2026-02-17", + "2026-02-18", + "2026-02-19", + "2026-02-20", + "2026-02-21", + "2026-02-22", + "2026-02-23", + "2026-04-04", + "2026-04-05", + "2026-04-06", + "2026-05-01", + "2026-05-02", + "2026-05-03", + "2026-05-04", + "2026-05-05", + "2026-06-19", + "2026-06-20", + "2026-06-21", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07" + ], "output_cost_per_token": 6e-07, + "weekday_dates": [ + "2026-01-04", + "2026-02-14", + "2026-02-28", + "2026-05-09", + "2026-09-20", + "2026-10-10" + ], + "weekday_timezone": "Asia/Shanghai", "windows": [ { "hours_utc": [ @@ -58384,7 +58428,51 @@ "off_peak_pricing": { "cache_read_input_token_cost": 2.2e-08, "input_cost_per_token": 6.6e-07, + "off_peak_dates": [ + "2026-01-01", + "2026-01-02", + "2026-01-03", + "2026-02-15", + "2026-02-16", + "2026-02-17", + "2026-02-18", + "2026-02-19", + "2026-02-20", + "2026-02-21", + "2026-02-22", + "2026-02-23", + "2026-04-04", + "2026-04-05", + "2026-04-06", + "2026-05-01", + "2026-05-02", + "2026-05-03", + "2026-05-04", + "2026-05-05", + "2026-06-19", + "2026-06-20", + "2026-06-21", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07" + ], "output_cost_per_token": 1.98e-06, + "weekday_dates": [ + "2026-01-04", + "2026-02-14", + "2026-02-28", + "2026-05-09", + "2026-09-20", + "2026-10-10" + ], + "weekday_timezone": "Asia/Shanghai", "windows": [ { "hours_utc": [ diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 18c8578cec8..0f2486ec0fc 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -58222,7 +58222,51 @@ "off_peak_pricing": { "cache_read_input_token_cost": 3e-09, "input_cost_per_token": 1.5e-07, + "off_peak_dates": [ + "2026-01-01", + "2026-01-02", + "2026-01-03", + "2026-02-15", + "2026-02-16", + "2026-02-17", + "2026-02-18", + "2026-02-19", + "2026-02-20", + "2026-02-21", + "2026-02-22", + "2026-02-23", + "2026-04-04", + "2026-04-05", + "2026-04-06", + "2026-05-01", + "2026-05-02", + "2026-05-03", + "2026-05-04", + "2026-05-05", + "2026-06-19", + "2026-06-20", + "2026-06-21", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07" + ], "output_cost_per_token": 6e-07, + "weekday_dates": [ + "2026-01-04", + "2026-02-14", + "2026-02-28", + "2026-05-09", + "2026-09-20", + "2026-10-10" + ], + "weekday_timezone": "Asia/Shanghai", "windows": [ { "hours_utc": [ @@ -58384,7 +58428,51 @@ "off_peak_pricing": { "cache_read_input_token_cost": 2.2e-08, "input_cost_per_token": 6.6e-07, + "off_peak_dates": [ + "2026-01-01", + "2026-01-02", + "2026-01-03", + "2026-02-15", + "2026-02-16", + "2026-02-17", + "2026-02-18", + "2026-02-19", + "2026-02-20", + "2026-02-21", + "2026-02-22", + "2026-02-23", + "2026-04-04", + "2026-04-05", + "2026-04-06", + "2026-05-01", + "2026-05-02", + "2026-05-03", + "2026-05-04", + "2026-05-05", + "2026-06-19", + "2026-06-20", + "2026-06-21", + "2026-09-25", + "2026-09-26", + "2026-09-27", + "2026-10-01", + "2026-10-02", + "2026-10-03", + "2026-10-04", + "2026-10-05", + "2026-10-06", + "2026-10-07" + ], "output_cost_per_token": 1.98e-06, + "weekday_dates": [ + "2026-01-04", + "2026-02-14", + "2026-02-28", + "2026-05-09", + "2026-09-20", + "2026-10-10" + ], + "weekday_timezone": "Asia/Shanghai", "windows": [ { "hours_utc": [ diff --git a/model_prices_and_context_window.schema.json b/model_prices_and_context_window.schema.json index 395b2db1137..2de7b6ac524 100644 --- a/model_prices_and_context_window.schema.json +++ b/model_prices_and_context_window.schema.json @@ -249,9 +249,9 @@ }, "deprecation_date": { "type": "string", - "description": "Date the provider deprecates the model, YYYY-MM-DD.", "format": "date", - "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$" + "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$", + "description": "Date the provider deprecates the model, YYYY-MM-DD." }, "gemini_audio_only_live": { "type": "boolean" @@ -572,6 +572,26 @@ "type": "string", "description": "IANA zone the weekdays of each window are read on; defaults to UTC." }, + "off_peak_dates": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$" + }, + "minItems": 1, + "description": "Calendar dates, read on weekday_timezone, that are off-peak all day (public holidays)." + }, + "weekday_dates": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$" + }, + "minItems": 1, + "description": "Calendar dates, read on weekday_timezone, that follow the Monday-to-Friday rules even when they fall on a weekend (make-up workdays)." + }, "input_cost_per_token": { "type": "number", "minimum": 0