Production AI infrastructure for low-resource environments.
Run a full AI platform — APIs, workers, queues, vector search, and observability — on hardware with limited RAM and no cloud dependency.
| Target environment | Cost | Use case |
|---|---|---|
| 3–4 GiB RAM, consumer CPU, Linux | $0/month after hardware | prototyping, edge deployment, budget-constrained production, learning AI ops |
| Component | Purpose |
|---|---|
| FastAPI backend | AI service APIs with health checks and /metrics |
| Celery + Redis | Async task queue for pipelines and agents |
| PostgreSQL + pgvector | Structured data and semantic search |
| Prometheus + node-exporter | Metrics and resource monitoring |
| Health checks | Service-level monitoring with restart policies |
| Memory shield | Pre-flight RAM check before startup |
| Compose profile | One-command startup with explicit resource limits |
- No monthly API/GPU/infrastructure spend.
- No vendor data-policy risk: data stays on host.
- Constraints force simpler, auditable architecture.
- Fully offline operation; no outbound model inference is required by the stack itself.
- Portability: identical configuration across dev/staging/prod on the same machine.
- Docker Compose v2+
- 3.5+ GiB RAM
- Linux host; tested on CachyOS/Arch
- 10+ GiB disk
git clone https://github.com/cjps4linux-creator/constrained-ai-stack.git
cd constrained-ai-stack
cp .env.example .env
docker compose up -dVerify the installation:
curl http://localhost:8000/health
curl http://localhost:9090/metrics| Service | RAM Target | Notes |
|---|---|---|
| postgres | 512 MiB | Shared buffers tuned for 4GB host |
| redis | 128 MiB | Maxmemory policy set |
| api | 384 MiB | Uvicorn workers = 1 |
| worker | 512 MiB | Concurrency = 2 |
| prometheus | 256 MiB | Retention = 7 days |
| node-exporter | 64 MiB | Minimal scrape config |
Total target: ~1.8 GiB baseline, leaving headroom for batch workloads and OS overhead.
docker-compose.yml— all services with health checks and memory limits.env.example— config templatemonitoring/prometheus.yml— scrape configsscripts/memory-shield.sh— pre-flight RAM checkdocs/constraints.md— design decisions and failure modesdocs/troubleshooting.md— common issues on constrained hosts
Source is MIT-licensed and free to self-host. For commercial support, consulting, or purchase bundles, contact conradcjwilson0@gmail.com.
docker compose config --servicesvalidates:postgres,redis,api,worker,prometheus,node-exporter- Runtime verification remains environment-dependent;
scripts/verify-install.shchecks compose validity and Docker availability
MIT — use, modify, and ship freely. Author: Conrad CJ Wilson GitHub: https://github.com/cjps4linux-creator LinkedIn: https://www.linkedin.com/in/conradcjwilson