Deployment options: Local and Cloud¶
Status: design, with a one-off feasibility probe for the Local option. Nothing here is
deployed. The Cloud option is still a plan on paper (design.md). For the
Local option, most in-cluster steps and the native model server were run once on the
owner's Mac Mini in a throwaway VM that was deleted afterwards (section 9). A single run
on one machine is not validation, and none of its numbers is a benchmark.
Bracketed IDs such as [K8] or [L6] point to rows in compatibility.md.
Every feasibility claim below has such a row with its evidence and one of five statuses:
Verified by source, Verified by dry-run, Verified by local probe, Inferred, Unknown.
This document covers where the stack runs. What runs on it is the live photo-editing demo
in demo.md, since 2026-11-27 a show in three acts. What that second iteration
changes here: a tracing component that Local can switch off (sections 2, 3 and 8), a
camera on stage (section 2), which acts run on the Mac Mini and how (section 2), the
memory budget (section 3), and a third local probe (section 9).
1. The two options¶
Recorded owner decisions (2026-11-27, design.md section 10):
| Local | Cloud | |
|---|---|---|
| Purpose | Low-cost entry: try the stack without cloud spend | The reference deployment and the stage demo |
| Hardware | The owner's Mac Mini: Apple M4, 10 cores, 16 GB RAM, macOS 27.2. No NVIDIA GPU | Vultr: one bare-metal server and one Cloud GPU instance (1x L40S 48 GB), as in design.md |
| Kubernetes | 1.37, one K3s node in a Linux VM (OrbStack) | 1.37, two K3s nodes |
| Small model | Runs natively on macOS (Metal), outside the cluster | Two vLLM replicas on the GPU |
| Image editing | An external API | A self-hosted open-weight model on the same GPU (18 GiB of it) |
| Profile | local (new) |
minimal, full (existing) |
The existing external-api profile (cloud, CPU only) is unchanged. It is not one of the
two options; see section 8.
2. Layer by layer¶
- Real: the same project and version as in Cloud, doing its real job.
- Substituted: the job is done for real, by something else.
- Simulated: the component is driven by synthetic input or produces synthetic output.
- Absent: not there, and not shown.
| Layer | Cloud | Local | Local in one line |
|---|---|---|---|
| Hardware and hypervisor | Vultr bare metal + GPU VM | Mac Mini; an OrbStack machine (a Lima VM with nested KVM for the Kata opt-in) | Substituted |
| Orchestration | K3s v1.37.2+k3s1, two nodes | The same K3s release, one arm64 node [K5] | Real |
| Sandbox runtime (gVisor by default; Kata opt-in; section 4) | gVisor release-20261123.1 on cp-0: inferred for x86_64, not run [M11] |
The same gVisor release, in OrbStack [M3]. Kata opt-in: the Kata release of Cloud, under Lima, with two config overrides [K7, K8] | Real, the same runtime in both options |
| Sandbox management | OpenSandbox 1.2.1 | The same [K10] | Real |
| AI and agent gateway | Agentgateway v1.7.0 | The same; its model backends are outside the cluster [K12] | Real |
| Inference orchestration | llm-d v1.0.0 EPP choosing between two vLLM replicas | The same EPP choosing between two simulators [K13] | Real routing, simulated backends |
| Inference engine | vLLM v0.31.0 on the GPU | llama.cpp on Metal, a native macOS process [K16]; plus llm-d-inference-sim pods for the routing path |
Substituted (real tokens, other engine, quantized weights) and Simulated (routing path) |
| GPU management | HAMi 2.11.0 splitting one L40S four ways (2 x 11, 18, 3 GiB) | Nothing [K23] | Absent |
| Image-editing model | FLUX.2 [klein] 4B on vLLM-Omni, in an 18 GiB slice (section 7) | An external API behind Agentgateway | Substituted |
| Speech to text | Whisper on vLLM, in a 3 GiB slice | Typed or dictated text by default; optional native or external STT (section 6) | Substituted |
| Context runtime and database | PowerContext 1.6.0 + embedded seekdb | The same manifest; the arm64 image build is untried [K20] | Real, unverified |
| Metrics | kube-prometheus-stack 93.11.1 | The same chart, trimmed (section 3) | Real, trimmed |
| Tracing (new) | Jaeger v2.23.0, always on; spans from Agentgateway, the llm-d EPP, vLLM and PowerContext | The same Jaeger with a smaller store [N27]; spans from Agentgateway and PowerContext only. Off by default; TRACING=on adds it |
Real, optional, off by default |
| Tool calls (MCP) | Through Agentgateway: key, per-tool rule, three tools | The same [N6, N8, N9] | Real |
| Stage camera (new) | The camera tool on a machine on stage, reached through an outbound tunnel; untried [N11] | The camera tool as a native process on the Mac Mini, which is on stage; probed with a stand-in [N9] | Real, by a different path in each option |
| Agent harness | DeepSeek Harness, through its SDK, in the demo application's pod | The same; the SDK bundles an arm64 Linux runtime [L30] | Real (untried in both; see demo.md section 2) |
| Agent control plane | kagent (full only) |
Not deployed | Absent |
| Cloud provisioning | Terraform on Vultr | An OrbStack machine on the Mac | Substituted |
What each option can and cannot demonstrate¶
| Cloud | Local | |
|---|---|---|
| The live demo end to end | Yes, everything self-hosted | Yes, with the small model on the Mac and image editing at an external provider |
| Sandboxes isolated from the node's kernel | Yes: a user-space kernel per sandbox (gVisor). A VM per sandbox with the Kata opt-in | Yes, the same [M3]. A VM per sandbox with the Kata opt-in under Lima [K8] |
| VM isolation as a security boundary | Only with the Kata opt-in, on bare metal | Only with the Kata opt-in; shown, but not claimed: nested virtualization on a desktop OS (section 4) |
| EPP routing between replicas | Yes, with real load | Yes, but against simulators: decisions are real, latencies are configured numbers [K13, K15] |
| One GPU shared by quota (HAMi) | Yes | No |
| GPU memory split on the big screen | Yes | No. The Local screen shows that panel as "not available in Local" |
| Model and image quality, latency | Measurable | Not comparable: quantized model on Metal, third-party image model |
| Experiment 1 (GPU sharing and routing) | All of it, at the decided quotas | Routing mechanics only, labelled simulated. No result from Local counts as an inference measurement |
| Experiment 2 (secure execution) | Yes: runc, gVisor and Kata | runc and gVisor in OrbStack; Kata only under Lima, with timings that are for nested virtualization only [K9] |
| Experiment 3 (context continuity) | Yes | Yes, once PowerContext runs on arm64 [K20] |
| Cost | Vultr hourly prices (design.md) |
No cloud spend; the image API is pay-per-use (section 6) |
The three acts in each option¶
The show is described in demo.md, sections 1 and 9.
| Cloud | Local with TRACING=on |
Local, default (tracing off) | |
|---|---|---|---|
| Act 1, the group photo | Yes. The camera path through a tunnel is the least tried hop [N11] | Yes. The camera is on the Mac; the edit is done by the external provider | The same |
| Act 2, the audience takes over | Yes, 4 jobs at a time | 1 job at a time (owner decision, 2026-11-28): a queue, not concurrency; expect 5 to 10 images in the act (estimate). Concurrent jobs, sandboxes side by side and routing under load are Cloud only (demo.md, section 4) |
The same |
| Act 2, the infrastructure panels | Replica choice, GPU split, sandboxes | Sandboxes; replica choice for the simulated pool, labelled; no GPU panel | The same |
| Act 3 (a), the rate limit | Yes | Yes; the gateway and its limit are the same [N18, N19] | The same: the counter comes from Prometheus, not from traces |
| Act 3 (b), the blocked egress | Yes | Yes; the gateway listener, the policy, the runtime and the tool path are the same, and this is where they were probed [P10 to P16] | The same, without the span |
| Act 3 (c), the trace | One trace per job: the gateway, the EPP, vLLM, PowerContext; nothing from inside the image model or the sandbox | One trace per job: the gateway's spans, and PowerContext's if it traces: every hop has a bar, none has an inside. The model is a single bar [N46] | No trace. The view shows the demo application's own stage timings, labelled as that |
| The close, memory | Yes | Yes, once PowerContext runs on arm64 [K20] | The same |
3. Local: Kubernetes on the Mac¶
Which VM¶
Containers on macOS run in a Linux VM. gVisor, the default sandbox runtime, runs in any of them; only the Kata opt-in depends on the route, because it needs KVM in the guest.
| Route | KVM in the guest | Evidence | Verdict |
|---|---|---|---|
| OrbStack 2.2.5 (installed) | No. No /dev/kvm; the guest kernel logs kvm [1]: HYP mode not available; no setting for it |
[K3] | The default route. Runs K3s and gVisor sandboxes [M3, M5]; a pod reaches a process on the Mac as host.orb.internal [M22]. Cannot run Kata |
Lima v2.3.0, vmType: vz, nestedVirtualization: true |
Yes. /dev/kvm present; kvm [1]: Hyp nVHE mode initialized successfully |
[K2, K4] | Needed only for the Kata opt-in. The route the first probe used |
| Colima, k3d, kind | Not probed. Colima wraps Lima; k3d and kind run nodes as containers in whichever VM provides Docker, so they inherit that VM's answer | [K26] | Not needed |
The host itself reports nested virtualization as supported
(VZGenericPlatformConfiguration.isNestedVirtualizationSupported is true on this M4
with macOS 27.2 [K2]). Whether a VM exposes it is the VM tool's choice.
Default: OrbStack, with a single-node K3s v1.37.2+k3s1 in an OrbStack machine
(owner decision, 2026-11-27, with gVisor as the default sandbox runtime). This is the
same K3s release and the same install path (get.k3s.io with a pinned version) as Cloud,
so everything from the namespaces step on is shared. In a second probe an OrbStack
machine ran K3s, gVisor and OpenSandbox [M3, M5].
What would have to be installed on the Mac: only llama.cpp (release tarball or brew
install llama.cpp) and the model file (2.33 GiB). OrbStack, kubectl and helm are
already there. Inside the machine: K3s and the gVisor binaries
(components/gvisor/).
What is weaker about this route than what was probed under Lima, said plainly:
- The whole stack (monitoring, both gateways, the EPP and simulators, OpenSandbox) ran together only in the Lima VM. In OrbStack only K3s, gVisor, OpenSandbox and agent-sandbox ran. Agentgateway to the model on the Mac was shown under Lima [K12]; under OrbStack only that a pod reaches the Mac was shown [M22], so that path is inferred there [M23].
- OrbStack's memory setting is a ceiling for all its machines and containers (10 GiB as
configured now), not a reservation. It should be lowered to the budget below
(
orbctl config set memory_mib); how OrbStack behaves at that ceiling was not tried [M23].
For the Kata opt-in: Lima v2.3.0 with the vz driver and nested virtualization
(brew install lima, or the release tarball unpacked in a user directory), running
Ubuntu and the same K3s. The model backend is then host.lima.internal instead of
host.orb.internal
(profiles/local/manifests/gateway.yaml).
Nothing was installed system-wide for either probe.
Setup detail found in the probe: the Mac's proxy setting was inherited by the VM
(HTTPS_PROXY, in the Lima VM and in the OrbStack machine alike), and with it the API server could not reach the kubelet (kubectl logs
and exec returned EOF). The VM's NO_PROXY must cover the node address and the cluster
CIDRs [K24].
Memory budget on 16 GB¶
Recomputed for the default route, OrbStack with gVisor. Most observed figures below come from the Lima probe with Kata [K17, K21] and are carried over to OrbStack as an inference; each row says what it rests on. The gVisor figures are from the OrbStack probe [M4].
| Consumer | Budget | Basis |
|---|---|---|
| macOS and its own services | 5.5 GiB | Assumption. Needs a Mac that does nothing else during the demo (see the warning below) |
| OrbStack machine (K3s node) | 6.5 GiB | Requests below: 5.0 GiB. Set as OrbStack's memory ceiling; inferred, not tried [M23] |
| llama-server with Qwen3-4B Q4_K_M | 3.5 GiB | Verified by local probe: 3.42 GiB resident with an 8192-token context in two slots [K17] |
| Native speech to text | 0 | Not run by default (section 6). whisper.cpp with the quantized turbo model would add roughly 1 GiB (estimate) |
| Camera tool (three-act demo) | 0.1 GiB, from the macOS share | Estimate. A native Python process with a capture library; not written |
| Total, default (tracing off) | 15.5 GiB of 16 | 0.5 GiB unassigned |
Total with TRACING=on |
15.75 GiB of 16 | The machine's ceiling raised to 6.75 GiB (see below); 0.25 GiB unassigned. This is why the owner decided that tracing is off by default here |
Inside the machine, by Kubernetes memory request:
| Workload | Request | Observed | Status of the observation |
|---|---|---|---|
| K3s server, containerd (no request) | - | 1.2 GiB for k3s-server and 0.2 GiB for containerd with the stack deployed, under Lima [K21]. K3s alone in OrbStack: 0.95 GiB used [M22] |
Verified by local probe, each in its own VM |
| CoreDNS, metrics-server, trimmed monitoring, Agentgateway controller and two proxies, EPP, two simulators, OpenSandbox server and controller | 1756 Mi | With kata-monitor as well (2056 Mi of requests): 2.9 GiB used idle, including K3s, under Lima [K21] | Requests: from the rendered manifests. Use under OrbStack: inferred from the Lima probe |
| of which Prometheus | 400 Mi | 446 Mi | Lima probe |
| of which Grafana | 128 Mi | 474 Mi | Lima probe. Pod total over its three containers; above the request set for the Grafana container |
| of which EPP | 256 Mi | 56 Mi | Lima probe |
| of which OpenSandbox server | 256 Mi | 187 Mi | Lima probe |
| PowerContext + embedded seekdb | 2048 Mi | not run | Unknown [K20] |
| Demo app (not written yet), with one harness runtime | 768 Mi | - | A placeholder for the application plus one runtime at about 0.55 GiB, measured once with a stand-in model [P5]. It was 256 Mi, with the runtime's memory unknown |
| One gVisor sandbox at a time | 512 Mi | About 60 MiB of gVisor processes per sandbox on top of the workload | 512 Mi limit; the gVisor RuntimeClass declares no overhead. Verified by local probe, three idle pods [M4]. It was two sandboxes, 1024 Mi |
| Total requests, first iteration of the demo | 5084 Mi | Left about 1.5 GiB of the machine for K3s beyond what requests cover | |
| OpenSandbox MCP server (three-act demo) | 128 Mi | 66 Mi | A placeholder request; the observation is from the third probe, idle after a few calls [N52] |
| Total requests, default (tracing off) | 5212 Mi | Leaves 1.4 GiB of a 6.5 GiB machine beyond requests | |
Jaeger (only with TRACING=on) |
128 Mi | 30 to 48 Mi | Request from profiles/local/jaeger-values.yaml; observed in the third probe with its store empty and full [N27] |
Total requests with TRACING=on |
5340 Mi | Leaves 1.3 GiB of a 6.5 GiB machine, 1.5 GiB of a 6.75 GiB one |
What one trace per job does to the budget (decided by the owner on 2026-11-28: Local
runs one job at a time).
Each job in flight needs its own harness runtime, about 0.55 GiB in the probe [P5], where
the budget had 256 Mi for the whole application. Two jobs at once would need about 1 GiB
that the Mac does not have. One job at a time needs one runtime and one sandbox instead
of two, which moves 512 Mi from the sandboxes to the application and leaves every total
below unchanged [P32]. The price is that Act 2 in Local shows a queue, not concurrency;
concurrency is demonstrated in Cloud. The number is set in the local profile's
demo-limits ConfigMap and held there by the virtual test [Q9].
The figure is one measurement with a stand-in model.
What the three-act demo and tracing do to the budget. Two pods are new: the OpenSandbox MCP server, which the demo needs either way, and Jaeger, which only tracing needs. Together they request 256 Mi; in the probe they used about 100 Mi [N27, N52]. The K3s processes themselves took 1.4 GiB under Lima [K21], which is all of what a 6.5 GiB machine has left beyond requests once both are in. So, on paper:
- Tracing off, the default: the earlier budget holds, with 0.1 GiB less slack.
TRACING=on: raise the machine's ceiling to 6.75 GiB, taken from the unassigned half gibibyte. The margin on the Mac drops to 0.25 GiB.
Decided by the owner on 2026-11-27: tracing is off by default in Local and switched
on when wanted, because 0.25 GiB is too thin a margin to be the default
(design.md, section 10). Requests are an upper estimate of use for most of
these pods and an unknown for PowerContext, so whether TRACING=on really fits is
settled by the first run of the whole local profile. The gateway proxy's memory did not visibly change with
tracing on in the probe (25 to 35 Mi), which is one observation.
What the runtime change did to the budget: kata-monitor's 300 Mi request and 640 Mi of Kata RuntimeClass overhead for two sandboxes are gone (6024 Mi before, 5084 Mi now), and that 0.9 GiB is split between a smaller VM ceiling and macOS. With the Kata opt-in the earlier budget applies: a 7 GiB Lima VM, 6024 Mi of requests, 1664 Mi for two sandboxes (each QEMU process 0.36 GiB resident [K21]), and 5.0 GiB for macOS.
Does the full Local stack fit? Yes, on paper and only with these trims. The margin is a little wider than with Kata and still thin. What Local drops or trims compared with Cloud:
- Dropped: HAMi, vLLM, the self-hosted image model, in-cluster speech to text, kagent.
- Trimmed monitoring: the same
kube-prometheus-stackchart with no default rules, 6 h retention, 30 s scrape interval and smaller requests (profiles/local/monitoring-values.yaml). A lighter stack (plain Prometheus, no operator) was rejected: the Agentgateway and llm-d charts createServiceMonitorandPodMonitorobjects, so the operator CRDs are needed anyway, and a second monitoring project would break "one layer, one project". - Trimmed requests for the EPP and the OpenSandbox server.
- Tracing is left out by default. Neither Jaeger nor the gateway's tracing policy is
installed, and no component is told to trace;
make <target> PROFILE=local TRACING=onadds them. The llm-d EPP of the simulated gateway never traces in Local. The virtual test renders the profile both ways [N47]. - One job at a time (decided 2026-11-28), so one harness runtime and one sandbox. The demo queue enforces it. Was: two concurrent sandboxes. gVisor sandboxes are small enough that more would fit if the workload's own memory allows; with the Kata opt-in two is the limit.
Warning: the budget assumes a dedicated machine. During the probe the Mac Mini was doing unrelated work and already had 23.7 GB of swap in use. In that state the probe ran but the VM and the model were being paged out. Before a Local demo, close everything else, or accept the fallback of leaving PowerContext out (which frees 2 GiB of requests).
Unknown until tried: PowerContext's real memory use, and whether its image builds on
arm64. pylibseekdb 1.4.1.post2 publishes manylinux_2_28_aarch64 wheels, which is
necessary but not sufficient [K20].
4. Local: the sandbox runtime on Apple Silicon¶
The runtime under the sandbox is selectable. gVisor is the default in both options
(owner decision, 2026-11-27); Kata Containers is an opt-in; runc is a baseline. The
comparison is in sandbox-options.md.
gVisor (default)¶
gVisor needs no KVM, so it runs without nested virtualization, in OrbStack. Executed in a probe, in a throwaway OrbStack machine [M3 to M8]:
- gVisor
release-20261123.1on K3sv1.37.2+k3s1: three files or directories on the node, a containerd drop-in and aRuntimeClass. A pod reports the kernel4.19.0-gvisor; the node's is OrbStack's [M3]. - About 1 s from pod creation to Ready, the same as runc there [M4]; against about 20 s for Kata under Lima [K9].
- OpenSandbox 1.2.1 with
type = "gvisor"created a sandbox, ran a command in it and deleted it; the create call took about 2 s [M5]. - OpenSandbox's egress sidecar cannot be used under gVisor [M6]; a Kubernetes
NetworkPolicyclosed egress instead, and was confirmed against a control [M7].
How the documents label it: "sandbox isolated by a user-space kernel (gVisor)". It is not a VM, and must not be called one.
Open points that come with this default, each a risk in design.md:
- Whether the demo's image-processing code runs under gVisor is unknown: only
unameandcurlwere run [M12, R22]. Local is where this can be settled first. - A command sent right after a sandbox reports running can fail; the demo app retries [M8, R23].
- Sandbox egress rests on a
NetworkPolicy, not on OpenSandbox's sidecar [M6, M7, R25].
Kata (opt-in, needs Lima)¶
Nested virtualization works on this M4, and a Kata pod boots, with two configuration overrides. Executed in the probe [K4 to K10]:
- Lima VM with nested virtualization:
/dev/kvmexists. kata-deploy4.4.0 installs with this repository's values and creates thekata-qemu-runtime-rsRuntimeClass [K6].- With the chart defaults a Kata pod does not start [K7]:
- QEMU exits with
Property 'host-arm-cpu.pmu' not found. Kata passes-cpu host,pmu=off, and the nested guest CPU has no PMU property. - With that fixed, the runtime gives up waiting for the guest agent. The guest needs about 7 s to boot here; the default budget is 3 s.
- With
cpu_features = ""andreconnect_timeout_ms = 60000, set through the chart'sshims.qemu-runtime-rs.dropInvalue (profiles/local/kata-values.yaml), the pod runs. Inside it the kernel is6.18.62(the Kata guest kernel); the node's is7.0.0-38-generic[K8]. - OpenSandbox 1.2.1 created a sandbox with that RuntimeClass, ran a command in it and deleted it; the pod was gone afterwards [K10].
Cold start from pod creation to Ready was about 20 s in three tries, against 0.6 s for a runc pod, with the image already on the node [K9]. That is nested virtualization on a desktop; it says nothing about Kata on bare metal.
How the documents label isolation in Local¶
- The sandbox is a VM with its own kernel. That is real and can be shown.
- It is not presented as a security boundary. The host hypervisor is Apple's Virtualization.framework on a desktop operating system, the KVM layer is nested, and nobody has assessed that combination. Wording to use: "VM-isolated sandbox (nested virtualization, demonstration only)".
runc¶
Always available: OpenSandbox with no [secure_runtime]. Every screen and document must
then say: "Sandbox pods share the VM's kernel. No isolation beyond a container." It
is the baseline of experiment 2 and the last resort, not a way to run the demo.
5. Local: inference¶
Why the model runs outside the cluster¶
Checked rather than assumed [K1]: neither the OrbStack VM nor the Lima VM exposes a GPU
device (no /dev/dri), while llama.cpp started natively lists MTL0: Apple M4. A pod
therefore has only CPU. The small model runs as a macOS process and Agentgateway reaches
it as an external backend.
Native runtime¶
| Runtime | OpenAI-compatible endpoint | Tool calling | Verdict |
|---|---|---|---|
llama.cpp llama-server v1.1.0 (build b12774) |
Yes | Yes, with --jinja (the model's chat template) |
Chosen. Probed: [K16, K17] |
| Ollama v0.40.18 | Yes; Agentgateway has an Ollama provider |
Yes for supported models | Not probed [K27]. A daemon plus its own model store; equally workable |
MLX (mlx_lm.server) |
Yes | Depends on the model's template | Not probed. The copy already on this machine fails to import (a tokenizers version conflict in the owner's conda environment) |
Model: Qwen3-4B, GGUF, Q4_K_M (2.33 GiB, Apache-2.0, not gated), from the
publisher's own Qwen/Qwen3-4B-GGUF repository. It is the same model as Cloud's, so
prompts and tool definitions carry over, but quantized to 4 bits and served by a
different engine: output quality and speed are not comparable with BF16 on vLLM.
Probe result [K16, K17], one request, not a benchmark: given two tools and "make everyone
fly", the model returned a well-formed tool_calls entry for edit_image. Prompt
processing 238 tokens/s, generation 28.9 tokens/s, 2.4 s wall time for 275 prompt and 36
completion tokens. Q5_K_M (2.69 GiB) and Q8_0 (3.99 GiB) also fit on disk; Q8_0
would take the memory margin to zero.
How Agentgateway routes to it¶
An AgentgatewayModel with provider: OpenAI and
baseURL: http://host.orb.internal:8080/v1, attached to the Gateway
(profiles/local/manifests/gateway.yaml).
host.orb.internal is the Mac as seen from an OrbStack machine; under Lima the name is
host.lima.internal. Probed under Lima: a request sent to the Gateway inside the cluster
came back from llama-server on the Mac, which was listening on 127.0.0.1 only [K12].
Probed under OrbStack: a pod reached a process listening on the Mac's 127.0.0.1 by that
name [M22]; the same request through Agentgateway was not repeated there [M23]. The model
server does not need to listen on the LAN.
llm-d locally: the inference simulator¶
The EPP selects pods of an InferencePool; a process on the Mac is not a pod. Making it
one (a proxy pod per "replica") would be a custom adapter, which the project's principles
exclude. So Local has two gateways that never share a URL:
| Gateway | Backends | Real or simulated |
|---|---|---|
inference-gateway |
The native model and the external image API | Real. The demo uses this one. No EPP on this path: there is one endpoint |
sim-gateway |
InferencePool of two llm-d-inference-sim pods, chosen by the llm-d EPP |
Routing real, backends simulated |
llm-d-inference-sim is llm-d's own vLLM stand-in. Pinned at v1.2.0
(ghcr.io/llm-d/llm-d-inference-sim:v1.2.0, published for arm64 [K18]). It exports the
vLLM metrics the EPP reads [K14]. Probed: behind Agentgateway v1.7.0 the EPP scheduled 26
requests, 13 to each simulator [K13].
Limits, stated wherever the simulator appears [K15]:
- Its text is random sentences and its latencies are the numbers in
llm-d-sim.yaml. No Local number from this path is a measurement of inference. - It runs with its built-in approximate tokenizer. Upstream warns that this breaks prefix-cache-aware routing fidelity; exact tokenization needs a vLLM render sidecar (a second container running a vLLM CPU image in each pod), which was left out for memory.
- The served model name is
ail-sim, so a simulated answer cannot pass for the real model.
6. Local: HAMi, speech and the image API¶
HAMi¶
HAMi is cloud-only. Nothing honest can be shown locally.
- HAMi's device plugin discovers NVIDIA GPUs through NVML. There is none.
- Upstream's
mock-device-plugin(v1.0.1, also a HAMi chart option) is not a fake GPU. It reads the device list that the real HAMi device plugin wrote to the node annotationhami.io/node-nvidia-registerand mirrors the memory and core resources into the node's capacity [K23]. Without a real GPU there is nothing to mirror. - Writing that annotation by hand might make the HAMi scheduler place pods against an invented GPU. Upstream documents no such mode, it was not tried, and it would show bookkeeping for a device that does not exist while enforcing nothing. Not adopted.
Speech to text¶
| Where | Proposal | Needs | Status |
|---|---|---|---|
| Local, default | No server-side STT. The phone page has a text box; "voice" is the phone keyboard's own dictation | Nothing | Works by construction; the audio never reaches the lab |
| Local, option A | whisper.cpp v1.9.6 natively on Metal, whisper-large-v3-turbo quantized (547 MiB file), registered behind Agentgateway like the small model |
About 1 GiB more memory (estimate), which the budget does not have; whether its server's response matches the OpenAI transcription format was not checked | Not probed [K28] |
| Local, option B | An external STT API behind Agentgateway | A key; pay-per-use | Owner decision |
| Cloud | Whisper large-v3-turbo (MIT, 1.51 GiB) on vLLM v0.31.0, which serves /v1/audio/transcriptions [L3], as a further Deployment with its own HAMi quota (whisper.yaml) |
A 3 GiB quota (assumption) [L23]; audio dependencies in the image unknown [L28] | In minimal and full; unvalidated |
Agentgateway v1.7.0 routes /v1/audio/transcriptions and /v1/images/edits as model
traffic [L1], so speech and image calls take the same gateway as chat.
The external image-editing API (Local)¶
Candidates only. No account was created, no key obtained and no paid call made; prices and latencies below come from third-party comparison pages, not from the providers' price lists, and were not verified first-hand [L15]. All need an account and an API key.
| Candidate | What it is | Cost model (unverified) | Latency (unverified) | Notes |
|---|---|---|---|---|
| Black Forest Labs API, FLUX.2 [klein] | The hosted version of the model proposed for Cloud | Per image, a few US cents or less | Seconds | Same model family in both options, which keeps Local and Cloud comparable |
| Google Gemini image models ("Nano Banana") | Instruction-based editing, strong at keeping people recognisable | Per image by resolution, about 0.04 to 0.15 USD | Several seconds | An Agentgateway Gemini provider exists; whether the image call maps to /v1/images/edits is unknown |
| OpenAI GPT Image | /v1/images/edits, the API shape the manifest already assumes |
Per token; cents per image depending on quality | Several seconds to tens of seconds | Fits the placeholder in gateway.yaml without change |
| fal.ai or Replicate | Hosted catalogues with many edit models, including the above | Per image or per megapixel | Seconds | One key, many models; their APIs are not OpenAI-shaped |
| Alibaba Model Studio, Qwen-Image-Edit | Hosted Qwen-Image-Edit | Per image | Seconds | Region and account constraints not checked |
Provider choice is an owner decision (section 10). Things to weigh beyond price: the provider's content policy on photos of real people, where the photos are processed and for how long they are kept, and whether its API is OpenAI-shaped (no extra code) or needs an adapter in the demo app.
7. Cloud: the image model and the GPU budget¶
The model¶
| Candidate | Licence | Size on disk | Verdict |
|---|---|---|---|
| FLUX.2 [klein] 4B | Apache-2.0, not gated | 14.9 GiB of weights (transformer 7.22, text encoder 7.50, VAE 0.16) [L7] | In minimal and full. Generation and editing in one model, distilled to 4 steps; the model card says about 13 GB of VRAM [L6] |
| Qwen-Image-Edit-2511 | Apache-2.0, not gated | 53.8 GiB repository | The model llm-d's guide uses on NVIDIA, with an H100 80 GB as reference. Does not fit beside anything on a 48 GB card [L11] |
| FLUX.2 [klein] 9B, FLUX.1 Kontext [dev] | Non-commercial licences, gated | 49 to 54 GiB | Excluded by licence [L24] |
The serving stack¶
vLLM serves text output only. llm-d v1.0.0 documents image serving on vLLM-Omni in its
"omni-serving" guide: an image-to-image pool answering /v1/images/edits behind the llm-d
router, with the image docker.io/vllm/vllm-omni:v0.30.0 [L4]. vLLM-Omni v0.30.0 lists
Flux2KleinPipeline with black-forest-labs/FLUX.2-klein-4B for NVIDIA GPUs [L5]. So the
image model fits the existing layers without a new project in the request path:
vLLM-Omni is a sibling of vLLM under the same upstream organisation. It is listed as part
of the Inference Engine layer rather than as a new layer; whether that reading of "one
layer, one project" is acceptable is an owner decision. Caveats: llm-d marks its omni
guide "community" (not covered by its nightly tests), and its NVIDIA recipe uses
Qwen-Image-Edit, not FLUX.2 klein [L4]. ComfyUI (GPL-3.0) and a hand-written diffusers
server were considered and rejected: the first is a new project with its own API, the
second is custom code.
Single-GPU budget on an L40S¶
Decided by the owner on 2026-11-27: option A (design.md, section 10).
It is a paper budget. Nothing below was measured, and the card's usable memory has
not been read (44.7 GiB if "48 GB" is decimal).
| Tenant | HAMi quota |
|---|---|
| Two LLM replicas (Qwen3-4B on vLLM) | 2 x 11 GiB |
| Image editing (FLUX.2 [klein] 4B on vLLM-Omni) | 18 GiB |
| Speech to text (Whisper on vLLM) | 3 GiB |
| Total | 43 GiB [L10] |
The quotas are in the manifests of minimal and full, and the per-tenant arithmetic is
in design.md, section 6. In short:
- Image model. 14.9 GiB of weights if everything stays on the GPU [L7], plus working memory for a 1024 x 1024 edit that nobody here has measured. The card's "13 GB" is below the weight total, so it presumably counts on moving the text encoder off the GPU between steps [L8]. 18 GiB is the quota; 16 GiB is the floor to test.
- LLM replicas. Before this decision the plan was two replicas at 20 GiB, which with
the image model and speech would need 61 GiB. At 11 GiB a replica keeps its 7.5 GiB of
weights and, after vLLM's own overhead, about 0.4 to 1.4 GiB of KV cache on paper
[L27]. One full 8192-token context needs 1.13 GiB, and vLLM refuses to start if it
cannot hold one [L26]. So the replica may need a smaller context or a higher
utilisation setting to start at all. The owner decided to keep 8192 and test it; the
order of things to change if it fails is
design.md, risk R14, and its capacity is a few thousand tokens in total, enough for the demo's short planning calls but not for several long contexts.
Correction. The version of this table the decision was taken from said "about 2.4
GiB of KV cache: two full 8192-token contexts" for option A. That left out the 1 to 2
GiB that design.md assumes for CUDA context and activations. The figure above is the
corrected one; it makes option A tighter than it was presented.
Fallbacks if measurement disagrees, kept from the options the decision was made among. The first steps inside option A (utilisation, context length) are in risk R14.
| # | Fallback | LLM | Image | Speech | Total | Trade-off |
|---|---|---|---|---|---|---|
| E | Speech off the GPU | 2 x 12.5 GiB | 18 GiB | 0 | 43 GiB | The smallest change: dictation on the phone as in Local, or Whisper on CPU. Gives each replica 1.5 GiB more, on paper 1.75 to 2.75 GiB of KV cache |
| B | One LLM replica | 1 x 20 GiB | 18 GiB | 3 GiB | 41 GiB | Simple, roomy. No replica choice left: EPP routing and the GPU-sharing comparison of experiment 1 lose their subject |
| C | A larger or second GPU | 2 x 20 GiB | 20 GiB | 4 GiB | 64 GiB | Needs the A100 80 GB plan (listed at 2.397 USD/h against 1.671 for the L40S) or a second GPU instance. Changes the hardware the project is named for |
| D | Image editing through the external API in Cloud too | 2 x 20 GiB | - | 3 GiB | 43 GiB | The headline step of the demo then leaves the cluster in both options |
Risks of putting the image model on the shared card (design.md, R15 to R17):
- HAMi-core under vLLM-Omni is unknown [L9], the same kind of gap as vLLM's CUDA 13
user space (
compatibility.md, D7). - Compute is shared without a limit. A 4-step image edit will take GPU time from the LLM replicas while it runs. How much is unmeasured, and it is part of what the demo shows.
- Model download: about 15 GiB more to pre-pull on
gpu-0.
8. Profiles and make¶
| Profile | Option | Where | Status in this pull request |
|---|---|---|---|
local (new) |
Local | Mac Mini, OrbStack machine | profile.yaml, values and manifests added; checked by make virtual-test |
minimal (default) |
Cloud | Vultr, CPU + 1 GPU | LLM quotas lowered to 11 GiB; steps image-model and speech added (section 7); a namespaces step first. The demo app is not added yet |
full |
Cloud | as minimal |
As minimal, plus kagent and Agent Substrate, which kagent requires. K3s must be started with three feature gates (design.md, section 2) |
external-api |
neither | Vultr, CPU only | A namespaces step first; otherwise unchanged. Still useful for trying the execution and context paths in the cloud without a GPU; whether to keep it now that local exists is an owner decision |
Since the second iteration of the demo every profile also has the steps tracing,
tracing-wiring, mcp and demo-entry (design.md, section 4). In minimal, full
and external-api tracing is always installed; in local the two tracing steps carry a
switch.
make selects them the same way as before: PROFILE=<name>, default minimal. For
local, tracing is off by default and TRACING=on adds it. The stub targets
reject TRACING=off with any other profile.
| Target | minimal, full (Cloud) |
local |
|---|---|---|
provision |
Terraform: Vultr VPC, firewall, servers | Create the OrbStack machine (limactl start for the Kata opt-in). No Terraform |
bootstrap |
Node prep, K3s on both nodes, CRDs, Kata, HAMi | K3s in the VM, CRDs, Kata with the local overrides. Start llama-server on the Mac |
deploy |
Steps of the profile | Steps of the profile |
verify, demo, benchmark |
As designed | Same targets; benchmark skips what Local cannot measure and labels simulated results |
destroy |
terraform destroy |
Delete the VM, stop llama-server |
virtual-test |
Checks all profiles, including local, and local once more with tracing on |
All targets except virtual-test are still stubs. local is accepted as a PROFILE
value by the stubs.
Install order for local is in
profiles/local/profile.yaml. Differences from
minimal: no hami and no vllm; llm-d-sim in place of
vllm; the gateway manifest with external backends and the second, simulated gateway;
its own MCP manifest, in which the camera target is the Mac
(profiles/local/manifests/mcp.yaml); a smaller
Jaeger; and the tracing switch.
The single node carries the labels agentic-infra-lab/gvisor=true
(agentic-infra-lab/kata=true for the Kata opt-in) and
agentic-infra-lab/node=cp-0: it plays cp-0's role, which lets the shared PowerContext
manifest be used unchanged.
9. What the local probes did¶
Four probes on 2026-11-27 and 28, on the Mac Mini. The third, for the three-act demo, and
the fourth, for variant V1 and Agent Substrate, are described at the end of this section. This table is the first, in a Lima VM with
Kata, in this order. The second, in an OrbStack machine with gVisor (now the default
route), is listed in sandbox-options.md and rows M3 to M8, M15
and M22 of compatibility.md; it did not repeat rows 11 to 14 below. Everything was run from temporary
directories; nothing was installed system-wide; the VM was deleted, the model server
stopped and OrbStack left stopped, as found.
| # | Check | Result | Row |
|---|---|---|---|
| 1 | Host API: nested virtualization supported | true |
K2 |
| 2 | OrbStack 2.2.5 VM: /dev/kvm |
Absent; HYP mode not available |
K3 |
| 3 | Lima v2.3.0 vz VM with nested virtualization: /dev/kvm |
Present | K4 |
| 4 | K3s v1.37.2+k3s1 in that VM |
Node Ready, arm64, containerd 2.3.7-k3s1 | K5 |
| 5 | kata-deploy 4.4.0 with repository values |
Installed | K6 |
| 6 | Kata pod with chart defaults | Fails twice (PMU property, agent timeout) | K7 |
| 7 | Kata pod with the two overrides, then set through the chart | Runs; guest kernel differs from the node's | K8 |
| 8 | Kata cold start, three pods | About 20 s; runc 0.6 s | K9 |
| 9 | OpenSandbox 1.2.1 on Kubernetes 1.37 with Kata: create, exec, delete | Works | K10 |
| 10 | OpenSandbox namespaces | Two problems found; since fixed in every profile | K11 |
| 11 | llama.cpp on Metal, Qwen3-4B Q4_K_M: API, tool call, memory | Works; 3.42 GiB | K16, K17 |
| 12 | Agentgateway v1.7.0 to the model on the Mac | Works | K12 |
| 13 | llm-d EPP v1.0.0 behind Agentgateway v1.7.0 with two simulators | Works; 13/13 split | K13 |
| 14 | Memory of the deployed stack in a 6 GiB VM | 2.9 GiB idle, 3.7 GiB with two sandboxes | K21 |
| 15 | kata-monitor metrics under the Rust runtime | No kata_shim_pod_overhead_* |
K25 |
Not exercised: PowerContext (its image was not built), monitoring targets actually being scraped, the OpenSandbox egress sidecar, anything under load, anything for longer than a few minutes, a restart of the VM with the stack in it.
The third probe: tool calls through the gateway, the rate limit, tracing¶
In a throwaway OrbStack machine with K3s v1.37.2+k3s1, deleted afterwards; a stand-in
for the camera tool ran as a native process on the Mac from a temporary directory and was
stopped. Nothing was installed system-wide. What stood in for unwritten code, and what
was not in the probe (no model, no EPP, no gVisor, no PowerContext), is stated at the top
of section N of compatibility.md.
| # | Check | Result | Row |
|---|---|---|---|
| 1 | K3s with the Mac's proxy setting in its service environment | Does not start; starts with the containerd proxy variables only | N53 |
| 2 | The Gateway with two listeners; the committed MCP manifest (local variant), public routes, rate limits and tracing policy | All accepted and attached | N6, N23, N33 |
| 3 | /mcp without a key; with the agent key; with the operator key |
401; three tools of 25; one tool | N6 |
| 4 | A tool outside the rule | Hidden from the list; a call is refused | N6 |
| 5 | A custom MCP server on the Mac, behind the gateway | Works, through host.orb.internal |
N9 |
| 6 | opensandbox-mcp 1.2.1 over Streamable HTTP behind the gateway, command in a sandbox |
Works (runc) | N8 |
| 7 | An upload attempt from the sandbox, by name and by address | Fails; the tool result carries exit codes 28 and 7 | N22 |
| 8 | Two of three tool servers down | The third keeps working; a silent server costs 10 s per session start | N10 |
| 9 | 120 requests at once on the limited route | 40 passed, 80 answered 429 with rate-limit headers; counted by the gateway with reason="RateLimit" |
N18, N19 |
| 10 | Model and tool paths on the public listener; public paths on the internal one | 404 both ways. The stand-in's own MCP path was reachable publicly, which led to a second port | N23, N24 |
| 11 | Jaeger with the repository's values: spans from the gateway, a supplied trace continued, trace context at the tool servers, sampling by path | Works | N27, N28, N33, N34 |
| 12 | Connections to the MCP server and the application from another namespace | Refused | N14 |
| 13 | Memory: Jaeger, the MCP server, the gateway proxy | 30 to 48 Mi, 66 Mi, 25 to 35 Mi | N27, N52 |
Not exercised: the harness, any model, the EPP's and vLLM's spans, PowerContext, gVisor together with the MCP path, the camera itself, a tunnel, anything under sustained load.
The fourth probe: variant V1, and Agent Substrate for kagent¶
On 2026-11-27 and 28, in one throwaway OrbStack machine with K3s v1.37.2+k3s1 and
gVisor, deleted afterwards with every file it used; a stand-in model server ran as a
native process on the Mac and was stopped. Nothing was installed system-wide; a Go
toolchain and the kagent CLI were unpacked in a temporary directory and removed.
| # | Check | Result | Row |
|---|---|---|---|
| 1 | The harness SDK 0.2.2rc2 with a traceparent in its provider and MCP headers, through the gateway |
One job is one trace of 19 spans; the model server receives the trace id | P1 |
| 2 | Three jobs at once, one harness runtime each | Three separate traces | P2 |
| 3 | One runtime, a header meant to change per request | It does not change: fixed at start | P3 |
| 4 | The harness calling the sandbox tool through the gateway | Works, under the name mcp__tools__sandbox_command_run |
P4 |
| 5 | A runtime's start time and memory | About 1 s; 0.3 GiB idle, 0.55 GiB after a session | P5 |
| 6 | A follow-up in a new runtime | Resumes the earlier session | P6 |
| 7 | The same on the node instead of in a pod | The first turn waits 21 s; not explained | P8 |
| 8 | A gVisor sandbox created by OpenSandbox, with the proxy variables: the check host, an allowed host, any other host | 200, 200, 403 from the gateway | P10 |
| 9 | The refusal in the gateway's metrics, log and trace | Counter, log line and span, as quoted in the rows | P11, P16 |
| 10 | HTTPS through the proxy | 405 by default; 403 with CONNECT routed; cannot be allowed this way | P12, P13 |
| 11 | Past the proxy: by address, by name, raw TCP, the gateway's other ports | All fail | P14 |
| 12 | The same with the NetworkPolicy removed |
The sandbox reaches the internet directly | P15 |
| 13 | Upstream Substrate v1.0.1 (Go-built installer) next to the lab's stack | Installs; traces reach the lab's Jaeger; leaves a cluster-scoped object behind | P27 |
| 14 | kagent install 1.0.1 (Substrate from kagent's fork, a shared PostgreSQL, kagent) next to the lab's stack |
Installs; all pods run; 2.3 Gi requested, 0.55 Gi used | P23 to P26 |
A mistake made in the probe, for the record: while removing the leftovers of step 13 a
name filter also deleted five built-in ClusterRole and ClusterRoleBinding objects of
the throwaway cluster; K3s recreated them on restart, and step 14 ran after that.
Not exercised: a real model, the EPP and vLLM, PowerContext and its plugin, the demo application, Kata and runc, x86_64, any kagent agent, kagent with this repository's values, HAMi or a GPU next to Substrate, anything under load.
Findings that also concern the Cloud design¶
These came out of the probe and touch files that belong to the Cloud design
(design.md). Findings 1 and 2 have since been fixed in all four profiles
(design.md, section 4), and the virtual test now checks for that class of problem [F7].
- Nothing creates the
opensandboxnamespace.components/opensandbox/values.yamltells the server to create sandboxes there, but the chart createsopensandbox-systemandopensandbox-dataplane. Sandbox creation fails withnamespaces "opensandbox" not founduntil the namespace exists [K11]. - The API-key Secret cannot be created before the chart. The chart creates
opensandbox-systemitself and refuses to adopt a namespace it did not create, so "Secret created at deploy time" needs eitherbase.fastSandbox.namespaces.createSystem: false(now set for every profile) or creating the Secret after the install [K11]. - llm-d v1.0.0 works behind Agentgateway v1.7.0 in this probe, which is the pair
compatibility.mdrow B11 infers and risk R5 worries about. The evidence is from arm64 with simulators, so B11 keeps its status for Cloud, with this as support [K13]. - OpenSandbox 1.2.1 ran on Kubernetes 1.37.2, the accepted gap G1 (row A11). Same caveat: one create, exec and delete on arm64 is support, not the planned check on the real cluster [K10].
kata_shim_pod_overhead_*is not exported under the Rust runtime, which is row E11's open question and risk R11 [K25].
10. Open decisions for the owner¶
- Decided 2026-11-27: gVisor is the default sandbox runtime, and Local runs in
OrbStack. Kata is an opt-in that needs Lima. The sandbox manager stays OpenSandbox.
No longer open (
design.md, section 10). - Dedicated Mac for Local demos. The memory budget does not hold beside the machine's current workload.
- External image-editing provider and model for Local, including its terms for photos of real people.
- Speech in Local: phone dictation only (default), native Whisper, or an external STT API.
- Decided 2026-11-27: Cloud GPU budget is option A (section 7), and the LLM
context length stays at 8192 under the 11 GiB quota: test on real hardware, lower it
only if a replica fails to start (
design.md, section 10 and R14). No longer open. - vLLM-Omni as part of the Inference Engine layer, and FLUX.2 [klein] 4B as the image model. The budget decision gives the image model its slice; the manifests assume this pair, and the reading of "one layer, one project" has not been confirmed.
- Keep or retire the
external-apiprofile. - Simulator fidelity in Local: approximate tokenizer (current) or add the render sidecar and its memory.
- Decided 2026-11-27: tracing in Local is off by default, switched on with
TRACING=onwhen wanted. No longer open. With it on, the machine's ceiling goes to 6.75 GiB and 0.25 GiB stays spare (section 3). - Decided 2026-11-28: the Local option runs one job at a time; concurrency is demonstrated in the Cloud option. No longer open. The alternatives were to keep two jobs and drop PowerContext, or to keep two jobs in one shared harness runtime and give up one trace per job in Local.
- Where the show runs. The three-act demo's camera is simplest in Local, where the
Mac is on stage, and least tried in Cloud, where it needs a tunnel from a stage
machine [N11]. Cloud is the only option that shows the GPU split and real replica
routing. See
demo.md, section 8, item 17.