DSPy: The framework for programming—not prompting—language models
Python
fix(deps): require LiteLLM reasoning capability API (#10003)
Isaac Miller6f1e17e1f756
diff --git a/pyproject.toml b/pyproject.tomlindex bed172609..8e5d893fe 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -27,7 +27,7 @@ dependencies = ["tqdm>=4.66.1","requests>=2.31.0","pydantic>=2.0",- "litellm>=1.64.0",+ "litellm>=1.65.8","diskcache>=5.6.0","json-repair>=0.54.2","tenacity>=8.2.3", # undeclared runtime dep of litellm, needed for exponential_backoff_retry@@ -44,7 +44,7 @@ mcp = ["mcp; python_version >= '3.10'"]langchain = ["langchain_core"]optuna = ["optuna>=3.4.0"]numpy = ["numpy>=1.26.0"]-litellm = ["litellm>=1.64.0"]+litellm = ["litellm>=1.65.8"]dev = ["pytest>=6.2.5","pytest-mock>=3.12.0",@@ -55,8 +55,8 @@ dev = ["datamodel_code_generator>=0.26.3","build>=1.0.3","numpy>=1.26.0",- "litellm>=1.64.0; sys_platform == 'win32' or python_version == '3.14'",- "litellm[proxy]>=1.64.0; sys_platform != 'win32' and python_version < '3.14'", # Remove 3.14 condition once uvloop supports+ "litellm>=1.65.8; sys_platform == 'win32' or python_version == '3.14'",+ "litellm[proxy]>=1.65.8; sys_platform != 'win32' and python_version < '3.14'", # Remove 3.14 condition once uvloop supports]test_extras = ["mcp; python_version >= '3.10'",diff --git a/tests/clients/test_lm.py b/tests/clients/test_lm.pyindex c3d7ee2b1..db70b379f 100644--- a/tests/clients/test_lm.py+++ b/tests/clients/test_lm.py@@ -396,6 +396,11 @@ def test_reasoning_model_token_parameter():assert lm.kwargs["max_tokens"] == 1000+def test_lm_supports_reasoning_with_litellm_capability_api():+ lm = dspy.LM("anthropic/claude-3-7-sonnet-20250219")+ assert lm.supports_reasoning is True++@pytest.mark.parametrize("model_name", ["openai/o1", "openai/gpt-5-nano", "openai/gpt-5-mini"])def test_reasoning_model_requirements(model_name):# Should raise assertion error if temperature or max_tokens requirements not metdiff --git a/uv.lock b/uv.lockindex 020cf4d9a..1e2598185 100644--- a/uv.lock+++ b/uv.lock@@ -846,10 +846,10 @@ requires-dist = [{ name = "json-repair", specifier = ">=0.54.2" },{ name = "langchain-core", marker = "extra == 'langchain'" },{ name = "langchain-core", marker = "extra == 'test-extras'" },- { name = "litellm", specifier = ">=1.64.0" },- { name = "litellm", marker = "(python_full_version == '3.14.*' and extra == 'dev') or (sys_platform == 'win32' and extra == 'dev')", specifier = ">=1.64.0" },- { name = "litellm", marker = "extra == 'litellm'", specifier = ">=1.64.0" },- { name = "litellm", extras = ["proxy"], marker = "python_full_version < '3.14' and sys_platform != 'win32' and extra == 'dev'", specifier = ">=1.64.0" },+ { name = "litellm", specifier = ">=1.65.8" },+ { name = "litellm", marker = "(python_full_version == '3.14.*' and extra == 'dev') or (sys_platform == 'win32' and extra == 'dev')", specifier = ">=1.65.8" },+ { name = "litellm", marker = "extra == 'litellm'", specifier = ">=1.65.8" },+ { name = "litellm", extras = ["proxy"], marker = "python_full_version < '3.14' and sys_platform != 'win32' and extra == 'dev'", specifier = ">=1.65.8" },{ name = "mcp", marker = "python_full_version >= '3.10' and extra == 'mcp'" },{ name = "mcp", marker = "python_full_version >= '3.10' and extra == 'test-extras'" },{ name = "numpy", marker = "extra == 'dev'", specifier = ">=1.26.0" },