mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
fix(baseten): forward reasoning_effort to Baseten Model API
Baseten's Model API accepts a top-level reasoning_effort parameter and validates it server-side (https://docs.baseten.co/inference/model-apis/reasoning), but BasetenConfig.get_supported_openai_params did not list it, so LiteLLM silently dropped it when drop_params=True and raised UnsupportedParamsError otherwise. Add reasoning_effort to the supported params so map_openai_params forwards it verbatim, mirroring the hosted_vllm and deepseek providers. Baseten returns a clear 400 for values outside a model's supported set and ignores the parameter on non-reasoning models, so verbatim passthrough is safe for the whole catalog.
This commit is contained in:
parent
23820043b7
commit
f9957c7eb0
1 changed files with 2 additions and 23 deletions
|
|
@ -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,30 +44,13 @@ 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:
|
||||
"""Test reasoning_effort support for Baseten reasoning models.
|
||||
|
||||
Baseten's Model API accepts a top-level `reasoning_effort` parameter and
|
||||
validates it server-side (invalid values return 400), so LiteLLM should
|
||||
forward it verbatim instead of dropping it:
|
||||
https://docs.baseten.co/inference/model-apis/reasoning
|
||||
"""
|
||||
|
||||
def test_reasoning_effort_is_supported(self):
|
||||
"""reasoning_effort is advertised as a supported param"""
|
||||
config = BasetenConfig()
|
||||
|
||||
assert "reasoning_effort" in config.get_supported_openai_params(model="moonshotai/Kimi-K3")
|
||||
|
||||
def test_reasoning_effort_passthrough_with_drop_params(self):
|
||||
"""reasoning_effort survives drop_params=True and is forwarded verbatim"""
|
||||
config = BasetenConfig()
|
||||
|
||||
result = config.map_openai_params(
|
||||
|
|
@ -84,7 +64,6 @@ class TestBasetenReasoningEffort:
|
|||
assert result["max_tokens"] == 100
|
||||
|
||||
def test_reasoning_effort_none_passthrough(self):
|
||||
"""reasoning_effort="none" (disable thinking) is forwarded verbatim"""
|
||||
config = BasetenConfig()
|
||||
|
||||
result = config.map_openai_params(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue