mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
Merge f9957c7eb0 into 9e20264607
This commit is contained in:
commit
b417dba941
2 changed files with 30 additions and 7 deletions
|
|
@ -54,6 +54,7 @@ class BasetenConfig(OpenAIGPTConfig):
|
|||
return [
|
||||
"max_tokens",
|
||||
"max_completion_tokens",
|
||||
"reasoning_effort",
|
||||
"response_format",
|
||||
"seed",
|
||||
"stop",
|
||||
|
|
|
|||
|
|
@ -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__])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue