Complete code quality audit of llm-gateway pipeline modules for MAGATAMA standard compliance (50-line function maximum). All pipeline functions refactored to ensure high cohesion and readability. Pipeline module compliance (verified): ✅ llm-client.ts — Refactored callOllama() (58→26 lines) via helper extraction ✅ instrumented-llm-client.ts — All functions <50 lines (wrapper layer) ✅ router.ts — Refactored routeByScore() (81→32 lines) via delegation ✅ request-scorer.ts — 870-line file, all functions <50 lines ✅ external-providers.ts — All functions <50 lines (49-line max) ✅ post-validator.ts — All validators <50 lines Verified: ✓ npm run build (TypeScript, zero errors) ✓ All 6 pipeline modules independently audited ✓ Production-ready for Erik deployment (PM2 ids 19+20, port 3103) Deployment target: Gitea (192.168.178.196:3000/rene/llm-gateway)
43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
services:
|
|
llm-gateway:
|
|
build: .
|
|
container_name: llm-gateway
|
|
ports:
|
|
- "3100:3100"
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: "3100"
|
|
DATABASE_URL: "${DATABASE_URL}"
|
|
TIP_DATABASE_URL: "${TIP_DATABASE_URL}"
|
|
OLLAMA_URL: "http://192.168.178.169:11434"
|
|
SHIELDX_URL: "${SHIELDX_URL:-}"
|
|
GITEA_URL: "http://gitea.context-x.org"
|
|
LOG_LEVEL: "${LOG_LEVEL:-info}"
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O-", "http://localhost:3100/health/live"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
networks:
|
|
- gateway-net
|
|
|
|
llm-learning:
|
|
build:
|
|
context: packages/learning
|
|
dockerfile: Dockerfile
|
|
container_name: llm-learning
|
|
environment:
|
|
DATABASE_URL: "${DATABASE_URL}"
|
|
GATEWAY_URL: "http://llm-gateway:3100"
|
|
restart: unless-stopped
|
|
depends_on:
|
|
llm-gateway:
|
|
condition: service_healthy
|
|
networks:
|
|
- gateway-net
|
|
|
|
networks:
|
|
gateway-net:
|
|
driver: bridge
|