mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
[Feat] LiteLLM Tag/Policy Management (#9813)
* rendering tags on UI * use /models for building tags * CRUD endpoints for Tag management * fix tag management * working api for LIST tags * working tag management * refactor UI components * fixes ui tag management * clean up ui tag management * fix tag management ui * fix show allowed llms * e2e tag controls * stash change for rendering tags on UI * ui working tag selector on Test Key page * fixes for tag management * clean up tag info * fix code quality * test for tag management * ui clarify what tag routing is
This commit is contained in:
parent
03148020af
commit
0a59a8c659
16 changed files with 1595 additions and 9 deletions
|
@ -237,6 +237,9 @@ from litellm.proxy.management_endpoints.model_management_endpoints import (
|
|||
from litellm.proxy.management_endpoints.organization_endpoints import (
|
||||
router as organization_router,
|
||||
)
|
||||
from litellm.proxy.management_endpoints.tag_management_endpoints import (
|
||||
router as tag_management_router,
|
||||
)
|
||||
from litellm.proxy.management_endpoints.team_callback_endpoints import (
|
||||
router as team_callback_router,
|
||||
)
|
||||
|
@ -347,13 +350,13 @@ from fastapi import (
|
|||
Request,
|
||||
Response,
|
||||
UploadFile,
|
||||
applications,
|
||||
status,
|
||||
applications
|
||||
)
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.openapi.utils import get_openapi
|
||||
from fastapi.openapi.docs import get_swagger_ui_html
|
||||
from fastapi.openapi.utils import get_openapi
|
||||
from fastapi.responses import (
|
||||
FileResponse,
|
||||
JSONResponse,
|
||||
|
@ -735,7 +738,7 @@ try:
|
|||
|
||||
except Exception:
|
||||
pass
|
||||
# current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
# ui_path = os.path.join(current_dir, "_experimental", "out")
|
||||
# # Mount this test directory instead
|
||||
# app.mount("/ui", StaticFiles(directory=ui_path, html=True), name="ui")
|
||||
|
@ -753,14 +756,18 @@ app.add_middleware(PrometheusAuthMiddleware)
|
|||
|
||||
swagger_path = os.path.join(current_dir, "swagger")
|
||||
app.mount("/swagger", StaticFiles(directory=swagger_path), name="swagger")
|
||||
|
||||
|
||||
def swagger_monkey_patch(*args, **kwargs):
|
||||
return get_swagger_ui_html(
|
||||
*args,
|
||||
**kwargs,
|
||||
swagger_js_url="/swagger/swagger-ui-bundle.js",
|
||||
swagger_css_url="/swagger/swagger-ui.css",
|
||||
swagger_favicon_url="/swagger/favicon.png"
|
||||
swagger_favicon_url="/swagger/favicon.png",
|
||||
)
|
||||
|
||||
|
||||
applications.get_swagger_ui_html = swagger_monkey_patch
|
||||
|
||||
from typing import Dict
|
||||
|
@ -8174,3 +8181,4 @@ app.include_router(openai_files_router)
|
|||
app.include_router(team_callback_router)
|
||||
app.include_router(budget_management_router)
|
||||
app.include_router(model_management_router)
|
||||
app.include_router(tag_management_router)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue