feat(pass_through_endpoints.py): initial commit of crud endpoints for pass through endpoints

This commit is contained in:
Krrish Dholakia 2024-08-14 21:36:07 -07:00
parent a020563149
commit 28faafadb1
2 changed files with 44 additions and 0 deletions

View file

@ -23,6 +23,8 @@ from litellm.integrations.custom_logger import CustomLogger
from litellm.proxy._types import ProxyException, UserAPIKeyAuth from litellm.proxy._types import ProxyException, UserAPIKeyAuth
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
router = APIRouter()
async def set_env_variables_in_header(custom_headers: dict): async def set_env_variables_in_header(custom_headers: dict):
""" """
@ -476,3 +478,41 @@ async def initialize_pass_through_endpoints(pass_through_endpoints: list):
) )
verbose_proxy_logger.debug("Added new pass through endpoint: %s", _path) verbose_proxy_logger.debug("Added new pass through endpoint: %s", _path)
@router.get(
"/config/pass_through_endpoint/{endpoint_id}",
tags=["Internal User management"],
dependencies=[Depends(user_api_key_auth)],
)
async def get_pass_through_endpoints(request: Request, endpoint_id: str):
"""
GET configured pass through endpoint.
If no endpoint_id given, return all configured endpoints.
"""
pass
@router.post(
"/config/pass_through_endpoint",
tags=["Internal User management"],
dependencies=[Depends(user_api_key_auth)],
)
async def create_pass_through_endpoints(request: Request):
"""
Create new pass-through endpoint
"""
pass
@router.delete(
"/config/pass_through_endpoint",
tags=["Internal User management"],
dependencies=[Depends(user_api_key_auth)],
)
async def delete_pass_through_endpoints(request: Request):
"""
Create new pass-through endpoint
"""
pass

View file

@ -194,6 +194,9 @@ from litellm.proxy.openai_files_endpoints.files_endpoints import set_files_confi
from litellm.proxy.pass_through_endpoints.pass_through_endpoints import ( from litellm.proxy.pass_through_endpoints.pass_through_endpoints import (
initialize_pass_through_endpoints, initialize_pass_through_endpoints,
) )
from litellm.proxy.pass_through_endpoints.pass_through_endpoints import (
router as pass_through_router,
)
from litellm.proxy.secret_managers.aws_secret_manager import ( from litellm.proxy.secret_managers.aws_secret_manager import (
load_aws_kms, load_aws_kms,
load_aws_secret_manager, load_aws_secret_manager,
@ -9895,6 +9898,7 @@ def cleanup_router_config_variables():
app.include_router(router) app.include_router(router)
app.include_router(fine_tuning_router) app.include_router(fine_tuning_router)
app.include_router(vertex_router) app.include_router(vertex_router)
app.include_router(pass_through_router)
app.include_router(health_router) app.include_router(health_router)
app.include_router(key_management_router) app.include_router(key_management_router)
app.include_router(internal_user_router) app.include_router(internal_user_router)