BerriAI/litellm · error · HTTPException
Internal Server Error ({e})
Error message
Internal Server Error ({e}) What it means
Catch-all around litellm.model_cost access on the public model cost map endpoint: reading the model cost map raised unexpectedly (import or initialization problem inside litellm). The original exception is embedded and surfaced as a 500.
Source
Thrown at litellm/proxy/public_endpoints/public_endpoints.py:416
return provider_create_fields
@router.get(
"/public/litellm_model_cost_map",
tags=["public", "model management"],
)
async def get_litellm_model_cost_map():
"""
Public endpoint to get the LiteLLM model cost map.
Returns pricing information for all supported models.
"""
import litellm
try:
_model_cost_map: Final = litellm.model_cost
return _model_cost_map
except Exception as e:
raise HTTPException(
status_code=500,
detail=f"Internal Server Error ({e})",
)
@router.get(
"/public/litellm_blog_posts",
tags=["public"],
response_model=BlogPostsResponse,
)
async def get_litellm_blog_posts():
"""
Public endpoint to get the latest LiteLLM blog posts.
Fetches from GitHub with a 1-hour in-process cache.
Falls back to the bundled local backup on any failure.
"""
try:View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check proxy logs for the exception detail; fix the failing configuration or request and retry.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/public_endpoints/public_endpoints.py:416 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/2e983b9323782696.
Report an issue: GitHub.