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
Revert "[Feature] Add /public/supported_endpoints endpoint"
yuneng-jiang71c3503e57c2
diff --git a/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md b/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.mdindex b6665a76773..ab2cf334459 100644--- a/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md+++ b/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md@@ -404,7 +404,7 @@ This release has a known issue...- **New Providers** - Provider name, supported endpoints, description- **New LLM API Endpoints** (optional) - Endpoint, method, description, documentation link- Only include major new provider integrations, not minor provider updates-- **IMPORTANT**: When adding new providers, also update `provider_endpoints_support.json` (see Section 13)+- **IMPORTANT**: When adding new providers, also update `provider_endpoints_support.json` in the repository root (see Section 13)### 12. Section Header Counts@@ -442,7 +442,7 @@ This release has a known issue...### 13. Update provider_endpoints_support.json-**When adding new providers or endpoints, you MUST also update `litellm/proxy/public_endpoints/provider_endpoints_support.json`.**+**When adding new providers or endpoints, you MUST also update `provider_endpoints_support.json` in the repository root.**This file tracks which endpoints are supported by each LiteLLM provider and is used to generate documentation.diff --git a/litellm/proxy/public_endpoints/public_endpoints.py b/litellm/proxy/public_endpoints/public_endpoints.pyindex 54fc753e768..29c9cb571ca 100644--- a/litellm/proxy/public_endpoints/public_endpoints.py+++ b/litellm/proxy/public_endpoints/public_endpoints.py@@ -1,6 +1,5 @@import jsonimport os-import refrom typing import Listimport litellm@@ -24,16 +23,11 @@ from litellm.types.proxy.public_endpoints.public_endpoints import (AgentCreateInfo,ProviderCreateInfo,PublicModelHubInfo,- SupportedEndpointInfo,- SupportedEndpointsResponse,- SupportedProviderInfo,)from litellm.types.utils import LlmProvidersrouter = APIRouter()-_supported_endpoints_cache: SupportedEndpointsResponse | None = None-@router.get("/public/model_hub",@@ -231,68 +225,6 @@ async def get_litellm_blog_posts():return BlogPostsResponse(posts=posts)- "/public/supported_endpoints",- tags=["public", "providers"],- response_model=SupportedEndpointsResponse,-)-async def get_provider_supported_endpoints() -> SupportedEndpointsResponse:- """- Return all supported endpoints and which providers support them.-- Reads from provider_endpoints_support.json at the repo root.- Result is cached for the lifetime of the process.- """- global _supported_endpoints_cache- if _supported_endpoints_cache is not None:- return _supported_endpoints_cache-- provider_endpoints_support_path = os.path.join(- os.path.dirname(os.path.dirname(os.path.dirname(__file__))),- "proxy",- "public_endpoints",- "provider_endpoints_support.json",- )-- with open(provider_endpoints_support_path, "r") as f:- data = json.load(f)-- schema_endpoints = data["_schema"]["provider_slug"]["endpoints"]-- endpoints = []- for key, description in schema_endpoints.items():- path_match = re.search(r"(/[\w/{}.()*-]+)", description)- endpoint_path = path_match.group(1) if path_match else f"/{key}"- display_name = key.replace("_", " ").title()- endpoints.append(- SupportedEndpointInfo(- key=key,- display_name=display_name,- endpoint=endpoint_path,- )- )-- providers = []- for slug, provider_data in data["providers"].items():- supported = [- endpoint_key- for endpoint_key, supported in provider_data["endpoints"].items()- if supported- ]- providers.append(- SupportedProviderInfo(- slug=slug,- display_name=provider_data["display_name"],- supported=supported,- )- )-- _supported_endpoints_cache = SupportedEndpointsResponse(- endpoints=endpoints, providers=providers- )- return _supported_endpoints_cache--@router.get("/public/agents/fields",tags=["public", "[beta] Agents"],diff --git a/litellm/types/proxy/public_endpoints/public_endpoints.py b/litellm/types/proxy/public_endpoints/public_endpoints.pyindex a167eeec6a2..57d68771c7f 100644--- a/litellm/types/proxy/public_endpoints/public_endpoints.py+++ b/litellm/types/proxy/public_endpoints/public_endpoints.py@@ -52,20 +52,3 @@ class AgentCreateInfo(BaseModel):credential_fields: List[AgentCredentialField]litellm_params_template: Optional[Dict[str, str]] = Nonemodel_template: Optional[str] = None---class SupportedEndpointInfo(BaseModel):- key: str- display_name: str- endpoint: str---class SupportedProviderInfo(BaseModel):- slug: str- display_name: str- supported: List[str]---class SupportedEndpointsResponse(BaseModel):- endpoints: List[SupportedEndpointInfo]- providers: List[SupportedProviderInfo]diff --git a/litellm/proxy/public_endpoints/provider_endpoints_support.json b/provider_endpoints_support.jsonsimilarity index 100%rename from litellm/proxy/public_endpoints/provider_endpoints_support.jsonrename to provider_endpoints_support.jsondiff --git a/tests/code_coverage_tests/check_endpoint_coverage.py b/tests/code_coverage_tests/check_endpoint_coverage.pyindex 25f181aa3a5..2d46d1ab469 100644--- a/tests/code_coverage_tests/check_endpoint_coverage.py+++ b/tests/code_coverage_tests/check_endpoint_coverage.py@@ -99,7 +99,7 @@ def extract_endpoints_from_sidebars() -> Dict[str, str]:def load_provider_endpoints_file() -> Dict:"""Load the provider_endpoints_support.json file."""repo_root = get_repo_root()- file_path = repo_root / "litellm" / "proxy" / "public_endpoints" / "provider_endpoints_support.json"+ file_path = repo_root / "provider_endpoints_support.json"if not file_path.exists():print(diff --git a/tests/code_coverage_tests/check_provider_folders_documented.py b/tests/code_coverage_tests/check_provider_folders_documented.pyindex d5f7c7f7a07..60afc55331f 100644--- a/tests/code_coverage_tests/check_provider_folders_documented.py+++ b/tests/code_coverage_tests/check_provider_folders_documented.py@@ -65,7 +65,7 @@ def get_llm_provider_folders() -> Set[str]:def load_provider_endpoints_file() -> Dict:"""Load the provider_endpoints_support.json file."""repo_root = get_repo_root()- file_path = repo_root / "litellm" / "proxy" / "public_endpoints" / "provider_endpoints_support.json"+ file_path = repo_root / "provider_endpoints_support.json"if not file_path.exists():print(diff --git a/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py b/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.pyindex 0b21bc2636c..5f5e2cf1ff8 100644--- a/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py+++ b/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py@@ -87,54 +87,6 @@ def test_get_litellm_model_cost_map_returns_cost_map():assert "input_cost_per_token" in sample_model_data or "output_cost_per_token" in sample_model_data-def test_get_provider_supported_endpoints():- """Test /public/supported_endpoints returns correct structure with endpoints and providers."""- app = FastAPI()- app.include_router(router)- client = TestClient(app)-- response = client.get("/public/supported_endpoints")-- assert response.status_code == 200- data = response.json()-- # Check top-level structure- assert "endpoints" in data- assert "providers" in data- assert isinstance(data["endpoints"], list)- assert isinstance(data["providers"], list)-- # Verify endpoints structure- assert len(data["endpoints"]) > 0- for endpoint in data["endpoints"]:- assert "key" in endpoint- assert "display_name" in endpoint- assert "endpoint" in endpoint- assert isinstance(endpoint["key"], str)- assert isinstance(endpoint["display_name"], str)- assert endpoint["endpoint"].startswith("/")-- # Verify providers structure- assert len(data["providers"]) > 0- for provider in data["providers"]:- assert "slug" in provider- assert "display_name" in provider- assert "supported" in provider- assert isinstance(provider["slug"], str)- assert isinstance(provider["display_name"], str)- assert isinstance(provider["supported"], list)-- # Verify some expected endpoints exist- endpoint_keys = {e["key"] for e in data["endpoints"]}- assert "chat_completions" in endpoint_keys- assert "embeddings" in endpoint_keys- assert "responses" in endpoint_keys-- # Verify some expected providers exist- provider_slugs = {p["slug"] for p in data["providers"]}- assert "openai" in provider_slugs--def test_watsonx_provider_fields():"""Test that Watsonx provider has all required credential fields including multiple auth options."""app = FastAPI()