route LiteLLM through shared Caddy network
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# Hong Kong CMI LiteLLM Vertex AI Relay
|
||||
|
||||
- 仅通过 Hong Kong CMI 节点的 Tailscale IPv4 地址监听;`LISTEN_IP` 不要填写公网地址或 `0.0.0.0`。
|
||||
- ADC、LiteLLM key 仅存放于 Arcane `.env`,不得提交 Git。
|
||||
- 默认监听端口为 `1049`;需要修改时设置 `LITELLM_PORT`。
|
||||
- 公网 OpenAI-compatible 入口为 `https://api.opfo.xyz/v1`,由 Caddy 终止 TLS 后通过外部 Docker 网络 `hk-web` 反向代理到 `litellm-api:1049`。
|
||||
- LiteLLM 不使用 host network,也不向宿主机发布端口;容器内监听 `0.0.0.0:1049` 仅供 `hk-web` 上的 Caddy 访问。
|
||||
- 默认监听端口为 `1049`;需要修改时必须同时更新 Arcane 的 `LITELLM_PORT` 和 Caddy 的上游端口。
|
||||
- 客户端使用 `Authorization: Bearer <LITELLM_MASTER_KEY>`;认证由 LiteLLM 执行,Caddy 仅负责 TLS 和反向代理并保留该请求头。
|
||||
- ADC 与 `LITELLM_MASTER_KEY` 仅存放于 Arcane `.env`,不得写入 Git、文档或日志。
|
||||
- 对外模型别名包括 `gemini-3.6-flash`、`gemini-3.5-flash-lite`、
|
||||
`google/gemini-embedding-2` 和 `google/gemini-3.8-flash`;后两者仍通过
|
||||
Vertex AI ADC 路由。
|
||||
|
||||
@@ -19,7 +19,10 @@ services:
|
||||
depends_on:
|
||||
adc-init:
|
||||
condition: service_completed_successfully
|
||||
network_mode: host
|
||||
networks:
|
||||
hk-web:
|
||||
aliases:
|
||||
- litellm-api
|
||||
environment:
|
||||
GOOGLE_APPLICATION_CREDENTIALS: /credentials/application_default_credentials.json
|
||||
VERTEXAI_PROJECT: ${VERTEXAI_PROJECT}
|
||||
@@ -28,7 +31,7 @@ services:
|
||||
volumes:
|
||||
- ./config.yaml:/app/config.yaml:ro
|
||||
- google-adc:/credentials:ro
|
||||
command: ["--config", "/app/config.yaml", "--host", "${LISTEN_IP:-127.0.0.1}", "--port", "${LITELLM_PORT:-1049}"]
|
||||
command: ["--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "${LITELLM_PORT:-1049}"]
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
@@ -37,3 +40,8 @@ services:
|
||||
|
||||
volumes:
|
||||
google-adc:
|
||||
|
||||
networks:
|
||||
hk-web:
|
||||
external: true
|
||||
name: hk-web
|
||||
|
||||
Reference in New Issue
Block a user