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
[Feat] Add `reasoning_effort` param for hosted_vllm provider (#13620)
Ishaan Jaff5bb96af818a4
diff --git a/docs/my-website/docs/providers/vllm.md b/docs/my-website/docs/providers/vllm.mdindex d8b201956e2..5472f0602f4 100644--- a/docs/my-website/docs/providers/vllm.md+++ b/docs/my-website/docs/providers/vllm.md@@ -104,6 +104,52 @@ Here's how to call an OpenAI-Compatible Endpoint with the LiteLLM Proxy Server</Tabs>+ ## Reasoning Effort++ <Tabs>+ <TabItem value="sdk" label="SDK">++ ```python+ from litellm import completion++ response = completion(+ model="hosted_vllm/gpt-oss-120b",+ messages=[{"role": "user", "content": "whats 2 + 2"}],+ reasoning_effort="high",+ api_base="https://hosted-vllm-api.co",+ )+ print(response)+ ```+ </TabItem>+ <TabItem value="proxy" label="PROXY">++ 1. Setup config.yaml++ ```yaml+ model_list:+ - model_name: gpt-oss-120b+ litellm_params:+ model: hosted_vllm/gpt-oss-120b+ api_base: https://hosted-vllm-api.co+ ```++ 2. Start the proxy++ ```bash+ litellm --config /path/to/config.yaml+ ```++ 3. Test it!++ ```bash+ curl http://0.0.0.0:4000/v1/chat/completions \+ -H "Content-Type: application/json" \+ -d '{"model": "gpt-oss-120b", "messages": [{"role": "user", "content": "whats 2 + 2"}], "reasoning_effort": "high"}'+ ```++ </TabItem>+ </Tabs>+## Embeddingsdiff --git a/litellm/llms/hosted_vllm/chat/transformation.py b/litellm/llms/hosted_vllm/chat/transformation.pyindex 529354f80eb..1d21490ea31 100644--- a/litellm/llms/hosted_vllm/chat/transformation.py+++ b/litellm/llms/hosted_vllm/chat/transformation.py@@ -21,6 +21,11 @@ from ...openai.chat.gpt_transformation import OpenAIGPTConfigclass HostedVLLMChatConfig(OpenAIGPTConfig):+ def get_supported_openai_params(self, model: str) -> List[str]:+ params = super().get_supported_openai_params(model)+ params.append("reasoning_effort")+ return params+def map_openai_params(self,non_default_params: dict,diff --git a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.pyindex 01acd144305..3749a5a8ca4 100644--- a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py+++ b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py@@ -86,3 +86,18 @@ def test_hosted_vllm_chat_transformation_with_audio_url():],}]+++def test_hosted_vllm_supports_reasoning_effort():+ config = HostedVLLMChatConfig()+ supported_params = config.get_supported_openai_params(+ model="hosted_vllm/gpt-oss-120b"+ )+ assert "reasoning_effort" in supported_params+ optional_params = config.map_openai_params(+ non_default_params={"reasoning_effort": "high"},+ optional_params={},+ model="hosted_vllm/gpt-oss-120b",+ drop_params=False,+ )+ assert optional_params["reasoning_effort"] == "high"