From 946fbbbead849fc948e50ef726242c47013a43b7 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Mon, 22 Jun 2026 10:25:20 -0400 Subject: [PATCH] fix(groq): replace deprecated Groq llama models (#38363) Groq is deprecating `llama-3.1-8b-instant` and `llama-3.3-70b-versatile` (shutdown 08/16/26, per [Groq's deprecation notice](https://console.groq.com/docs/deprecations#august-16-2026-llama318binstant-and-llama3370bversatile)). This migrates the `langchain-groq` docstring examples and tests to the recommended replacements: `openai/gpt-oss-20b` (for 8b-instant) and `openai/gpt-oss-120b` (for 70b-versatile). The strict-output unit test uses `qwen/qwen3.6-27b` since it requires a model that does not support strict JSON schema. The auto-generated `data/_profiles.py` is left untouched (reference data, not usage). Made by [Open SWE](https://openswe.vercel.app/agents/22845b4e-674d-346e-c594-612a8cbcedbd) --------- Co-authored-by: open-swe[bot] --- libs/partners/groq/langchain_groq/chat_models.py | 10 +++++----- .../groq/tests/integration_tests/test_chat_models.py | 4 +++- .../groq/tests/integration_tests/test_standard.py | 6 +++++- .../tests/unit_tests/__snapshots__/test_standard.ambr | 2 +- .../partners/groq/tests/unit_tests/test_chat_models.py | 2 +- libs/partners/groq/tests/unit_tests/test_standard.py | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libs/partners/groq/langchain_groq/chat_models.py b/libs/partners/groq/langchain_groq/chat_models.py index d98eb734610..95db3b86b55 100644 --- a/libs/partners/groq/langchain_groq/chat_models.py +++ b/libs/partners/groq/langchain_groq/chat_models.py @@ -108,7 +108,7 @@ class ChatGroq(BaseChatModel): Key init args — completion params: model: - Name of Groq model to use, e.g. `llama-3.1-8b-instant`. + Name of Groq model to use, e.g. `openai/gpt-oss-20b`. temperature: Sampling temperature. Ranges from `0.0` to `1.0`. max_tokens: @@ -153,7 +153,7 @@ class ChatGroq(BaseChatModel): from langchain_groq import ChatGroq model = ChatGroq( - model="llama-3.1-8b-instant", + model="openai/gpt-oss-20b", temperature=0.0, max_retries=2, # other params... @@ -175,7 +175,7 @@ class ChatGroq(BaseChatModel): response_metadata={'token_usage': {'completion_tokens': 38, 'prompt_tokens': 28, 'total_tokens': 66, 'completion_time': 0.057975474, 'prompt_time': 0.005366091, 'queue_time': None, - 'total_time': 0.063341565}, 'model_name': 'llama-3.1-8b-instant', + 'total_time': 0.063341565}, 'model_name': 'openai/gpt-oss-20b', 'system_fingerprint': 'fp_c5f20b5bb1', 'finish_reason': 'stop', 'logprobs': None}, id='run-ecc71d70-e10c-4b69-8b8c-b8027d95d4b8-0') ``` @@ -257,7 +257,7 @@ class ChatGroq(BaseChatModel): response_metadata={'token_usage': {'completion_tokens': 53, 'prompt_tokens': 28, 'total_tokens': 81, 'completion_time': 0.083623752, 'prompt_time': 0.007365126, 'queue_time': None, - 'total_time': 0.090988878}, 'model_name': 'llama-3.1-8b-instant', + 'total_time': 0.090988878}, 'model_name': 'openai/gpt-oss-20b', 'system_fingerprint': 'fp_c5f20b5bb1', 'finish_reason': 'stop', 'logprobs': None}, id='run-897f3391-1bea-42e2-82e0-686e2367bcf8-0') ``` @@ -342,7 +342,7 @@ class ChatGroq(BaseChatModel): "queue_time": None, "total_time": 0.11947467, }, - "model_name": "llama-3.1-8b-instant", + "model_name": "openai/gpt-oss-20b", "system_fingerprint": "fp_c5f20b5bb1", "finish_reason": "stop", "logprobs": None, diff --git a/libs/partners/groq/tests/integration_tests/test_chat_models.py b/libs/partners/groq/tests/integration_tests/test_chat_models.py index e1cba270728..8efb3318b6c 100644 --- a/libs/partners/groq/tests/integration_tests/test_chat_models.py +++ b/libs/partners/groq/tests/integration_tests/test_chat_models.py @@ -379,7 +379,9 @@ def test_streaming_generation_info() -> None: callback = _FakeCallback() chat = ChatGroq( - model="llama-3.1-8b-instant", # Use a model that properly streams content + # Non-reasoning model so the first tokens are plain content + model="qwen/qwen3.6-27b", + reasoning_effort="none", max_tokens=2, temperature=0, callbacks=[callback], diff --git a/libs/partners/groq/tests/integration_tests/test_standard.py b/libs/partners/groq/tests/integration_tests/test_standard.py index 2befd004b44..c9b75352b1f 100644 --- a/libs/partners/groq/tests/integration_tests/test_standard.py +++ b/libs/partners/groq/tests/integration_tests/test_standard.py @@ -21,7 +21,11 @@ class TestGroq(ChatModelIntegrationTests): @property def chat_model_params(self) -> dict: - return {"model": "llama-3.3-70b-versatile", "rate_limiter": rate_limiter} + return { + "model": "qwen/qwen3.6-27b", + "reasoning_effort": "none", + "rate_limiter": rate_limiter, + } @pytest.mark.xfail( reason="Groq models have inconsistent tool calling performance. See: " diff --git a/libs/partners/groq/tests/unit_tests/__snapshots__/test_standard.ambr b/libs/partners/groq/tests/unit_tests/__snapshots__/test_standard.ambr index 055fad288c1..ee309201725 100644 --- a/libs/partners/groq/tests/unit_tests/__snapshots__/test_standard.ambr +++ b/libs/partners/groq/tests/unit_tests/__snapshots__/test_standard.ambr @@ -16,7 +16,7 @@ }), 'max_retries': 2, 'max_tokens': 100, - 'model_name': 'llama-3.1-8b-instant', + 'model_name': 'openai/gpt-oss-20b', 'n': 1, 'request_timeout': 60.0, 'service_tier': 'on_demand', diff --git a/libs/partners/groq/tests/unit_tests/test_chat_models.py b/libs/partners/groq/tests/unit_tests/test_chat_models.py index e187f7e8975..de7d735c396 100644 --- a/libs/partners/groq/tests/unit_tests/test_chat_models.py +++ b/libs/partners/groq/tests/unit_tests/test_chat_models.py @@ -289,7 +289,7 @@ def test_with_structured_output_json_schema_strict_ignored_on_unsupported_model( foo: str - structured_model = ChatGroq(model="llama-3.1-8b-instant").with_structured_output( + structured_model = ChatGroq(model="qwen/qwen3.6-27b").with_structured_output( Response, method="json_schema", strict=True ) diff --git a/libs/partners/groq/tests/unit_tests/test_standard.py b/libs/partners/groq/tests/unit_tests/test_standard.py index 5bcdfc869b8..0cd1033e650 100644 --- a/libs/partners/groq/tests/unit_tests/test_standard.py +++ b/libs/partners/groq/tests/unit_tests/test_standard.py @@ -17,4 +17,4 @@ class TestGroqStandard(ChatModelUnitTests): @property def chat_model_params(self) -> dict: - return {"model": "llama-3.1-8b-instant"} + return {"model": "openai/gpt-oss-20b"}