智能代理服务器,用于管理和优化本地部署的 Ollama 服务。专为个人用户设计,实现节能与服务可用性的完美平衡。
docker run -d \
-p 11434:11434 \
-e OLLAMA_URL=http://localhost:11434 \
-e WAKE_URL=http://localhost:11434/api/generate \
-e TIMEOUT_SECONDS=10 \
-e PORT=11434 \
yshtcn/ollama-proxy:latest
使用 Docker Compose
version: '3'
services:
ollama-proxy:
image: yshtcn/ollama-proxy:latest
container_name: ollama-proxy
ports:
- "11434:11434"
environment:
- OLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}
- WAKE_URL=${WAKE_URL:-http://localhost:11434/api/generate}
- TIMEOUT_SECONDS=${TIMEOUT_SECONDS:-10}
- PORT=${PORT:-11434}
- WAKE_INTERVAL=${WAKE_INTERVAL:-10}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/health"]
interval: 30s
timeout: 10s
retries: 3
| 变量 | 说明 | 默认值 |
|---|---|---|
| OLLAMA_URL | Ollama服务器URL | http://localhost:11434 |
| WAKE_URL | 唤醒服务器URL | http://localhost:11434/api/generate |
| TIMEOUT_SECONDS | 简单请求超时时间(秒) | 10 |
| PORT | 代理服务器端口 | 11434 |
| WAKE_INTERVAL | 唤醒间隔时间(分钟) | 10 |
完整源代码和文档请访问:GitHub - yshtcn/OllamaProxy
Content type
Image
Digest
sha256:8934ebbcc…
Size
48.9 MB
Last updated
over 1 year ago
docker pull yshtcn/ollama-proxy