Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions litellm/model_prices_and_context_window_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -30333,7 +30333,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.6-luna": {
"litellm_provider": "chatgpt",
Expand All @@ -30349,7 +30353,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.6-sol": {
"litellm_provider": "chatgpt",
Expand All @@ -30365,7 +30373,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.6-terra": {
"litellm_provider": "chatgpt",
Expand All @@ -30381,7 +30393,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.4": {
"litellm_provider": "chatgpt",
Expand All @@ -30396,7 +30412,12 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"default_reasoning_effort": "none",
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.4-pro": {
"litellm_provider": "chatgpt",
Expand All @@ -30410,7 +30431,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.3-codex": {
"litellm_provider": "chatgpt",
Expand All @@ -30424,7 +30449,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": false,
"supports_minimal_reasoning_effort": true
},
"chatgpt/gpt-5.3-codex-spark": {
"litellm_provider": "chatgpt",
Expand Down Expand Up @@ -30468,7 +30497,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.2-codex": {
"litellm_provider": "chatgpt",
Expand All @@ -30482,7 +30512,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.2": {
"litellm_provider": "chatgpt",
Expand All @@ -30497,7 +30528,12 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"default_reasoning_effort": "none",
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.1-codex-max": {
"litellm_provider": "chatgpt",
Expand All @@ -30511,7 +30547,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.1-codex-mini": {
"litellm_provider": "chatgpt",
Expand All @@ -30525,7 +30562,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"gigachat/GigaChat-2": {
"input_cost_per_token": 0.0,
Expand Down
62 changes: 50 additions & 12 deletions model_prices_and_context_window.json
Original file line number Diff line number Diff line change
Expand Up @@ -30333,7 +30333,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.6-luna": {
"litellm_provider": "chatgpt",
Expand All @@ -30349,7 +30353,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.6-sol": {
"litellm_provider": "chatgpt",
Expand All @@ -30365,7 +30373,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.6-terra": {
"litellm_provider": "chatgpt",
Expand All @@ -30381,7 +30393,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_minimal_reasoning_effort": false,
"supports_none_reasoning_effort": true,
"supports_reasoning": true,
"supports_xhigh_reasoning_effort": true
},
"chatgpt/gpt-5.4": {
"litellm_provider": "chatgpt",
Expand All @@ -30396,7 +30412,12 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"default_reasoning_effort": "none",
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.4-pro": {
"litellm_provider": "chatgpt",
Expand All @@ -30410,7 +30431,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.3-codex": {
"litellm_provider": "chatgpt",
Expand All @@ -30424,7 +30449,11 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": false,
"supports_minimal_reasoning_effort": true
},
"chatgpt/gpt-5.3-codex-spark": {
"litellm_provider": "chatgpt",
Expand Down Expand Up @@ -30468,7 +30497,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.2-codex": {
"litellm_provider": "chatgpt",
Expand All @@ -30482,7 +30512,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.2": {
"litellm_provider": "chatgpt",
Expand All @@ -30497,7 +30528,12 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true,
"supports_none_reasoning_effort": true,
"default_reasoning_effort": "none",
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"chatgpt/gpt-5.1-codex-max": {
"litellm_provider": "chatgpt",
Expand All @@ -30511,7 +30547,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"chatgpt/gpt-5.1-codex-mini": {
"litellm_provider": "chatgpt",
Expand All @@ -30525,7 +30562,8 @@
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_response_schema": true,
"supports_vision": true
"supports_vision": true,
"supports_reasoning": true
},
"gigachat/GigaChat-2": {
"input_cost_per_token": 0.0,
Expand Down
51 changes: 51 additions & 0 deletions tests/test_litellm/test_model_prices_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,57 @@ def test_openai_reasoning_family_entries_carry_supports_reasoning(prices: dict):
)


REASONING_ANNOTATION_KEYS: Final = (
"supports_reasoning",
"supports_minimal_reasoning_effort",
"supports_none_reasoning_effort",
"supports_xhigh_reasoning_effort",
"default_reasoning_effort",
)


def chatgpt_openai_twins(prices: dict) -> list[tuple[str, str]]:
"""`chatgpt/<model>` rows paired with the bare `<model>` row served by the openai provider.

Scoped to openai twins on purpose. `ChatGPTConfig` and `ChatGPTResponsesAPIConfig` subclass
their openai counterparts, so a chatgpt row's reasoning behaviour is whatever the openai row
describes. The azure rows are a separate registry that already diverges from openai here, and
pinning them to each other would assert something this repository does not control.
"""
pairs = []
for name, entry in prices.items():
if not isinstance(entry, dict) or not name.startswith("chatgpt/"):
continue
bare = name.split("/", 1)[1]
twin = prices.get(bare)
if isinstance(twin, dict) and twin.get("litellm_provider") == "openai":
pairs.append((name, bare))
return pairs


def test_chatgpt_rows_carry_their_openai_twin_reasoning_annotations(prices: dict):
"""A chatgpt row must not silently drop the reasoning annotations of the model it proxies.

`litellm.utils._get_model_info_from_generalization` refuses to fall back when an exact cost-map
key exists, so an unannotated `chatgpt/<model>` row wins over its annotated twin and
`/model/info` reports the model as non-reasoning.
"""
twins = chatgpt_openai_twins(prices)
assert twins, "no chatgpt/* row has an openai twin any more; this guard has stopped guarding"

mismatched = []
for name, bare in twins:
for key in REASONING_ANNOTATION_KEYS:
if key in prices[bare] and prices[name].get(key) != prices[bare][key]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Extra flags escape the guard The test checks only keys on the OpenAI twin, so an extra ChatGPT effort flag passes and can falsely advertise support

Suggested change
if key in prices[bare] and prices[name].get(key) != prices[bare][key]:
if (key in prices[name], prices[name].get(key)) != (key in prices[bare], prices[bare].get(key)):

mismatched.append(f"{name}.{key} is {prices[name].get(key)!r}, {bare}.{key} is {prices[bare][key]!r}")

assert mismatched == [], (
"chatgpt/* entries proxy their openai twin through ChatGPTConfig, so they must carry the "
"same reasoning annotations; an exact cost-map key blocks the generalization fallback, so "
"a missing flag here is reported to callers as 'not a reasoning model':\n" + "\n".join(mismatched)
)


def test_chat_latest_declares_the_one_effort_openai_accepts(prices: dict):
"""OpenAI rejects every reasoning.effort on chat-latest except medium, and a reasoning entry
with no declared levels resolves to None, which lets /model_group/info and the dashboard offer
Expand Down
Loading