The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: log fallback warning in blog posts endpoint and tighten test
yuneng-jiang4b1ce1ff54ac
diff --git a/litellm/proxy/public_endpoints/public_endpoints.py b/litellm/proxy/public_endpoints/public_endpoints.pyindex f5bca531839..b2fb3dd0f8a 100644--- a/litellm/proxy/public_endpoints/public_endpoints.py+++ b/litellm/proxy/public_endpoints/public_endpoints.py@@ -4,6 +4,7 @@ from typing import Listfrom fastapi import APIRouter, Depends, HTTPException+from litellm._logging import verbose_loggerfrom litellm.litellm_core_utils.get_blog_posts import (BlogPost,BlogPostsResponse,@@ -213,7 +214,10 @@ async def get_litellm_blog_posts():"""try:posts_data = get_blog_posts()- except Exception:+ except Exception as e:+ verbose_logger.warning(+ "LiteLLM: get_litellm_blog_posts endpoint fallback triggered: %s", str(e)+ )posts_data = GetBlogPosts.load_local_blog_posts()posts = [BlogPost(**p) for p in posts_data[:5]]diff --git a/tests/proxy_unit_tests/test_blog_posts_endpoint.py b/tests/proxy_unit_tests/test_blog_posts_endpoint.pyindex 1c5db4d2cfe..0f93f6f80cf 100644--- a/tests/proxy_unit_tests/test_blog_posts_endpoint.py+++ b/tests/proxy_unit_tests/test_blog_posts_endpoint.py@@ -77,3 +77,4 @@ def test_get_blog_posts_returns_local_backup_on_failure(client):# Should not 500 — returns local backupassert response.status_code == 200assert "posts" in response.json()+ assert len(response.json()["posts"]) > 0