Full-stack AI chat application with GitOps deployment to Kubernetes
Try it out: mini-llm.navillasa.dev
An LLM chat application with GitHub OAuth, automated deployment with ArgoCD, and custom-compiled llama.cpp for running on legacy hardware (aka my homelab's Pentium J5005 processor).
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β GitHub ββββββΆβ ArgoCD ββββββΆβ MicroK8s β
β (Source) β β (GitOps) β β Homelab β
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β
ββββββββββββββββββββββββββΌββββββββββββββββββ
β β β
ββββββββΌβββββββ βββββββββΌβββββββ βββββββΌβββββββ
β Frontend β β Backend β β Vault β
β (React) βββββββββΆβ (FastAPI) βββββ (Secrets) β
β nginx:8080 β β GPT4All β ββββββββββββββ
βββββββββββββββ ββββββββββββββββ
Browse monitoring: mini-llm-monitoring.navillasa.dev
Prometheus metrics available at /metrics:
llm_requests_total- API request countsllm_request_duration_seconds- Request latencyllm_inference_duration_seconds- Model inference timellm_tokens_generated_total- Total tokens generatedllm_model_loaded- Model statusllm_cpu_usage_percent- CPU utilizationllm_memory_usage_bytes- Memory usagellm_auth_requests_total- OAuth attemptsllm_rate_limit_hits_total- Rate limit violations
| Component | Technology | Purpose |
|---|---|---|
| Orchestration | Kubernetes (MicroK8s) | Container orchestration on homelab |
| GitOps | ArgoCD | Automated deployment from Git |
| Manifests | Kustomize | Environment-specific configurations |
| CI/CD | GitHub Actions | Automated testing and image builds |
| Container Registry | GitHub Container Registry (ghcr.io) | Docker image storage |
| Secrets | HashiCorp Vault + External Secrets Operator | Secure secret management |
| Frontend | React + Vite | Modern SPA with TypeScript |
| Backend | FastAPI + Uvicorn | High-performance async API |
| AI Model | GPT4All (Llama 3 8B) | Local LLM inference |
| Auth | GitHub OAuth 2.0 + JWT | User authentication |
| Monitoring | Prometheus | Metrics collection |
.
βββ backend/ # FastAPI backend
β βββ main.py # API endpoints and LLM integration
β βββ auth.py # GitHub OAuth + JWT auth
β βββ rate_limiter.py # Request rate limiting
β βββ Dockerfile # Backend container image
βββ frontend/ # React frontend
β βββ src/ # React components
β βββ nginx.conf # nginx configuration (port 8080)
β βββ Dockerfile # Frontend container image
βββ k8s/ # Kubernetes manifests
β βββ base/ # Base resources (deployments, services, secrets)
β βββ overlays/dev/ # Dev environment overlay
β βββ argocd/ # ArgoCD Application definitions
βββ .github/workflows/ # CI/CD pipelines
βββ ci.yml # Build, test, and publish images
- Kubernetes cluster (tested on MicroK8s)
- ArgoCD installed
- Vault + External Secrets Operator configured
- GitHub OAuth app credentials
vault kv put secret/mini-llm/backend \
github_client_id='your-client-id' \
github_client_secret='your-client-secret' \
jwt_secret="$(openssl rand -base64 32)" \
frontend_url='https://your-frontend-url'# Apply the ArgoCD Application
kubectl apply -f k8s/argocd/mini-llm-app-dev.yaml
# Watch deployment
kubectl get application -n argocd mini-llm-dev
kubectl get pods -n mini-llm-dev -w# Apply manifests directly
kubectl apply -k k8s/overlays/dev
# Check status
kubectl get all -n mini-llm-devWhen you push to main:
- Run Tests: Backend unit tests + frontend build tests
- Build Images: Docker images tagged with git commit SHA
- Push to Registry: Images pushed to ghcr.io
- Update Kustomization: Image tags automatically updated in git
- ArgoCD Sync: Detects changes and deploys new version
- Non-root containers: Both frontend and backend run as user 1000
- Secret management: Vault integration, no secrets in git
- OAuth authentication: GitHub social login
- JWT tokens: Stateless authentication
- Rate limiting: Prevents abuse
- HTTPS: TLS termination at ingress
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Copy and configure .env
cp .env.example .env
# Run backend
uvicorn main:app --reloadcd frontend
npm install
# Copy and configure .env
cp .env.example .env
# Run dev server
npm run dev# Check pod status
kubectl get pods -n mini-llm-dev
# View logs
kubectl logs -n mini-llm-dev deployment/backend
kubectl logs -n mini-llm-dev deployment/frontend
# Check events
kubectl describe pod -n mini-llm-dev <pod-name># Check application status
kubectl get application -n argocd mini-llm-dev -o yaml
# Force sync
argocd app sync mini-llm-dev# Check ExternalSecret
kubectl get externalsecret -n mini-llm-dev
kubectl describe externalsecret backend-secrets -n mini-llm-dev
# Verify Vault connection
kubectl get clustersecretstore vault-backend- Homelab Infrastructure: MicroK8s homelab with Vault, ArgoCD, monitoring
- TV Dashboard K8s: Full-stack app with multi-cloud deployment
- Multi-cloud LLM Router: Enterprise LLM routing and cost optimization

