From 6090629ee08689fa4d56e50dfa4e54b293e814ad Mon Sep 17 00:00:00 2001 From: unclecode Date: Fri, 16 Jan 2026 09:56:38 +0000 Subject: [PATCH] Fix: Enable litellm.drop_params for O-series/GPT-5 model compatibility O-series (o1, o3) and GPT-5 models only support temperature=1. Setting litellm.drop_params=True auto-drops unsupported parameters instead of throwing UnsupportedParamsError. Fixes temperature=0.01 error for these models in LLM extraction. --- crawl4ai/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crawl4ai/utils.py b/crawl4ai/utils.py index ed12892e..e5efba07 100644 --- a/crawl4ai/utils.py +++ b/crawl4ai/utils.py @@ -1775,6 +1775,8 @@ def perform_completion_with_backoff( from litellm import completion from litellm.exceptions import RateLimitError + import litellm + litellm.drop_params = True # Auto-drop unsupported params (e.g., temperature for O-series/GPT-5) extra_args = {"temperature": 0.01, "api_key": api_token, "base_url": base_url} if json_response: @@ -1864,7 +1866,9 @@ async def aperform_completion_with_backoff( from litellm import acompletion from litellm.exceptions import RateLimitError + import litellm import asyncio + litellm.drop_params = True # Auto-drop unsupported params (e.g., temperature for O-series/GPT-5) extra_args = {"temperature": 0.01, "api_key": api_token, "base_url": base_url} if json_response: