mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
feat(cost): schema and PRC 2026 holiday dates for deepseek off_peak_pricing
This commit is contained in:
parent
207ec88b3a
commit
06e5a0189d
4 changed files with 219 additions and 5 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue