Skip to content

Running the Local option

How to bring the Local option up and down on a Mac with OrbStack, what the targets do, and what was observed when they were run. The design and the memory budget are in deployment-options.md; this page is the operating manual.

Commands

make provision PROFILE=local   # create the OrbStack machine `ail-local`
make bootstrap PROFILE=local   # K3s and gVisor in it, CRDs, the model server on the Mac
make deploy    PROFILE=local   # the deploy steps of profiles/local/profile.yaml
make verify    PROFILE=local   # one line per layer; non-zero exit on any failure
make destroy   PROFILE=local   # stop the model server, delete the machine

TRACING=on on deploy and verify adds Jaeger and the gateway's tracing policy; it is off by default here. Every target is idempotent. SANDBOX_RUNTIME=kata is refused: it needs a Lima VM, which is not automated.

Needed on the Mac: OrbStack, helm, python3 with PyYAML, curl. Nothing is installed system-wide. kubectl, K3s, gVisor, llama.cpp and the model file are downloaded into .out/ (git-ignored) at the versions and checksums pinned in versions.yaml; a checksum mismatch stops the target. The kubeconfig is .out/local/kubeconfig.

What each target does

Target Does
provision orb create ubuntu:noble ail-local. Nothing else
bootstrap In the machine: the K3s binary and its install script, both checksum-verified; runsc, the containerd shim and gvisor-bin; the containerd drop-in; K3s with Traefik, ServiceLB and its bundled Gateway API CRDs disabled and the node labels of the profile. Then the profile's bootstrap steps (namespaces, CRDs, the gVisor RuntimeClass), and llama-server with Qwen3-4B on the Mac, on 127.0.0.1:8080, one slot
deploy The profile's deploy steps in order: charts with helm upgrade --install --wait, manifests with server-side apply. Creates the Secrets the repository deliberately does not hold, with random values, once; they are never printed
verify The checks in the table below
destroy Stops llama-server, deletes the machine and the kubeconfig. Downloads stay in .out/local/cache (AIL_PURGE=1 removes them)

K3s is started without HTTP_PROXY/HTTPS_PROXY: with them it does not come up (compatibility.md, N53). If OrbStack hands the machine a proxy, only containerd gets it, for image pulls.

Optional settings

In the environment or in .env.local at the repository root (git-ignored); the list is profiles/local/env.example. None is needed by default. The ones that matter:

  • AIL_REGISTRIES_YAML: a K3s registries.yaml with pull-through caches or mirrors, installed before K3s starts; its hosts are taken off the proxy. Off by default. No mirror address is committed anywhere in this repository.
  • AIL_MODEL_URL: another place to fetch the model file from. The pinned SHA-256 is checked either way.
  • AIL_SKIP_STEPS: steps to leave out, for a machine short on memory.
  • IMAGE_API_KEY: the image provider's key. Without it the Secret holds a placeholder and nothing calls a paid API.

What make verify checks

Check Passes when
node Ready, and the kubelet is the pinned K3s
pods Every pod is running and ready
gateways inference-gateway and sim-gateway are Programmed
model through gateway A chat completion for qwen3-4b sent to Agentgateway in the cluster is answered by llama-server on the Mac
mcp endpoint auth /mcp without a key answers 401
sandbox OpenSandbox creates a sandbox that matches the selected runtime: with gVisor, its kernel is gVisor's and its pod has RuntimeClass gvisor; with SANDBOX_RUNTIME=runc, no RuntimeClass and the node's kernel (run once with gVisor only)
egress: proxy reachable From that sandbox, http://egress-check.invalid/ through the proxy: 200 from the gateway
egress: refused by gateway Any other host through the proxy: 403 from the gateway
egress: no way around A request that ignores the proxy fails (the NetworkPolicy)
egress refusals counted The gateway's agentgateway_requests_total has a sample for the deny route with status 403
simulated routing sim-gateway answers through the llm-d EPP. Simulated backends, not inference
tracing With TRACING=on: Jaeger holds spans from agentgateway. Otherwise SKIP
powercontext SKIP while it is not deployed (below)

The three egress checks are the ones demo.md, section 10, asks make verify to run. A check that cannot apply is reported as SKIP with the reason, never as PASS.

The demo application

make deploy builds the image from apps/demo with the Docker engine on the Mac, imports it into the machine's containerd and deploys the application and the OpenSandbox MCP server from it. Nothing is pushed to a registry. apps/demo/README.md describes what a job does.

To try it on the Mac itself, forward the gateway's public listener to localhost:

export KUBECONFIG=.out/local/kubeconfig
kubectl -n inference port-forward svc/inference-gateway 18088:8080
kubectl -n demo get secret demo-app -o jsonpath='{.data.presenter-token}' | base64 -d
# big screen:        http://127.0.0.1:18088/screen?token=<token>
# presenter's phone: http://127.0.0.1:18088/?token=<token>

make demo PROFILE=local does the same after a health check and prints the URLs. It reaches nothing beyond the Mac: a public entry is not set up by anything here. Running the show from elsewhere is in runbook.md.

make verify also runs one stage job with a generated test card and reports how it went, including whether the image backend was the stub.

What is not there yet

  • The image step is the stub until credentials are in .env.local. With Azure's three settings it is Azure's gpt-image-2.5-flare (the provider since 2026-11-29); with only a Bailian key it is Alibaba Model Studio. Both edit the photo itself (apps/demo/README.md, "The image step"). Both were run on 2026-11-29 with drawn and synthetic figures; a photo of real people has not been tried. With a provider the key sits in the application, a deliberate and temporary deviation from the design (design.md, section 10).
  • PowerContext is skipped. It has no published image, and building it on arm64 has not been tried. make deploy leaves the step out, and says so, unless the image powercontext-server:1.6.0-seekdb is already in the node's containerd. So there is no memory, and no follow-up job.
  • The camera tool does not exist. The room photo is uploaded from a phone. The gateway's camera tool target has no backend and is skipped.
  • No entry from outside the Mac, and nothing was run over one.
  • make benchmark is still a stub.

Observed

On the owner's Mac Mini (Apple M4, 16 GB, macOS 27.2, OrbStack 2.2.5), 2026-11-28, with TRACING=on, images served by local pull-through caches. The Mac was doing other work and had 26 GB of swap in use throughout, so these are not clean measurements.

One full cycle through make, from an existing machine to a verified stack, then verify three more times:

Stage Time Notes
destroy 22 s
provision 154 s 96 s the first time
bootstrap 34 s Downloads already cached. The first time 111 s, plus 139 s for the 2.5 GB model file
deploy 459 s 383 s of it is the monitoring chart; everything else 76 s
verify 10 to 11 s Two of three runs passed with 12 checks and one SKIP (PowerContext). One run failed a single check on a connection error that did not recur; that helper now retries once. Sandbox creation 5 to 6 s; 24 to 50 s when the node was busy or pulling

Memory, read once with the stack idle and tracing on:

What Figure
Memory requests of all pods 1884 Mi
Memory used by all pods (kubectl top) 1303 Mi
k3s-server resident 1.1 GiB
llama-server resident, right after loading the model 1.9 GiB. Minutes later, idle, macOS had paged almost all of it out. After 12 idle minutes its first answer was slow (4 s to read 100 tokens instead of 0.3 s); the demo application now sends it one short turn every 20 s while a runtime waits for a job
OrbStack as macOS sees it 9.2 to 10 GiB, its ceiling. This includes the other containers on this Mac and the page cache, so it is not the stack's own figure

The model answered a six-token reply through Agentgateway in 0.6 to 4.6 s, the slow figure being the first call after the model had been paged out.

The registries.yaml used pointed at four local pull-through caches. After the run each cache listed the repositories of the images K3s had pulled (docker.io 12, ghcr.io 4, registry.k8s.io 2, quay.io 5). The two cr.agentgateway.dev images have no cache and came through the proxy.

Things that went wrong, and what was changed:

  • Prometheus never scraped the gateway's proxy pods. The Agentgateway chart's PodMonitor looks in its release namespace, and the proxies run in inference, so the request counters the big screen needs did not exist in Prometheus. Fixed with one value, monitoring.proxy.namespaceSelector, in components/agentgateway/values.yaml; it applies to every profile. After it both proxies were scraped.

  • K3s restarted once and eight pods restarted in the first run, when image pulls, the model load and the first sandbox overlapped on a Mac already deep in swap (load average 25 in the machine; the Mac's swap use rose from 26.5 to 29.8 GB). It recovered by itself in about five minutes and verify then passed. Nothing was changed for it. It is what the dedicated-machine warning in deployment-options.md predicts.

  • K3s restarted a second time, and this time the cause was read from its log: its SQLite datastore. 65 Slow SQL lines in ten minutes, then fatal: Transaction commit failed, and systemd restarted it; the demo's entry dropped with it. It happened a few minutes after a fresh deploy while the Mac was swapping at about 70 MB/s. In that state a gVisor sandbox took 30 to over 60 s to start instead of 3 to 5 s, and six of twelve jobs failed at "sandbox". Nothing in the stack was changed for it; the application now tries a slow sandbox once more. Bring the stack up well before it is needed, and on a Mac that is doing nothing else.
  • The first pull of a large image through a cold cache failed (Grafana, a short read; the OpenSandbox execd image, "not found"). Both succeeded on retry. deploy is idempotent: run it again.
  • Creating a sandbox took 24 to 50 s while images were being pulled or the node was busy, and 5 to 6 s on a quiet node; the earlier probe saw about 2 s.
  • Jaeger's query API is at /api/v3/ (and /jaeger/api/), not /api/, with the repository's values.
  • OrbStack's memory ceiling was left at its current 10 GiB. The budget's 6.5 GiB ceiling is a setting for all of OrbStack, shared with other containers on this Mac, so provision reports it and does not change it.