Skip to content

Agentic Infra Lab

A minimal, reproducible, modular reference implementation of Agentic AI infrastructure, in the spirit of "Kubernetes The Hard Way", but for agentic infra.

Status: designed and checked on paper. Nothing is deployable yet, and real validation has not started. This repository contains a concrete design (docs/design.md), a compatibility matrix for the pinned versions (docs/compatibility.md), Helm values and manifests for every component, and make virtual-test, which renders and schema-checks them without a cluster. None of it has run on a GPU or on the cloud target. The only executed checks are one-off feasibility probes on a Mac Mini, in throwaway VMs (docs/deployment-options.md, section 9). There is no Terraform code and no camera tool. A first demo application exists (apps/demo): Act 1 of the demo and Act 3 run end to end in the Local option, with a stub in place of the image model. Install automation exists for the Local option only: make provision, bootstrap, deploy, verify and destroy with PROFILE=local bring the stack up in an OrbStack machine on a Mac, without PowerContext (docs/local.md); and one step for Cloud, make deploy-kagent PROFILE=full, which installs Agent Substrate and kagent and has run once against a throwaway local cluster, never on the cloud target. Every other make target fails with "not implemented yet".

Positioning

Agentic Infra Lab shows how the layers of an agentic AI stack fit together by composing existing open-source projects on a deliberately small footprint: two cloud servers, one GPU, one Kubernetes cluster, one open model.

It is not an enterprise agent platform, and it does not build a new infrastructure product. It is a lab: small enough to read end to end, and meant to be created and destroyed repeatedly.

Two ways to run it

Local Cloud
For Trying the stack without cloud spend The reference deployment and the stage demo
Hardware A Mac Mini (Apple M4, 16 GB), no NVIDIA GPU Two Vultr servers, one L40S 48 GB
Small model Runs natively on macOS Two vLLM replicas sharing the GPU through HAMi
Image editing An external API A self-hosted open-weight model on the same GPU
Not available HAMi and GPU sharing; inference routing runs against simulators -
Tracing Off by default, to save memory; TRACING=on switches it on Always on
Stage camera (the demo) Plugged into the Mac, which is on stage On a machine on stage, reached through a tunnel (untried)
Sandbox runtime gVisor, in OrbStack (default). Opt-in: Kata, which needs a Lima VM gVisor (default). Opt-in: Kata on the bare-metal node
Profile local minimal, full

What is real, simulated, substituted or absent in each, layer by layer, is in docs/deployment-options.md.

Design principles

  • One Layer, One Project: each layer of the stack is filled by exactly one project. One exception, by the owner's decision: the runtime under the sandbox is selectable, with gVisor as the default and Kata as an opt-in. Tracing is a layer added on 2026-11-27, filled by Jaeger: the stack has one more component than it had.
  • Minimal Integration: official integrations, standard protocols and Helm charts; no custom adapters.
  • Small Footprint: one GPU, a single-replica control plane, no high availability.
  • Reproducibility First: pinned versions, automated deploy and destroy.
  • Representative Workload: one real agent task validates the whole stack. The task is the live photo-editing demo, a show in three acts. The lab writes two small pieces of code for it and nothing else: a thin web application and a camera tool. (Until the three-act design it was one piece.)

Stack

Layer Project Notes
Agent Harness DeepSeek Harness The agent loop, embedded through its SDK and running in the cluster with the demo application. Was planned as a terminal program on the developer's MacBook
Agent Control Plane kagent Optional module (full profile), not on the harness's required path. kagent 1.0.1 requires Agent Substrate, so full installs that too, only as kagent's dependency: it is not a layer of the demo path, where OpenSandbox manages the sandboxes
AI & Agent Gateway Agentgateway Single gateway, single replica; calls the llm-d EPP. Also the gateway for the agent's tool calls (MCP): a static key, a rule per tool. Publishes and rate-limits the demo application. Also the sandboxes' HTTP egress proxy: it refuses what is not allowed, and the refusal is counted and traced
Context Runtime PowerContext Single instance, accessed directly by the harness
Database seekdb / OceanBase Embedded seekdb preferred
Sandbox Management OpenSandbox Sandboxes created on demand. The agent reaches it through its MCP server, behind Agentgateway
Sandbox runtime (selectable) gVisor (default), Kata Containers (opt-in), or runc Only for sandbox pods. SANDBOX_RUNTIME=gvisor\|kata\|runc; decided by the owner on 2026-11-27 (docs/sandbox-options.md)
Inference Orchestration llm-d EPP and basic routing only
Inference Engine vLLM Two small replicas. Local: llama.cpp on the Mac instead
GPU Management HAMi One GPU, split between the two replicas, the image model and speech. Cloud only
Orchestration K3s Traefik disabled; kubeadm is the fallback if Kata or HAMi misbehave on K3s containerd
Metrics Prometheus + Grafana Short retention; single Grafana instance with preset dashboards
Tracing Jaeger Added for the three-act demo. One pod, traces in memory, OTLP in, no collector. Off by default in the local profile; TRACING=on adds it there
Cloud Vultr Vultr VKE is not used because it cannot take bare-metal workers. Local: an OrbStack machine, or a Lima VM for the Kata opt-in

The demo adds an image-editing model and speech to text. In Cloud they are further workloads of the Inference Engine layer (FLUX.2 [klein] 4B on vLLM-Omni, Whisper on vLLM) with their own slices of the GPU; in Local they are an external API and the phone's own dictation. See docs/demo.md.

Pinned versions, with chart versions and image tags, live in versions.yaml. The evidence that they fit together, and the list of what is still unknown, is in docs/compatibility.md.

Out of scope for now: Istio, Redis, Kafka, a separate vector database, Argo CD, KEDA, distributed storage, a full logging platform, an identity provider, and an OpenTelemetry Collector.

Maturity caveat

The layers are not equally mature. The lower layers (Kubernetes, gVisor, Kata Containers, vLLM) are mature. The upper layers (DeepSeek Harness, PowerContext) are evolving fast; they were picked for ecosystem representativeness and integration convenience, not because they are settled. Expect the upper layers to change more often than the lower ones.

Architecture summary

An audience phone opens a web page served by a thin demo application in the cluster. The application hands each request to the agent loop, which uses three paths:

  • Inference: Harness → Agentgateway → llm-d EPP → vLLM replica → GPU slice (HAMi). Image editing and speech to text go through the same gateway.
  • Execution: Harness → Agentgateway (MCP) → OpenSandbox → sandbox pod on the selected sandbox runtime (gVisor by default; Kata Containers as an opt-in). All three tools of the agent (the stage camera, the sandbox, image editing) are reached through the gateway, by owner decision of 2026-11-27; before, the harness talked to OpenSandbox's MCP server directly.
  • Context: Harness → PowerContext → seekdb.

This replaces the earlier arrangement, in which a person drove the harness from a terminal on the developer's MacBook; the three paths inside the cluster are the same. The agent loop is the DeepSeek Harness, run in the cluster through its SDK. How phones reach the page is an open decision (docs/demo.md). The operator still reaches the cluster with kubectl, using a kubeconfig fetched from the K3s server.

Prometheus scrapes the components and Grafana displays them. Jaeger collects traces from the gateway, the EPP, vLLM and PowerContext; the demo application gives each job's harness run the job's trace context, so one request is one trace. kagent is optional and sits beside these paths, not on them; in the full profile it brings Agent Substrate with it. See docs/architecture.md for the overview and docs/design.md for the concrete plan: which server runs what, ports and protocols, install order, and the GPU memory budget.

Model plan (planned, not measured)

Item Plan
Model Qwen3-4B, BF16
Replicas 2
GPU 1x L40S 48 GB
HAMi quota 11 GiB per replica
Also on the GPU Image editing (FLUX.2 [klein] 4B) 18 GiB, speech (Whisper) 3 GiB; 43 GiB in total
Context length 8192
Concurrent agents 2-4
Tensor parallelism 1
Tool-call parser Hermes

These are design targets. None of them has been measured. The GPU split is the owner's decision of 2026-11-27 and a paper budget: on paper an 11 GiB replica has little room for an 8192-token context. The owner decided to keep 8192 and test it on real hardware; it is lowered only if a replica fails to start (docs/design.md, section 6 and risk R14).

Profiles

Profile Option Hardware Contents
local Local Mac Mini, no NVIDIA GPU One K3s node in a VM; native small model and external image API behind Agentgateway; llm-d against simulators; no HAMi; tracing off by default
minimal (default) Cloud CPU + 1 GPU The default
full Cloud CPU + 1 GPU minimal plus kagent, Agent Substrate (which kagent requires) and all experiments
external-api - CPU only, no GPU The stack without local inference; the model is an external API

See profiles/.

Planned command interface

make help                      # list targets (default)
make virtual-test              # offline compatibility check; works today
make provision PROFILE=minimal # create the Vultr servers (PROFILE=local: the VM on the Mac)
make bootstrap                 # install Kubernetes, the sandbox runtime and HAMi
make deploy                    # deploy the components of the profile
make verify                    # check that every layer is healthy
make demo                      # run the live photo-editing demo
make benchmark                 # run the experiments and collect metrics
make destroy                   # tear everything down
make docs                      # build the public documentation site into .out/site; works today
make docs-serve                # serve it on http://127.0.0.1:8000

PROFILE defaults to minimal. SANDBOX_RUNTIME=kata|gvisor|runc selects the runtime of sandbox pods; the default is gvisor, and kata is an opt-in that needs KVM on the node. Tracing (Jaeger) is always installed in the Cloud profiles and off by default with PROFILE=local, where TRACING=on adds it. Today make help and make virtual-test work, provision, bootstrap, deploy, verify, demo and destroy work with PROFILE=local (docs/local.md), and make deploy-kagent PROFILE=full, the last step of deploy for that profile (it changes the cluster the current kubeconfig context points at); every other target or profile prints that it is not implemented yet and exits non-zero. The Local option runs one job at a time; concurrency is demonstrated in Cloud. make docs builds this documentation as a site (website/README.md); it is not published.

The virtual test

make virtual-test needs helm, python3 with PyYAML and network access, but no cluster and no credentials. For each profile it fetches every pinned chart, checks its kubeVersion constraint against the pinned Kubernetes version, renders it with the values files in this repository, validates the result against Kubernetes and CRD schemas, checks that custom resources match the CRD versions installed before them, and checks that the referenced image tags exist. It prints a pass/fail/skip table and exits non-zero on any failure. It runs on every pull request. Every profile is checked once per sandbox runtime, and local once more with tracing on. It also checks that routes, policies and MCP targets reference objects that exist, and that tracing endpoints point at the rendered Jaeger. For the local profile it also checks that every image exists for linux/arm64.

It is a paper check. It cannot show that the GPU, the NVIDIA driver, gVisor, KVM or Kata work, that anything schedules or routes at runtime, or how anything performs. It also sees nothing that runs outside the cluster, such as the Local option's native model server or an external API.

Demo task and experiments

The representative workload is a live, interactive demo in three acts of about eight minutes. Act 1: the agent takes a picture of the room with a camera on stage, the audience votes on a theme with their phones, and the edited group photo appears on the big screen. Act 2: anyone scans a QR code, photographs something, says or types an instruction ("make everyone fly"), and the result joins a gallery wall beside a live view of the infrastructure. Act 3: two deliberate interceptions and a trace: the room taps and the gateway rate-limits, an attempt to send a photo out of a sandbox fails, and the trace of one request shows the time per hop. The close uses memory: "more dramatic" continues from the group photo. Throughout, an agent plans with the small model, runs image-processing code in a sandbox, calls the image model, and reaches every tool through the gateway. Design: docs/demo.md.

The three acts are the second iteration of this demo; the single flow of the first is now Act 2.

It replaces the earlier workload, an agent that built a Kubernetes GPU workload config checker from a terminal in five steps (inference, execution in a sandbox via MCP, memory, session handoff, concurrency). The same five capabilities are exercised by the new one.

Three experiments are planned (see experiments/):

  1. GPU Sharing & Inference Routing
  2. Secure Agent Execution
  3. Context Continuity

Repository layout

LICENSE           Apache License 2.0
Makefile          Command interface (virtual-test, deploy-kagent, and provision to destroy for PROFILE=local)
versions.yaml     Pinned upstream versions, chart versions and image tags
hack/             The virtual test; hack/local: the Local option's provision, bootstrap, deploy, verify, destroy
infra/            Terraform for Vultr, Kubernetes bootstrap
components/       One directory per in-cluster component: values files and manifests
                  (components/demo holds the gateway routes of the demo application)
harness/          Agent harness configuration (runs in the cluster through its SDK, see docs/demo.md)
profiles/         local, minimal, full, external-api: ordered install steps per profile
experiments/      The three experiments
dashboards/       Grafana dashboards
docs/             Architecture, design, deployment options, sandbox options, demo, compatibility
                  matrix, roadmap
mkdocs.yml        The documentation site: configuration and navigation
website/          The documentation site: how it is built from these files, and how it would be published

The demo application is in apps/demo/. The camera tool is not written; apps/camera/ is proposed (docs/demo.md, section 6).

Status

Area Status
Repository layout, docs, command interface Scaffolded
Design Written: docs/design.md (Cloud), docs/deployment-options.md (Local and Cloud side by side), docs/demo.md (the demo, second iteration: three acts). Plans, with open decisions for the owner
Version pins Resolved to chart versions and image tags. Compatibility checked on paper: docs/compatibility.md (310 claims: 121 verified by source, 27 by dry-run, 77 by one-off local probes, 38 inferred, 47 unknown)
Component values, manifests, profile definitions Written; rendered and schema-checked by make virtual-test; unvalidated on the cloud target
Local option Feasibility probed on a Mac Mini in throwaway VMs: the whole stack once under Lima with Kata, the sandbox path once under OrbStack with gVisor (now the default), and the gateway side of the three-act demo once under OrbStack (tool calls through the gateway, the rate limit, tracing). Since 2026-11-28 make provision to make verify bring it up in one OrbStack machine with gVisor (docs/local.md); PowerContext is skipped (not built). Act 1 of the demo runs there end to end with a stub image backend
Real validation (servers, GPU, a running cloud cluster) Not started
Infrastructure automation (provision to destroy), harness configuration Local: implemented, without PowerContext. Cloud and the harness configuration: planned
Demo application A first version: Act 1 and Act 3 run end to end in the Local option, on localhost, with a stub image backend (apps/demo, docs/runbook.md). Memory, a real image provider and any run from outside the Mac are missing
Camera tool, experiments, dashboards Planned

The phases are described in docs/roadmap.md.

License

Licensed under the Apache License, Version 2.0.

The upstream projects this lab composes are distributed under their own licenses.