Initial commit: LlamaLink Go rewrite
Complete rewrite from Python/FastAPI to Go/Gin: - Go backend: auth (API keys + bcrypt), llama.cpp subprocess manager, hot-swap multi-model, rate limiting, quota system, webhooks - Vue 3 SPA admin panel (src/) with Tailwind CSS - Deployment: Docker multi-stage, docker-compose, nginx, systemd - GORM/SQLite models: ApiKey, Model, UsageLog, Quota, Webhook - REST API: /api/v1/admin/* (keys, models, chat, usage, health) - Embedded frontend via go:embed (build output at web/dist/) Removed legacy Python artifacts (app/, tests/, pyproject.toml, etc.)
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
services:
|
||||
llamalink:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: deploy/Dockerfile
|
||||
container_name: llamalink-api
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- LLAMALINK_ENV=production
|
||||
- DATABASE_URL=sqlite+aiosqlite:///./data/llamalink.db
|
||||
- MANAGE_LLAMA_SERVER=true
|
||||
- LLAMA_SERVER_HOST=127.0.0.1
|
||||
- LLAMA_SERVER_PORT=8080
|
||||
- LLAMA_SERVER_BIN=/usr/local/bin/llama-server
|
||||
- LLAMA_SERVER_STARTUP_TIMEOUT=120
|
||||
- MODEL_SWAP_COOLDOWN=2
|
||||
- LLAMA_SERVER_STOP_TIMEOUT=10
|
||||
- RATE_LIMIT_PER_MINUTE=60
|
||||
- RATE_LIMIT_STORAGE=memory
|
||||
- LOG_LEVEL=info
|
||||
- LOG_FORMAT=json
|
||||
- ADMIN_TOKEN=${ADMIN_TOKEN}
|
||||
volumes:
|
||||
- llamalink-data:/app/data
|
||||
- ./models:/models:ro
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- llamalink-net
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
llama-runner:
|
||||
image: ghcr.io/ggml-org/llama.cpp:server
|
||||
container_name: llama-runner
|
||||
environment:
|
||||
- CUDA_VISIBLE_DEVICES=0
|
||||
volumes:
|
||||
- ./models:/models:ro
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- llamalink-net
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
|
||||
nginx:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: llamalink-nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./deploy/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
depends_on:
|
||||
- llamalink
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- llamalink-net
|
||||
|
||||
volumes:
|
||||
llamalink-data:
|
||||
|
||||
networks:
|
||||
llamalink-net:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user