The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(baseten): forward reasoning_effort to Baseten Model API (#40152)
Yousef Joe13335266f59a
diff --git a/litellm/llms/baseten/chat.py b/litellm/llms/baseten/chat.pyindex 0374646f2f3..e92f47c41c0 100644--- a/litellm/llms/baseten/chat.py+++ b/litellm/llms/baseten/chat.py@@ -54,6 +54,7 @@ class BasetenConfig(OpenAIGPTConfig):return ["max_tokens","max_completion_tokens",+ "reasoning_effort","response_format","seed","stop",diff --git a/tests/unit/llms/baseten/chat/test_baseten_completions.py b/tests/unit/llms/baseten/chat/test_baseten_completions.pyindex caf96987933..9195df13242 100644--- a/tests/unit/llms/baseten/chat/test_baseten_completions.py+++ b/tests/unit/llms/baseten/chat/test_baseten_completions.py@@ -18,10 +18,7 @@ class TestBasetenRouting:)# Model API (non-8-character)- assert (- config.get_api_base_for_model("openai/gpt-oss-120b")- == "https://inference.baseten.co/v1"- )+ assert config.get_api_base_for_model("openai/gpt-oss-120b") == "https://inference.baseten.co/v1"class TestBasetenModelAPI:@@ -47,12 +44,37 @@ class TestBasetenModelAPI:assert result["top_p"] == 0.9# Test provider info- api_base, api_key = config._get_openai_compatible_provider_info(- None, "test-key"- )+ api_base, api_key = config._get_openai_compatible_provider_info(None, "test-key")assert api_base == "https://inference.baseten.co/v1"assert api_key == "test-key"+class TestBasetenReasoningEffort:+ def test_reasoning_effort_passthrough_with_drop_params(self):+ config = BasetenConfig()++ result = config.map_openai_params(+ non_default_params={"reasoning_effort": "high", "max_tokens": 100},+ optional_params={},+ model="deepseek-ai/DeepSeek-V4-Flash-0731",+ drop_params=True,+ )++ assert result["reasoning_effort"] == "high"+ assert result["max_tokens"] == 100++ def test_reasoning_effort_none_passthrough(self):+ config = BasetenConfig()++ result = config.map_openai_params(+ non_default_params={"reasoning_effort": "none"},+ optional_params={},+ model="moonshotai/Kimi-K3",+ drop_params=True,+ )++ assert result["reasoning_effort"] == "none"++if __name__ == "__main__":pytest.main([__file__])