b7df3108fa
README: Added hierarchical routing, classifier bucket mapping, two-level dispatch, model groups table, DeepSeek language note, deploy script, and updated model names to match current models.dev registry. TODO: Added 15 completed items covering model groups, routing, dispatch, and provider fixes from May 7 session. deployment.md: Added deploy.sh instructions.
1.6 KiB
1.6 KiB
Deployment Guide (Go)
This guide covers deploying the Go-based GopherGate.
Environment Setup
-
Mandatory Configuration: Create a
.envfile from the example:cp .env.example .envEnsure
LLM_PROXY__ENCRYPTION_KEYis set to a secure 32-byte string. -
Data Directory: The proxy stores its database in
./data/llm_proxy.dbby default. Ensure this directory exists and is writable.
Binary Deployment
1. Build
go build -o gophergate ./cmd/gophergate
2. Run
./gophergate
Quick Deploy Script
A deploy.sh script is provided for production restarts:
./deploy.sh
This script will:
- Stop any running gophergate process
- Pull latest changes from git
- Build the application
- Start it in the background (logs to
gophergate.log)
If the build fails, the previous binary is left untouched and the script exits.
Docker Deployment
The project includes a multi-stage Dockerfile for minimal image size.
1. Build Image
docker build -t gophergate .
2. Run Container
docker run -d \
--name gophergate \
-p 8080:8080 \
-v $(pwd)/data:/app/data \
--env-file .env \
gophergate
Production Considerations
- SSL/TLS: It is recommended to run the proxy behind a reverse proxy like Nginx or Caddy for SSL termination.
- Backups: Regularly backup the
data/llm_proxy.dbfile. - Monitoring: Monitor the
/healthendpoint for system status. - Logs: When started with
deploy.shornohup, logs are written togophergate.log.