Skip to content

Architecture

Status: planned design. Nothing described here is deployed yet. This is the overview; the concrete plan (which server runs what, versions, ports, install order) is in design.md, and the evidence for the pinned versions is in compatibility.md.

Two things changed by owner decision on 2026-11-27, and this overview is being kept as the record of the earlier shape with the changes marked:

  • There are now two deployment options: Cloud (what this document describes) and Local, on the owner's Mac Mini without an NVIDIA GPU. See deployment-options.md.
  • The demo is a live photo-editing web application, not a coding agent driven from a terminal. Requests start at an audience phone, not at the MacBook. See demo.md. The earlier demo is superseded, not deleted: the request paths below still describe what happens inside the cluster.
  • The demo is now a show in three acts (group photo, the audience takes over, guardrails), and with it: every tool call of the agent goes through Agentgateway, which closes the open question at the end of this document; a stage camera is a third tool; and distributed tracing (Jaeger) is a new component, which the Local option can switch off. See demo.md and design.md, section 10.

Topology

  • Developer MacBook: ran the agent harness (DeepSeek Harness) in the earlier design. By owner decision of 2026-11-27 the harness runs in the cluster, embedded in the demo application through its SDK (demo.md section 2); the MacBook remains the operator's machine.
  • Two Vultr servers forming one Kubernetes cluster, with one GPU (1x L40S 48 GB) between them. K3s with Traefik disabled is preferred; kubeadm is the fallback if Kata Containers or HAMi misbehave on K3s containerd. Vultr VKE is not used because it cannot take bare-metal workers.

The control plane is a single replica and there is no high availability. The proposed split (a bare-metal server for the control plane and the sandboxes, a Cloud GPU instance for inference) is in design.md; the plans themselves are still an owner decision. The default sandbox runtime, gVisor, does not need bare metal; the owner decided to keep cp-0 on bare metal until experiment 2 has run, because the Kata opt-in needs KVM, and to revisit it afterwards.

Layers

Layer Project Role in the lab
Agent Harness DeepSeek Harness The agent loop, embedded through its SDK and running in the cluster as part of the demo application's pod. Was: a terminal program on the MacBook
Agent Control Plane kagent Optional module (full profile); not on the harness's required path. It requires Agent Substrate, which full installs as its dependency and nothing else uses
AI & Agent Gateway Agentgateway Single entry point for model traffic, calling the llm-d EPP; and for the agent's tool calls (MCP), which it authenticates with a static key and authorises tool by tool; publishes the demo application on a listener of its own and rate-limits it
Context Runtime PowerContext Memory and session context; the harness talks to it directly
Database seekdb (embedded, preferred) or OceanBase Storage behind PowerContext
Sandbox Management OpenSandbox Creates sandboxes on demand
Sandbox runtime (selectable) gVisor (default), Kata Containers (opt-in), or runc Isolation for sandbox pods only. Decided on 2026-11-27; see sandbox-options.md
Inference Orchestration llm-d EPP and basic routing only
Inference Engine vLLM Two small replicas of one model. For the demo also Whisper on vLLM and an image model on vLLM-Omni. Local: llama.cpp on the Mac instead
GPU Management HAMi Splits the single GPU: two vLLM replicas at 11 GiB, the image model at 18 GiB, speech at 3 GiB (a paper budget). Cloud only
Orchestration Kubernetes (K3s) Runs everything in the cluster
Metrics Prometheus + Grafana Short retention; preset dashboards
Tracing Jaeger New with the three-act demo. One pod, traces in memory; receives OTLP directly, no collector. Off by default in Local
Cloud Vultr Servers. Local: an OrbStack machine on the Mac Mini (a Lima VM for the Kata opt-in)

Two small pieces are not upstream projects: the thin demo application (phone page, big-screen page, queue) and, since the three-act demo, the camera tool (one MCP tool that takes one frame). They are the only new code the lab writes; neither is written yet. See demo.md, section 6. With Jaeger the stack also has one more component than before.

Request paths

Entry point for the demo

Audience phones reach a web page served by the demo application through one public HTTPS entry in front of Agentgateway's public listener; model traffic and the tool endpoint are on another listener and are not published. From there the application drives the agent loop, which uses the inference, execution and context paths below. The full sequence, with a diagram, is in demo.md, section 3.

Access from the MacBook

This is now the operator's path, and the path of the earlier demo.

The MacBook reaches the cluster with kubectl. The kubeconfig is fetched from the K3s server (K3s writes it to /etc/rancher/k3s/k3s.yaml) and pointed at the server's address. All management goes through the Kubernetes API. The minimal profile has no public LoadBalancer and no ingress.

Assumption, not a confirmed decision. The harness has to reach three in-cluster services: Agentgateway, PowerContext and the OpenSandbox API. The owner has confirmed kubectl access only. From that we assume kubectl port-forward to each Service as the default path, so that the harness talks to localhost ports on the MacBook. This has not been confirmed or tested, including whether port-forward holds up for long-lived streaming responses and concurrent agents.

In the request paths below, every hop from the harness into the cluster goes through such a port-forward under this assumption.

Inference

Harness -> Agentgateway -> llm-d EPP -> vLLM replica -> GPU slice (HAMi)

The harness sends model requests to Agentgateway. Agentgateway asks the llm-d endpoint picker (EPP) which vLLM replica should serve the request and forwards it there. Both replicas share one physical GPU through HAMi quotas, together with the image-editing model and speech to text.

In the external-api profile there is no GPU, vLLM, llm-d or HAMi; the model is an external API. In the local profile the model is a native process on the Mac behind Agentgateway, and the llm-d EPP is exercised separately against simulators.

The demo adds two model calls that take the same gateway: speech to text, and image editing (/v1/images/edits).

Execution

Harness -> Agentgateway (MCP) -> OpenSandbox MCP server -> OpenSandbox -> sandbox pod (selected sandbox runtime)

The harness runs code through an MCP tool backed by OpenSandbox, and since the owner's decision of 2026-11-27 it reaches that tool, like its other two (the stage camera and image editing), through Agentgateway: one endpoint, a static key, a rule per tool. It was Harness -> MCP -> OpenSandbox, directly. OpenSandbox creates a sandbox pod on demand, and the pod runs under the selected sandbox runtime: gVisor by default, Kata Containers as an opt-in. A sandbox pod has one way out: Agentgateway's egress listener, which it uses as its HTTP proxy and which refuses every destination that no route allows (the demo allows none). The refusal is a gateway decision with a status, a counter, a log line and a span. A Kubernetes NetworkPolicy closes everything else and keeps the proxy from being bypassed (owner decision, 2026-11-27; it was the NetworkPolicy alone). Other pods use the default runtime.

Context

Harness -> PowerContext -> seekdb

The harness uses a PowerContext plugin to store and retrieve memory and session state. This path does not go through the gateway.

Observability

Prometheus scrapes the components with short retention; a single Grafana instance shows preset dashboards from ../dashboards/.

Jaeger receives trace spans from Agentgateway, the llm-d EPP, vLLM and PowerContext. The image model, OpenSandbox and the harness emit none. The harness does send the static headers it is given, so the demo application starts one harness runtime per job with that job's trace context, and the gateway puts the job's model and tool calls into one trace (owner decision, 2026-11-27; probed locally; demo.md, section 10). Before that, one request was several traces lined up by time.

Optional: kagent

kagent is deployed only in the full profile. It sits beside the paths above; the harness does not depend on it. kagent 1.0.1 runs its agents on Agent Substrate and requires it, so the full profile installs Substrate as well, with a PostgreSQL the two share (design.md, section 3.10a). Substrate is not on the demo path: OpenSandbox manages the demo's sandboxes in every profile.

Out of scope for now

Istio, Redis, Kafka, a separate vector database, Argo CD, KEDA, distributed storage, and a full logging platform.

Open design questions

The full list of open decisions is in design.md, section 9. The ones that come from this document:

  • How audience phones reach the demo (demo.md, section 4).
  • Also a measurement, not a decision: whether the pinned harness SDK release works with the PowerContext plugin, which was accepted against another release (demo.md, section 2). Where the agent loop runs and which release is pinned were decided on 2026-11-27.
  • Not a decision but an early measurement: whether an 11 GiB slice is enough for an LLM replica with an 8192-token context. The split and keeping 8192 were decided on 2026-11-27 (design.md, sections 6 and 10).
  • Decided on 2026-11-27, no longer open: MCP traffic goes through Agentgateway.
  • Decided on 2026-11-27, no longer open: the tracing backend is Jaeger, and in Local tracing is off by default.
  • Whether other layers change project for the sake of end-to-end tracing (observability-options.md).
  • How the stage camera reaches the Cloud cluster (demo.md, section 11).
  • Server plans. design.md proposes that the bare-metal node hosts the Kata sandbox pods (kept on bare metal for the Kata opt-in, to be revisited after experiment 2); the GPU plan and region are open because the L40S plan was not listed as available when checked.
  • Whether kubectl port-forward is the path from the harness to in-cluster services (assumed above, not confirmed), and how the Kubernetes API port is made reachable from the MacBook.