diff --git a/router_plugins.json b/router_plugins.json new file mode 100644 index 00000000000..530df430e2f --- /dev/null +++ b/router_plugins.json @@ -0,0 +1,56 @@ +{ + "language-detector": { + "name": "litellm-plugin-language-detector", + "description": "LiteLLM routing plugin that detects user-message language and writes language signals for downstream routing.", + "source": { + "source": "github", + "repo": "jeann2013/language-detector" + }, + "homepage": "https://github.com/jeann2013/language-detector", + "install": { + "pip": "litellm-plugin-language-detector" + }, + "config": { + "sdk": { + "plugins": [ + "litellm_plugin_language_detector.LanguageDetectorPlugin" + ] + }, + "proxy": { + "router_settings.plugins": [ + "litellm_plugin_language_detector.plugin.language_detector_plugin" + ], + "complexity_router_config.plugins": [ + "litellm_plugin_language_detector.plugin.language_detector_plugin" + ] + } + }, + "signals": { + "language-detector": { + "language": "ISO-639-1 code or unknown", + "confidence": "float from 0.0 to 1.0", + "detector": "backend name" + } + }, + "keywords": [ + "language-detection", + "routing-plugin", + "signals", + "lingua" + ], + "category": "routing", + "min_litellm_version": "1.92.0", + "supported_languages": [ + "en", + "es", + "fr", + "de", + "pt", + "it", + "nl", + "ja", + "zh", + "ko" + ] + } +} diff --git a/tests/test_litellm/test_router_plugins_json.py b/tests/test_litellm/test_router_plugins_json.py new file mode 100644 index 00000000000..83719936ae0 --- /dev/null +++ b/tests/test_litellm/test_router_plugins_json.py @@ -0,0 +1,31 @@ +import json +from pathlib import Path + + +ROUTER_PLUGINS_PATH = Path(__file__).parents[2] / "router_plugins.json" + + +def test_router_plugins_json_is_valid_reference_catalog(): + data = json.loads(ROUTER_PLUGINS_PATH.read_text()) + + assert isinstance(data, dict) + assert "language-detector" in data + + language_detector = data["language-detector"] + assert isinstance(language_detector, dict) + assert language_detector["name"] == "litellm-plugin-language-detector" + assert language_detector["source"] == { + "source": "github", + "repo": "jeann2013/language-detector", + } + assert language_detector["config"]["proxy"]["router_settings.plugins"] == [ + "litellm_plugin_language_detector.plugin.language_detector_plugin" + ] + assert language_detector["config"]["proxy"]["complexity_router_config.plugins"] == [ + "litellm_plugin_language_detector.plugin.language_detector_plugin" + ] + assert language_detector["signals"]["language-detector"] == { + "language": "ISO-639-1 code or unknown", + "confidence": "float from 0.0 to 1.0", + "detector": "backend name", + }