feat(router): add router plugin reference catalog - #33746
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Greptile SummaryThis PR introduces
Confidence Score: 3/5Safe to merge only after removing or replacing the template entry; as-is, any tooling iterating the catalog array will encounter invalid field values in the first element. The real plugin entry (language-detector) is well-formed and the commit-pinning rationale is sound, but the template element embedded in the array has multiple fields containing prose instructions rather than typed values — notably pypi is a long descriptive string where null is expected, and repo, version, entrypoint, and license all contain non-conforming text. This will break any consumer that iterates the array expecting real entries. router_plugins.json — the template entry at index 0 needs to be removed or moved outside the array before the catalog is safe for programmatic use.
|
| Filename | Overview |
|---|---|
| router_plugins.json | New root-level plugin catalog with one real entry (language-detector) and one template entry that has invalid placeholder values across multiple fields, which will confuse any programmatic consumer of the array. |
Reviews (1): Last reviewed commit: "feat(router): add router plugin referenc..." | Re-trigger Greptile
| { | ||
| "name": "TEMPLATE: copy this block for a new plugin, then delete this entry", | ||
| "description": "One line on what the plugin does and the routing signal it publishes.", | ||
| "author": "Plugin author's name.", | ||
| "repo": "https://github.com/<owner>/<repo> (public source repository).", | ||
| "commit": "Full 40-char git SHA to pin when the plugin is not yet on PyPI; omit once 'pypi' is set.", | ||
| "version": "Plugin release version, e.g. 1.0.0.", | ||
| "pypi": "PyPI spec pinned to a version, e.g. my-plugin==1.0.0, or null if unpublished.", | ||
| "litellm_version": "Minimum compatible litellm version, e.g. >=1.94.0.", | ||
| "entrypoint": "Dotted import path to the plugin instance, e.g. my_plugin.plugin.instance.", | ||
| "license": "SPDX license id, e.g. MIT.", | ||
| "tags": ["searchable", "keywords"] | ||
| }, |
There was a problem hiding this comment.
Template entry poisons the machine-readable catalog
The PR describes this file as a "machine-readable reference catalog," yet the first array element is a template with several fields containing descriptive prose instead of valid data values. Concretely, pypi is set to the string "PyPI spec pinned to a version, e.g. my-plugin==1.0.0, or null if unpublished." instead of null, repo contains <owner>/<repo> placeholder text (not a valid URL), version and license hold sentence-length instructions, and entrypoint is not a dotted import path. Any tool that iterates the array treating every element as a real plugin entry will see this as a plugin to load or install, and will either crash or attempt nonsensical operations (e.g., pip install "PyPI spec pinned to a version...").
| [ | ||
| { | ||
| "name": "TEMPLATE: copy this block for a new plugin, then delete this entry", | ||
| "description": "One line on what the plugin does and the routing signal it publishes.", | ||
| "author": "Plugin author's name.", | ||
| "repo": "https://github.com/<owner>/<repo> (public source repository).", | ||
| "commit": "Full 40-char git SHA to pin when the plugin is not yet on PyPI; omit once 'pypi' is set.", | ||
| "version": "Plugin release version, e.g. 1.0.0.", | ||
| "pypi": "PyPI spec pinned to a version, e.g. my-plugin==1.0.0, or null if unpublished.", | ||
| "litellm_version": "Minimum compatible litellm version, e.g. >=1.94.0.", | ||
| "entrypoint": "Dotted import path to the plugin instance, e.g. my_plugin.plugin.instance.", | ||
| "license": "SPDX license id, e.g. MIT.", | ||
| "tags": ["searchable", "keywords"] | ||
| }, | ||
| { | ||
| "name": "language-detector", | ||
| "description": "Detects the user's language and publishes a routing signal.", | ||
| "author": "Jean Nuñez", | ||
| "repo": "https://github.com/jeann2013/language-detector", | ||
| "commit": "9e712819269173fc25a16f59ca3e9890f7864ac1", | ||
| "version": "1.0.0", | ||
| "pypi": null, | ||
| "litellm_version": ">=1.94.0", | ||
| "entrypoint": "litellm_plugin_language_detector.plugin.language_detector_plugin", | ||
| "license": "MIT", | ||
| "tags": ["language", "classification", "routing"] | ||
| } | ||
| ] |
There was a problem hiding this comment.
No JSON schema to guard future entries
There is no accompanying JSON Schema (e.g., router_plugins.schema.json) defining the required fields, their types, and constraints (e.g., version must be a semver string, pypi must be a string or null, litellm_version must match a version-specifier pattern). Without one, contributors can submit entries with missing or mistyped fields and nothing in CI will catch it before the catalog is consumed by tooling.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
f9a217e
into
litellm_internal_staging
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review)
Screenshots / Proof of Fix
Static JSON reference catalog, so live proxy proof is not applicable. Syntax proof:
python -m json.tool router_plugins.json >/dev/nullOutput:
Type
New Feature
Changes
Adds
router_plugins.jsonas a root-level, machine-readable reference catalog for routing plugins. The catalog is a plain JSON array of plugin entries so users can decide whether a plugin fits without opening its repositoryEach entry carries lightweight, evaluation-focused metadata:
name,description,author,repo,commit,version,pypi,litellm_version,entrypoint,license, andtags.versionsupports update tracking,litellm_versionguards compatibility,entrypointgives a deterministic dotted path to load the plugin,licensehelps orgs evaluate third-party plugins, andtagsenable filteringSeeded with one entry for Jean's language detector plugin.
pypiis null for this entry because the package is not published on PyPI yet; advertising apip installof an unclaimed name is a namesquatting risk (flagged by Veria), so the entry pins the reviewedrepoat an immutablecommitas the trustworthy source until a release is published from a trusted accountFinal Attestation