feat(router): add router plugin reference catalog

This commit is contained in:
Krrish Dholakia 2026-07-16 21:10:07 -07:00
parent 4cfc987f56
commit c7551197a3
2 changed files with 87 additions and 0 deletions

56
router_plugins.json Normal file
View file

@ -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"
]
}
}

View file

@ -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",
}