46 lines
1.7 KiB
XML
46 lines
1.7 KiB
XML
<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>
|