BerriAI/litellm · error · HTTPException
unknown lazy feature: {name}
Error message
unknown lazy feature: {name} What it means
The lazy-warm debug endpoint received a feature name not present in the lazy-feature registry. It is a lookup guard on an authenticated-only endpoint that forces import of a feature module before first real use.
Source
Thrown at litellm/proxy/_lazy_features.py:375
Requires auth — anyone who can hit the proxy can already trigger the same
imports by sending a real request to a feature's prefix, but gating this
debug endpoint avoids unauthenticated callers forcing the import chain."""
from fastapi import APIRouter, Depends, HTTPException
from fastapi.openapi.utils import get_openapi
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
router: Final = APIRouter()
@router.post(
"/lazy/warm/{name}",
include_in_schema=False,
dependencies=[Depends(user_api_key_auth)],
)
async def warm(name: str):
feat: Final = next((f for f in LAZY_FEATURES if f.name == name), None)
if feat is None:
raise HTTPException(404, f"unknown lazy feature: {name}")
if feat.persistent_swagger_stub:
return {"stub_path": None, "paths": {}, "components": {"schemas": {}}}
await _force_load(app, feat)
feat_routes: Final = [r for r in app.routes if feat.matches(getattr(r, "path", ""))]
full: Final = get_openapi(title=app.title, version=app.version, routes=feat_routes)
# Force all operations under one tag so they group under a single Swagger
# section — many lazy modules tag routes inconsistently.
for path_ops in full.get("paths", {}).values():
for op in path_ops.values():
if isinstance(op, dict):
op["tags"] = [feat.name]
return {
"stub_path": feat.path_prefixes[0],
"paths": full.get("paths", {}),
"components": {"schemas": full.get("components", {}).get("schemas", {})},
}View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check the lazy feature name against the supported list in _lazy_features.py.
Example fix
Use a registered feature name.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/_lazy_features.py:375 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/eca930875651a678.
Report an issue: GitHub.