From 562902c75a74af8546ebbf789e1654879418c522 Mon Sep 17 00:00:00 2001 From: BytesBrains <292983167+bytesbrains@users.noreply.github.com> Date: Wed, 23 Sep 2026 02:15:01 +0530 Subject: [PATCH] fix(cruise): keep cruise out of the OpenAI audio providers and list it in Add Model Registering cruise in openai_compatible_providers also put it in OPENAI_AUDIO_TRANSCRIPTION_PROVIDERS and the speech route, which Cruise does not serve. Chat completions already resolve JSON providers through JSONProviderRegistry, so the entry was not needed for chat. Add the provider_create_fields.json entry that test_every_backend_provider_is_listed_in_add_model_or_frozen_as_unlisted requires, and drop the comment and test docstrings per AGENTS.md. Co-Authored-By: Claude Opus 5.5 (1M context) --- litellm/constants.py | 1 - .../provider_create_fields.json | 28 +++++++++++++++ .../llms/openai_like/test_cruise_provider.py | 34 +++++++++++++------ 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/litellm/constants.py b/litellm/constants.py index c53afaf1ad8..f620680ff50 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -1008,7 +1008,6 @@ openai_compatible_providers: Final[list] = [ "meta", # Meta Model API (Muse Spark) - JSON-configured provider "cognition", "scx-ai", - "cruise", # BytesBrains Cruise - JSON-configured provider ] OPENAI_AUDIO_TRANSCRIPTION_PROVIDERS: Final = frozenset({"openai"} | frozenset(openai_compatible_providers)) diff --git a/litellm/proxy/public_endpoints/provider_create_fields.json b/litellm/proxy/public_endpoints/provider_create_fields.json index 0ca08cb7992..9b036b4f9ce 100644 --- a/litellm/proxy/public_endpoints/provider_create_fields.json +++ b/litellm/proxy/public_endpoints/provider_create_fields.json @@ -2985,6 +2985,34 @@ ], "default_model_placeholder": "sap/gpt-4" }, + { + "provider": "CRUISE", + "provider_display_name": "BytesBrains Cruise", + "litellm_provider": "cruise", + "credential_fields": [ + { + "key": "api_base", + "label": "API Base", + "placeholder": "https://cruise.bytesbrains.net/v1", + "tooltip": null, + "required": false, + "field_type": "text", + "options": null, + "default_value": null + }, + { + "key": "api_key", + "label": "API Key", + "placeholder": null, + "tooltip": null, + "required": true, + "field_type": "password", + "options": null, + "default_value": null + } + ], + "default_model_placeholder": "cruise/anthropic/claude-sonnet-5" + }, { "provider": "SCX_AI", "provider_display_name": "SCX.ai", diff --git a/tests/test_litellm/llms/openai_like/test_cruise_provider.py b/tests/test_litellm/llms/openai_like/test_cruise_provider.py index 14c0bf35dd0..e128e302b71 100644 --- a/tests/test_litellm/llms/openai_like/test_cruise_provider.py +++ b/tests/test_litellm/llms/openai_like/test_cruise_provider.py @@ -1,7 +1,3 @@ -""" -Tests for BytesBrains Cruise provider configuration and integration. -""" - import litellm @@ -24,14 +20,13 @@ class TestCruiseProviderConfig: assert cruise.api_key_env == "CRUISE_API_KEY" assert cruise.api_base_env == "CRUISE_API_BASE" - def test_cruise_in_openai_compatible_providers(self): - from litellm.constants import openai_compatible_providers + def test_cruise_not_routed_to_openai_audio_transcription(self): + from litellm.constants import OPENAI_AUDIO_TRANSCRIPTION_PROVIDERS, openai_compatible_providers - assert "cruise" in openai_compatible_providers + assert "cruise" not in openai_compatible_providers + assert "cruise" not in OPENAI_AUDIO_TRANSCRIPTION_PROVIDERS def test_cruise_provider_resolution_keeps_upstream_prefix(self): - """Cruise model ids carry their own provider prefix, e.g. `anthropic/claude-sonnet-5`. - Only the leading `cruise/` is LiteLLM's; the rest must reach Cruise intact.""" from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider model, provider, api_key, api_base = get_llm_provider( @@ -78,7 +73,6 @@ class TestCruiseProviderConfig: assert api_key == "cru_test" def test_cruise_max_completion_tokens_passed_through(self): - """Cruise accepts `max_completion_tokens` as sent, so no mapping to `max_tokens`.""" from litellm.llms.openai_like.dynamic_config import create_config_class from litellm.llms.openai_like.json_loader import JSONProviderRegistry @@ -129,3 +123,23 @@ class TestCruiseEndpointSupport: assert root["cruise"] == backup["cruise"] assert root["cruise"]["endpoints"]["chat_completions"] is True assert root["cruise"]["endpoints"]["responses"] is False + + +class TestCruiseDashboardRegistration: + def test_cruise_is_selectable_in_the_add_model_form(self): + import json + from pathlib import Path + + path = Path(litellm.__file__).parent / "proxy" / "public_endpoints" / "provider_create_fields.json" + with open(path) as f: + entries = [e for e in json.load(f) if e["litellm_provider"] == "cruise"] + + assert len(entries) == 1 + entry = entries[0] + assert entry["provider"] == "CRUISE" + assert entry["default_model_placeholder"].startswith("cruise/") + + fields = {f["key"]: f for f in entry["credential_fields"]} + assert fields["api_key"]["required"] is True + assert fields["api_key"]["field_type"] == "password" + assert fields["api_base"]["required"] is False