Plan: the off-grid AI stack¶
Preview: needs Artifact Keeper main (coming in 1.12.0)
This walkthrough uses features that are on Artifact Keeper main and not in a release yet:
cache-only Remotes (#5315),
the UPSTREAM_FETCHED audit event (#5316),
with the cold-HEAD probe audited too (#5347),
the switch that pauses scheduled upstream jobs (#5317),
the scanner adapter's offline mode (#5314),
cache seeding (#5333),
the agentplugins Remote (#5334),
config export (#5335) with a
Remote's upstream mode (#5407),
the model-file scanner (#5337),
commit-pinned Hugging Face paths (#5313),
Remotes created with their egress proxy (#5402),
the background MCP sync (#5404)
and the targeted MCP seed (#5408).
They ship in 1.12.0. The reference run used the CI images of main at 88f23c51, pinned by
digest (registry/compose/VERSIONS). Details may still change before the release.
Status: the design this walkthrough was built from, 2026-11-04 and 05, written from the series plan and from reading Artifact Keeper's code and docs before anything ran. It is kept as written. Where the build found it wrong, the correction is in the table at the end and in the lab notes.
Decisions taken before the build¶
- Seed, then disconnect, on one instance. The same Artifact Keeper fills its caches on a
network with a route out, then every container is recreated on an
internal: truenetwork. The two-instance clone (config export, plan, apply) and the low-side/high-side mesh push are described on the Next steps page, not run. Step 2 (seeding) is the one that.akbundleexports (artifact-keeper#2464) could replace once they ship. - The gated agent is a small Python agent: the
openaiclient against llama-server's OpenAI-compatible API, themcpstdio client. Claude Code against llama-server's Anthropic-compatible endpoint is a labelled best-effort step. - The model is Qwen2.5-1.5B-Instruct Q4_K_M GGUF, pinned to a commit;
SMALL_MODEL=1switches to SmolLM2-360M-Instruct GGUF.
Pages¶
index, 1 stand up the registry, 2 seed the stack, 3 vet what you seeded, 4 disconnect, 5 run the agent offline, 6 Claude Code (best-effort), 7 prove nothing leaves, 8 prove it fails safely, results, next steps, reference (seed manifest, make targets), findings, plan.
Lab¶
- The stock compose file byte for byte, plus
compose.override.yml(prefixak-offgrid, subnet172.31.84.0/24, Caddytls internalon127.0.0.1:30450, theak.internalalias) andcompose.site.yml, which replaces the default network withak-offgrid-site(172.31.85.0/24,internal: true). - The egress ledger: a logging forward proxy, set as every Remote's egress proxy
(
backend/src/services/egress_proxy.rs,PUT .../egress-proxy, modeexplicit). seed/manifest.tomlandseed/seed.shproduceout/inventory/seed.tsv; the same script on the site producessite.tsv.- llama-server comes from an Artifact Keeper-proxied ghcr.io image; the model from a Hugging Face Remote, published to a vetted Local where the model-file scanner reads it.
agent/agent.pyuses theopenaiandmcppackages; its MCP coordinates come from/mcp/mcp-all/v0.1/servers; its plugin from the agentplugins Remote.- Claude Code installs the same plugin from Artifact Keeper.
- e2e registration: prefix
ak-offgrid, port 30450, networks172.31.84.0/24(seed) and172.31.85.0/24(site, internal),disk_gb60,timeout_all7200.
Artifact Keeper features to use¶
| Feature | Pull request | Used for |
|---|---|---|
| Cache-only mode for Remotes | #5315 | every Remote at the disconnect; a clean 404 on a miss |
UPSTREAM_FETCHED audit event |
#5316 | the record of the seed window, and its silence after (G7d) |
| Pause scheduled upstream jobs | #5317 | MCP Remote sync and the rest, at the disconnect |
| Scanner adapter offline mode, vulnerability-DB import | #5314 | the adapter on the site, with a DB carried through the registry |
| Seed a Remote's cache from a path list | #5333 | the model, at its commit |
| agentplugins Remote of another Artifact Keeper | #5334 | the site's plugin marketplace |
| Config export, plan, apply | #5335 | the site's configuration of record; the two-instance clone |
| Model-file scanner | #5337 | the GGUF, and two files that must not get through |
| Commit-pinned Hugging Face paths immutable | #5313 | the seeded model never revalidates |
| The air-gapped guide | #5312 | the checklist the gates follow |
| MCP registry, Hugging Face hosting | #5257, #5300 | the MCP servers, the vetted model |
Gates¶
| Gate | What it checks |
|---|---|
| G1 seed | Every manifest item served with a digest; the cache-seed job completed; every Remote's egress is the ledger; the ledger and the UPSTREAM_FETCHED rows list the same upstreams. |
| G2 vet | The model-file scanner scanned the GGUF clean and it is served; a truncated GGUF and an os.system pickle are flagged and refused; the scanner adapter imports a DB offline and scans an image; the config export plans clean. |
| G3 disconnect | Every Remote cache-only; jobs paused; every container on the internal network only; the export records the offline posture. |
| G4 agent | On the site: the image, the model and every package come from Artifact Keeper at their seeded digests; the plugin is verified; the MCP servers are registry-listed; the model answers through a tool call. |
| G5 Claude Code | Best-effort: the plugin installs offline; one prompt through the local model. |
| G6 fails safely | Unseeded content is a fast 404 counted as cache_only_miss; an unapproved MCP server is not served; a manual MCP sync sends nothing; the agent refuses an unlisted server; no route out from the agent. |
| G7 zero egress | G7a no route out from every container; G7b the ledger is unchanged; G7c cache-hit metrics; G7d no UPSTREAM_FETCHED / MCP sync rows after the disconnect; G7e the inventory diff; plus a control. |
What the build changed¶
| Plan | What running it showed |
|---|---|
bootstrap.sh creates the Remotes, then sets their egress proxy and offline settings |
An MCP Remote started syncing the moment it was created, before its egress proxy applied (#5402). The debug runs paused the upstream jobs around the creates; since #5406 every Remote is created with egress_proxy in the create body, and mcp-official with mcp_remote_sync_paused (F1). |
mcp-official is synced from the official registry, then the public server is pinned |
The registry is 2,218 pages and 221,769 entries, io.github.daedalus/mcp-sqlite3 is on page 1,093, a pass reads 200 pages, and a manual pass is cut off at 120 s (#5404). Ten passes never reached the name. The seed uses a targeted seed of one name and version instead (#5408, fixed by #5409; F2, F3), and mcp-official never syncs. |
The plugins Remote proxies this instance as http://backend:8080 |
backend is on the backend's upstream hostname blocklist; the Remote uses the alias ak-central (B1). |
| The backend at a low fixed address | .10 collided with podman's dynamic allocation; the backend is .250 (B3). |
The disconnect recreates the running containers on ak-offgrid-site |
With podman they lose their service DNS aliases and the backend cannot find postgres; the stack is taken down and brought up again (B2). |
| The disconnect: cache-only, then pause the jobs | A sync running at the cut wrote its MCP_MIRROR_SYNCED row after the marks. Pause first and wait for the running sync (B14). |
| G7b and G7d filter out earlier control windows | On a first gate run the filter's input was not valid JSON and the two checks passed without counting. G7 now prints the raw count next to the filtered one and fails closed when it cannot read the windows or the rows (B16). |
| G3: the export records the offline posture | Config export had no upstream_mode (#5407) and G3 reported it BLOCKED(ak-gap); fixed by #5415, and G3 passes (F4). |
| G6: a manual MCP sync sends nothing | It is refused with 409 while the upstream jobs are paused; a first version of the check expected 202 and failed on the 409 (findings). G6 also refuses a targeted MCP seed with 409, and checks that cold HEADs open no ledger connection and write no UPSTREAM_FETCHED row (#5347, fixed by #5414; F5). |
| G7c: cache hits only | A cache-only miss is counted both as miss and as cache_only_miss; the check is miss <= cache_only_miss per Remote (B11). |
| The ledger logs each tunnel | It logged a tunnel only when it closed; it now writes an open line before connecting and a close line after (B12). |
seed/seed.sh writes out/inventory/seed.tsv |
flows/vet.sh writes it, once the vetted model is in hf-models. |
| Acme's wheel is deterministic | Only stored uncompressed: deflate output differed between zlib builds (B6). |
Acme's server on mcp's FastMCP |
mcp 2.x calls it MCPServer (mcp.server.mcpserver) and a tool's schema input_schema (B7). |
| The agent's packages make no outside calls of their own | fastmcp checks pypi.org for updates when it shows its banner; the agent image turns that off (B8). |
| G5: one prompt through Claude Code's normal session | With its full harness the 1.5B model echoed its prompt after about 300 s; the gated session uses a minimal system prompt and no tools, and answers in 3 s (B9). |
SMALL_MODEL=1 is SmolLM2-360M-Instruct |
It made no tool call and invented a number (1000 units). SMALL_MODEL=1 is Qwen2.5-0.5B-Instruct (491 MB), which calls the tool and answers 42 but does not quote the tool's ref, so G4 gates on the ref only for the default model (B10). |
The :dev images of main |
The CI :dev image was stale while the walkthrough was built (the CI amd64 builds were failing), so the debug runs used local builds of main at 0bffa44c. The reference run uses the CI images of main at 88f23c51, pinned by digest, and every other image is pinned by digest too. |