Skip to content

feat(router): add router plugin reference catalog - #33746

Merged
yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/litellm-pr-resubmit-e15917
Jul 17, 2026
Merged

feat(router): add router plugin reference catalog#33746
yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/litellm-pr-resubmit-e15917

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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/null

Output:

(no output, exit code 0)

Type

New Feature

Changes

Adds router_plugins.json as 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 repository

Each entry carries lightweight, evaluation-focused metadata: name, description, author, repo, commit, version, pypi, litellm_version, entrypoint, license, and tags. version supports update tracking, litellm_version guards compatibility, entrypoint gives a deterministic dotted path to load the plugin, license helps orgs evaluate third-party plugins, and tags enable filtering

Seeded with one entry for Jean's language detector plugin. pypi is null for this entry because the package is not published on PyPI yet; advertising a pip install of an unclaimed name is a namesquatting risk (flagged by Veria), so the entry pins the reviewed repo at an immutable commit as the trustworthy source until a release is published from a trusted account

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@yuneng-berri
yuneng-berri enabled auto-merge (squash) July 17, 2026 18:36
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces router_plugins.json, a root-level machine-readable catalog for LiteLLM routing plugins, seeded with one real entry (a language-detector plugin pinned to a reviewed commit since it is not yet on PyPI).

  • The catalog schema carries lightweight evaluation metadata (name, description, author, repo, commit, version, pypi, litellm_version, entrypoint, license, tags) and the commit-pinning strategy for pre-PyPI plugins is well-motivated.
  • The first array element is a template entry with prose placeholder text in typed fields (pypi holds a descriptive sentence instead of null, repo contains <owner>/<repo>, version and license hold instructions), which will appear as a real plugin to any programmatic consumer iterating the array.

Confidence Score: 3/5

Safe 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.

Important Files Changed

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

Comment thread router_plugins.json
Comment on lines +2 to +14
{
"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"]
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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...").

Comment thread router_plugins.json
Comment on lines +1 to +28
[
{
"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"]
}
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri merged commit f9a217e into litellm_internal_staging Jul 17, 2026
75 of 77 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/litellm-pr-resubmit-e15917 branch July 17, 2026 18:46
@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_/litellm-pr-resubmit-e15917 (366c63d) with litellm_internal_staging (a7d01cb)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (e5a9f3f) during the generation of this report, so a7d01cb was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants