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(crusoe): add param_mappings for max_completion_tokens → max_tokens
Emmanuel Acheampong2805572e9b98
diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.jsonindex acbbd8b6123..b5e5aa4ea28 100644--- a/litellm/llms/openai_like/providers.json+++ b/litellm/llms/openai_like/providers.json@@ -110,6 +110,9 @@"crusoe": {"base_url": "https://managed-inference-api-proxy.crusoecloud.com/v1","api_key_env": "CRUSOE_API_KEY",- "api_base_env": "CRUSOE_API_BASE"+ "api_base_env": "CRUSOE_API_BASE",+ "param_mappings": {+ "max_completion_tokens": "max_tokens"+ }}}diff --git a/tests/test_litellm/llms/crusoe/test_crusoe.py b/tests/test_litellm/llms/crusoe/test_crusoe.pyindex 70c538d915a..877d13451be 100644--- a/tests/test_litellm/llms/crusoe/test_crusoe.py+++ b/tests/test_litellm/llms/crusoe/test_crusoe.py@@ -78,6 +78,24 @@ def test_crusoe_supported_params():assert "stream" in params+def test_crusoe_param_mapping_max_completion_tokens():+ """Test max_completion_tokens is mapped to max_tokens for Crusoe"""+ from litellm.llms.openai_like.dynamic_config import create_config_class+ from litellm.llms.openai_like.json_loader import JSONProviderRegistry++ config = create_config_class(JSONProviderRegistry.get("crusoe"))()+ optional_params = config.map_openai_params(+ non_default_params={"max_completion_tokens": 1024},+ optional_params={},+ model="meta-llama/Llama-3.3-70B-Instruct",+ drop_params=False,+ )++ assert "max_tokens" in optional_params, "max_completion_tokens should be mapped to max_tokens"+ assert optional_params["max_tokens"] == 1024+ assert "max_completion_tokens" not in optional_params++def test_crusoe_provider_detection_by_prefix():"""Test crusoe/model prefix is correctly routed"""from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider