litellm proxy ui 的处理

litellm proxy ui 关于static 的处理是基于了fastapi 的StaticFiles,使用了绝对路径配置的,以下是一个简单说明

参考代码

litellm/proxy/proxy_server.py

current_dir = os.path.dirname(os.path.abspath(__file__))
ui_path = os.path.join(current_dir, "_experimental", "out")
app.mount("/ui", StaticFiles(directory=ui_path, html=True), name="ui")

说明

litellm proxy ui 部分实现是基于了StaticFiles 但是路径上使用了基于项目的绝对路径,灵活性上不是很好,毕竟代码直接耦合到包中了,扩展上不是很方便

参考资料

https://www.starlette.io/staticfiles/
https://fastapi.tiangolo.com/tutorial/static-files/

posted on   荣锋亮  阅读(37)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2021-09-09 nginx rewrite查询字符串重写问题
2021-09-09 PostgreSQL 12 Improvement: Benign Log Entries “Incomplete Startup Packet”
2019-09-09 Falcor 学习一基本使用
2019-09-09 nodegui 使用react开发跨平台应用试用
2018-09-09 watchtower 自动更新容器的工具

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示