DEV Community

Cover image for 100% Local AI Meets Self-Hosting: From GitHub Repo to Production Container Stack Without Cloud APIs
Henk van Hoek
Henk van Hoek

Posted on

100% Local AI Meets Self-Hosting: From GitHub Repo to Production Container Stack Without Cloud APIs

Self-hosting is all about data sovereignty, privacy, and full control over your digital infrastructure. Yet, onboarding newly discovered open-source tools from GitHub into a home server or edge cluster is often
a tedious ritual: digging through Dockerfiles, resolving port conflicts, debugging volume permissions (user: 0:0), and wrestling with engine quirks between Docker and Rootless Podman.

While modern cloud LLMs (OpenAI, Anthropic) can assist with DevOps tasks, using them creates a fundamental paradox: **sending your internal server topologies, private network IP ranges, and system
Enter fullscreen mode Exit fullscreen mode

configurations to commercial cloud APIs directly undermines data sovereignty.**

To solve this, we integrated local open-weight Large Language Models (running via **Ollama** on consumer hardware) into **NjordDeploy** — an open-source, agentless self-hosting orchestrator.

---

### The Experiment: 3 Local Models, 1 Deterministic Output

One of the biggest criticisms of using LLMs in Infrastructure-as-Code (IaC) is probabilistic hallucination — models inventing non-existent environment variables or guessing incorrect port bindings.

To solve this, we designed mathematically rigid **"Air Traffic Control" (ATC) validation rules** and strict JSON-schema contracts (`ai_generator_rules.json`).
Enter fullscreen mode Exit fullscreen mode

┌─────────────────────┐ 100% Offline LAN ┌─────────────────────┐ Air Traffic Control ┌─────────────────────┐
│ Any Git Repository │ ─────────────────────────> │ Local Ollama Engine │ ───────────────────────────> │ Deterministic Stack │
└─────────────────────┘ (Zero Bytes Leave Network)└─────────────────────┘ (Exact Identical Schema) └─────────────────────┘

We benchmarked this across 3 distinct open-weight models on a standard desktop PC (Intel Core i9 with Ollama):
1. **Meta Llama 3** (8B / 70B)
2. **Mistral** (7B / Nemo)
3. **Qwen 2.5** (Coder / Instruct)

#### The Result:
When constrained by the schema boundaries and automated OCI image tag validation:
- **100% Determinism**: All 3 models derived the **exact same port allocations, persistent volume mounts, and Jinja2 conditionals** from raw repository source code and READMEs.
- **Zero Cloud Leaks**: The entire discovery, analysis, and generation executed offline within the private LAN.
- **Cost**: $0.00 in recurring API subscriptions.

---

### What NjordDeploy Does

NjordDeploy is the continuation and evolution of our earlier *PiSelfhosting* project, expanded to support heterogeneous Linux environments:

- **Agentless SSH Architecture**: Zero background daemons and zero Python runtime clutter on the target host.
- **Dual Container Engines**: Native deployment to standard Docker Engine or Rootless Podman (automatic `subuid`/`subgid` handling and unprivileged low ports).
- **Proxmox 4-Way Matrix Testing**: Automated hypervisor cross-validation across 4 quadrants (Docker vs Podman × LXC vs VM) with Gemini/Local AI root-cause failure diagnostics.
- **Curated Stack**: 46+ pre-configured services across Smart Home (Home Assistant, Frigate), Privacy (AdGuard Home, Unbound), Productivity (Nextcloud, Vaultwarden), and Local AI (Open-WebUI + Ollama).

---

### Useful Links

- 🌐 **Website & Whitepaper**: https://njorddeploy.com
- 🐙 **GitHub Repository**: https://github.com/HenkVanHoek/njord-deploy
- 📦 **Components Catalog**: https://github.com/HenkVanHoek/njord-deploy-components

The project is completely free and open-source under the MIT license. Feedback, suggestions, and feature ideas are very welcome!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)