From 5c04fdbc7d5dbff2ea0ec5eb63821fe305bdc2c8 Mon Sep 17 00:00:00 2001 From: ericmagliarditi <188399812+ericMConsus@users.noreply.github.com> Date: Fri, 8 May 2026 09:46:10 -0400 Subject: [PATCH] fix(consus): forward reasoning_effort + register in support manifest Addresses two points of feedback on the open PR: 1. Override `custom_llm_provider` and `get_supported_openai_params` on `ConsusChatConfig` so `reasoning_effort` is forwarded for models with `supports_reasoning: true` instead of being silently dropped by the parent's default param filter. Mirrors xAI's pattern (Greptile review). 2. Add a `consus` entry to `provider_endpoints_support.json` so the documentation-coverage guard in CI's `code-quality` job passes. Tests: new `TestConsusReasoningSupport` class with 3 cases verifying `reasoning_effort` is advertised for Claude (reasoning), suppressed for GPT-4.1 (non-reasoning), and that `custom_llm_provider` returns `"consus"`. All 17 Consus tests pass. --- litellm/llms/consus/chat/transformation.py | 15 ++++++++++++ provider_endpoints_support.json | 18 +++++++++++++++ .../chat/test_consus_chat_transformation.py | 23 +++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/litellm/llms/consus/chat/transformation.py b/litellm/llms/consus/chat/transformation.py index b8720f787f3..0a461b73333 100644 --- a/litellm/llms/consus/chat/transformation.py +++ b/litellm/llms/consus/chat/transformation.py @@ -18,10 +18,25 @@ CONSUS_API_BASE = "https://api.consus.io/v1" class ConsusChatConfig(OpenAIGPTConfig): + @property + def custom_llm_provider(self) -> Optional[str]: + return "consus" + @staticmethod def _resolve_api_key(api_key: Optional[str]) -> Optional[str]: return api_key or litellm.consus_key or get_secret_str("CONSUS_API_KEY") + def get_supported_openai_params(self, model: str) -> list: + base_params = super().get_supported_openai_params(model) + try: + if litellm.supports_reasoning( + model=model, custom_llm_provider=self.custom_llm_provider + ): + base_params.append("reasoning_effort") + except Exception: + pass + return base_params + def _get_openai_compatible_provider_info( self, api_base: Optional[str], api_key: Optional[str] ) -> Tuple[Optional[str], Optional[str]]: diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index 1d577213a1b..d094bb230fb 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -635,6 +635,24 @@ "interactions": true } }, + "consus": { + "display_name": "Consus (`consus`)", + "url": "https://docs.litellm.ai/docs/providers/consus", + "endpoints": { + "chat_completions": true, + "messages": true, + "responses": true, + "embeddings": false, + "image_generations": false, + "audio_transcriptions": false, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false, + "a2a": true, + "interactions": true + } + }, "crusoe": { "display_name": "Crusoe (`crusoe`)", "url": "https://docs.litellm.ai/docs/providers/crusoe", diff --git a/tests/test_litellm/llms/consus/chat/test_consus_chat_transformation.py b/tests/test_litellm/llms/consus/chat/test_consus_chat_transformation.py index 2d8423b151d..79863c789ce 100644 --- a/tests/test_litellm/llms/consus/chat/test_consus_chat_transformation.py +++ b/tests/test_litellm/llms/consus/chat/test_consus_chat_transformation.py @@ -141,3 +141,26 @@ class TestConsusModelRouting: model, provider, _, _ = litellm.get_llm_provider("consus/gemini-2-5-pro:il5") assert provider == "consus" assert model == "gemini-2-5-pro:il5" + + +class TestConsusReasoningSupport: + """Reasoning-capable Consus models must surface `reasoning_effort` as a + supported OpenAI param so it isn't silently filtered out before the + request leaves LiteLLM. Models without `supports_reasoning: true` in + the catalog must NOT advertise the param. + """ + + def test_reasoning_effort_supported_for_claude_models(self): + config = ConsusChatConfig() + params = config.get_supported_openai_params("claude-sonnet-4-5:il2") + assert "reasoning_effort" in params + + def test_reasoning_effort_not_supported_for_gpt_4_1(self): + # gpt-4.1 is registered in the Consus catalog without + # `supports_reasoning`, so the param must NOT be advertised. + config = ConsusChatConfig() + params = config.get_supported_openai_params("gpt-4.1:il5+itar") + assert "reasoning_effort" not in params + + def test_custom_llm_provider_returns_consus(self): + assert ConsusChatConfig().custom_llm_provider == "consus"