Initial commit

This commit is contained in:
alook
2026-08-18 10:03:35 +08:00
commit 8e4424b82a
11 changed files with 1524 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
model_list:
- model_name: gemini-flash-latest
litellm_params:
model: vertex_ai/gemini-flash-latest
api_key: os.environ/GEMINI_API_KEY
- model_name: gemini-flash-lite-latest
litellm_params:
model: vertex_ai/gemini-flash-lite-latest
api_key: os.environ/GEMINI_API_KEY
- model_name: gemini-pro-latest
litellm_params:
model: vertex_ai/gemini-pro-latest
api_key: os.environ/GEMINI_API_KEY
- model_name: chatgpt-pro
litellm_params:
model: openai/chatgpt-pro
api_base: http://cli-proxy-api:8317/v1
api_key: os.environ/CLIPROXY_API_KEY
# # 供 Open WebUI 的图片生成功能调用。不要把这些模型当普通聊天模型直接在对话里选择,
# # 否则走 /chat/completions 流式返回大块 base64 时,前端可能报 Chunk too big。
# - model_name: gemini-3-pro-image-preview
# litellm_params:
# model: gemini/gemini-3-pro-image-preview
# api_key: os.environ/GEMINI_API_KEY
litellm_settings:
drop_params: true
router_settings:
num_retries: 3
timeout: 60
fallbacks:
- {
'gemini-flash-lite-latest':
['gemini-flash-latest', 'gemini-pro-latest'],
}
- { 'gemini-flash-latest': ['gemini-pro-latest'] }
#
# - model_name: gemini-flash-enterprise
# litellm_params:
# model: vertex_ai/gemini-2.5-flash
# vertex_project: 'gen-lang-client-0934968879'
# vertex_location: 'asia-southeast1'
# # vertex_credentials: '/app/litellm/gen-lang-client-0934968879-03bf3a88d4dd.json' # 容器内路径
# - model_name: gemini-pro-enterprise
# litellm_params:
# model: vertex_ai/gemini-2.5-pro
# vertex_project: 'gen-lang-client-0934968879'
# vertex_location: 'asia-southeast1'
# vertex_credentials: '/app/litellm/gen-lang-client-0934968879-03bf3a88d4dd.json' # 容器内路径
+45
View File
@@ -0,0 +1,45 @@
<service>
<id>ai-stack-litellm</id>
<name>AI Stack - LiteLLM</name>
<description>LiteLLM proxy for Gemini models, provides OpenAI-compatible API on port 4000</description>
<!--
使用 WinSW 的 %BASE% 相对路径。
%BASE% = WinSW.exe 所在目录(本文件所在目录:...\litellm)。
现在使用专属 venv..\litellm\venv,支持任意盘符部署。
-->
<executable>%BASE%\venv\Scripts\litellm.exe</executable>
<arguments>--config %BASE%\config.yaml --port 4000</arguments>
<workingdirectory>%BASE%\..</workingdirectory>
<!-- Gemini API Key 从 Windows 系统环境变量读取;install.ps1/update.ps1 会从 .env 同步 -->
<env name="GEMINI_API_KEY" value="%GEMINI_API_KEY%"/>
<!--
如果访问 Gemini 需要代理,取消注释并修改代理地址
-->
<!-- <env name="HTTP_PROXY" value="http://127.0.0.1:7890"/> -->
<!-- <env name="HTTPS_PROXY" value="http://127.0.0.1:7890"/> -->
<!-- <env name="ALL_PROXY" value="http://127.0.0.1:7890"/> -->
<!-- 日志,滚动模式防止无限增长 -->
<logpath>%BASE%\..\logs\litellm</logpath>
<log mode="roll">
<sizeThreshold>10240</sizeThreshold>
<keepFiles>5</keepFiles>
</log>
<!-- 开机自动启动,延迟启动避免网络未就绪 -->
<startmode>Automatic</startmode>
<delayedAutoStart>true</delayedAutoStart>
<!-- 失败自动重启,10 秒后重试,连续失败也持续重启 -->
<onfailure action="restart" delay="10 sec"/>
<resetfailure>1 hour</resetfailure>
<!-- 停止等待时间 -->
<stoptimeout>15 sec</stoptimeout>
<!-- 不显示控制台窗口 -->
<hidewindow>true</hidewindow>
</service>