From ca070277b068e3ae6627286486588378726ab215 Mon Sep 17 00:00:00 2001 From: Priyansh Nandwana Date: Sat, 25 Jul 2026 14:21:13 +0530 Subject: [PATCH] feat(pricing): add groq/qwen/qwen3.6-27b to model cost map Groq serves qwen/qwen3.6-27b but it was missing from the cost map, so cost tracking for it silently defaulted to zero and get_model_info raised "This model isn't mapped yet" Pricing, context window and capability flags are taken from Groq's models API: 0.60 USD/1M input tokens, 3.00 USD/1M output tokens, 0.30 USD/1M cached input tokens, 131072 context window, 16384 max output, tools, JSON schema, reasoning and image input support Added a regression test asserting the resolved model info and the raw cost-map entry so the pricing and capability flags cannot silently drift --- ...odel_prices_and_context_window_backup.json | 15 +++++ model_prices_and_context_window.json | 15 +++++ .../groq/test_groq_qwen3_6_27b_metadata.py | 60 +++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 tests/test_litellm/llms/groq/test_groq_qwen3_6_27b_metadata.py diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index d43eda39b1f..a2eb4f8032c 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -25692,6 +25692,21 @@ "supports_response_schema": false, "supports_tool_choice": true }, + "groq/qwen/qwen3.6-27b": { + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 6e-07, + "litellm_provider": "groq", + "max_input_tokens": 131072, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 3e-06, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, "groq/whisper-large-v3": { "input_cost_per_second": 3.083e-05, "litellm_provider": "groq", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 749b2566c2a..a2810f28e5c 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -25767,6 +25767,21 @@ "supports_response_schema": false, "supports_tool_choice": true }, + "groq/qwen/qwen3.6-27b": { + "cache_read_input_token_cost": 3e-07, + "input_cost_per_token": 6e-07, + "litellm_provider": "groq", + "max_input_tokens": 131072, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 3e-06, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, "groq/whisper-large-v3": { "input_cost_per_second": 3.083e-05, "litellm_provider": "groq", diff --git a/tests/test_litellm/llms/groq/test_groq_qwen3_6_27b_metadata.py b/tests/test_litellm/llms/groq/test_groq_qwen3_6_27b_metadata.py new file mode 100644 index 00000000000..ddf34112e61 --- /dev/null +++ b/tests/test_litellm/llms/groq/test_groq_qwen3_6_27b_metadata.py @@ -0,0 +1,60 @@ +""" +Test Groq qwen3.6-27b model metadata in the cost map. +""" + +import json +from importlib.resources import files + +import pytest + + +@pytest.fixture(scope="module") +def use_local_model_cost_map(): + monkeypatch = pytest.MonkeyPatch() + monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True") + + import litellm + from litellm.utils import _invalidate_model_cost_lowercase_map + + original_model_cost = litellm.model_cost + litellm.model_cost = json.loads( + files("litellm").joinpath("model_prices_and_context_window_backup.json").read_text(encoding="utf-8") + ) + litellm.get_model_info.cache_clear() + _invalidate_model_cost_lowercase_map() + try: + yield litellm + finally: + litellm.model_cost = original_model_cost + litellm.get_model_info.cache_clear() + _invalidate_model_cost_lowercase_map() + monkeypatch.undo() + + +def test_groq_qwen3_6_27b_model_info(use_local_model_cost_map): + model_info = use_local_model_cost_map.get_model_info(model="groq/qwen/qwen3.6-27b") + + assert model_info["litellm_provider"] == "groq" + assert model_info["mode"] == "chat" + assert model_info["max_input_tokens"] == 131072 + assert model_info["max_output_tokens"] == 16384 + assert model_info["max_tokens"] == 16384 + assert model_info["input_cost_per_token"] == pytest.approx(6e-07) + assert model_info["output_cost_per_token"] == pytest.approx(3e-06) + assert model_info["cache_read_input_token_cost"] == pytest.approx(3e-07) + assert model_info["supports_function_calling"] is True + assert model_info["supports_reasoning"] is True + assert model_info["supports_response_schema"] is True + assert model_info["supports_tool_choice"] is True + assert model_info["supports_vision"] is True + + +def test_groq_qwen3_6_27b_raw_model_cost_entry(use_local_model_cost_map): + model_info = use_local_model_cost_map.model_cost["groq/qwen/qwen3.6-27b"] + + assert model_info["litellm_provider"] == "groq" + assert model_info["mode"] == "chat" + assert model_info["input_cost_per_token"] == pytest.approx(6e-07) + assert model_info["output_cost_per_token"] == pytest.approx(3e-06) + assert model_info["cache_read_input_token_cost"] == pytest.approx(3e-07) + assert model_info["supports_vision"] is True