# Getting started The only product build is `./modelos build`. The current integration needs the prepared inputs below; it is not yet a clean-machine GPU bootstrap. The old bootstrap and image CLIs are historical and do not qualify this image. Public unit dependencies can be prepared with `./modelos capture environment --unit` in a fresh Ubuntu 24.04 root container with Python 3. Full `./modelos capture environment` acquires public source inputs and verifies/restores the canonical hash cache; missing capture products remain explicit blockers. See the [environment inventory and qualification](environment.md). ## Host and local inputs Use Linux x86-64 with Rust 1.98.1 plus rust-src, the x86_64-unknown-none target, Clang/LLVM 19, LLD, make/binutils, flex, bison, bc, libelf/libssl development headers and Python. VM suites need QEMU/KVM, OVMF, dosfstools, mtools, tap and vhost-net access. GPU suites additionally need the frozen VFIO devices and the shared GPU lock. Do not change the [evaluation setup](osdi/plan.md) or baseline tuning. The current prepared integration uses: - The one Linux-derived source tree at `/workspaces/modelos/sources/linux`, fetched from `kernels/capture/environment/sources.env` when absent. Override it with `--linux-source` or `MODELOS_LINUX_SOURCE`; an explicit checkout must be clean and match the pin. - Toolchain roots `/workspaces/serve/toolchain/usr` and `/workspaces/trim/toolchain/usr`; these are integration inputs, not portable defaults. - `kernels/capture/image/inputs.json` pins the paired captured bootstrap, state/family headers and original program payload under `/workspaces/modelos/assets/qwen3-0.6b-dual-path-r1`, beside the semantic native model input. The producer reserves actual 4 GiB VRAM and 32 GiB VA resources; no free-looking range is inferred. Both GPU paths live in the one disk and share Request KV banks. The frozen control and its rebuild sources remain pinned separately. - The same input manifest pins the native acceptance bundle at `/workspaces/modelos/assets/native-kernels-r1`; the open CUDA fixture is in `serve/gpu-native/tests/`. The build links the native loader and generates fixture data for this same image. Native checks run before HTTP when a GPU exists; failure retains mappings/channel ownership and stops that guest. A `native_gpu` receipt flag describes linked capability, not a passing test. No captured GPU bytes or per-run evidence are committed. - Tokenizer `/workspaces/models/qwen3-0.6b/hf/tokenizer.json`, independent text/ID oracle `/workspaces/hw/eval-image/text-reference.json`, and the pinned Rust/WABT/native compiler inputs. The build compiles `serve/cpu-text` from current sources and records source, tool and object paths; it does not copy a frozen AOT object from another lane. Canonical asset packaging and portable source acquisition remain integration work. A missing asset is a build error; do not substitute another lane's latest mutable capture. Licensed firmware/cuBLAS and model weights must be supplied locally under their own terms. Ordinary Linux/CUDA performs offline capture; RM is absent from the resulting service image. ## Build and tests ```sh ./modelos build --out /workspaces/modelos/build ./modelos test unit ./modelos test cpu --wait ./modelos test gpu ./modelos test perf --config /path/to/perf.json ``` A successful build writes `build-done.json` in the output directory with kernel path, disk, repository commit and Linux commit. The kernel is `/workspaces/modelos/build/arch/x86/boot/bzImage`; its paired disk is `/workspaces/modelos/images/.raw`, named in the manifest. Build output `image.raw` is a symlink, not another copy. Submission stages the same EFI-stub bzImage and Image on a GPT disk with an ESP. OVMF boots it from emulated NVMe; the polled NVMe reader loads the Image, without `-kernel` or QEMU loader injection. See [firmware boot and acceptance](../kernels/capture/image/README.md). `--code-only` currently reuses the existing disk only after segment, placement, arena and CRC checks match. A stale or corrupt disk is rejected; there is no independent image/profile. The CPU suite boots the same kernel/disk without passthrough, then checks complete text HTTP/SSE over TCP against a recorded fixture. It does not execute model arithmetic. The GPU suite checks independent token IDs and final text. The unified test suites use `eval/guest.py`; every GPU guest holds `/workspaces/gpu.lock`. CPU absence tests never probe or reserve the GPU. VM suites print `/workspaces/modelos/jobs/NAME/done.json`, the success/failure marker. Use `--wait` for foreground CPU CI. Raw per-run logs stay outside Git. The owner chooses a qualified captured program for each Step and uses native launches otherwise. For paired tests, `POST /modelos_gpu_path/auto`, `/modelos_gpu_path/captured` or `/modelos_gpu_path/native` selects that policy at a completion fence. The GPU suite checks both forced paths with the same gates; perf rows identify `gpu_path` for both paths when using this build. Captured forcing rejects shapes without a qualified program. The unified suites and CI use the [test plan](test-plan.md): hosted unit checks, local CPU validation after each push, and explicit manifests for GPU capabilities or perf. CPU inputs still require the prepared Workspace; no self-hosted runner is registered. Before M5 all measurements are diagnostic; `perf` is not evidence of a qualified final plan table. Read [the current diagnostic boundaries](proposals/one-system-merge.md) before interpreting a number. Baseline SGLang/vLLM/TensorRT-LLM/Strata harnesses remain stock-Linux controls, not alternate ModelOS images. Historical production, engine and native-image launchers now live under `experiments/pre-one-system/`; use the shared test/perf commands above for new runs. Frozen stock-Linux baseline workers and their preparation settings stay unchanged. Rebuilding the pinned old GPU comparator requires its recorded original revision and prepared inputs; the archive preserves that source. The canonical build takes the semantic model/kernel manifest and the paired bootstrap manifest named in `kernels/capture/image/inputs.json`. It validates ELF entries, object extents, tensor shapes, numerical configuration and the reserved handoff arenas. Captured and native programs coexist in this Image and are selected per Step. The fixed input paths and producing Git commits identify each generation. Public acquisition of all local bootstrap/fixture bytes is still required for a clean-machine build; CPU acceptance remains a local post-push requirement until those inputs are available to hosted CI. Submissions reference producer-declared immutable inputs at their fixed paths. For an existing immutable perf file/tree, its `artifacts` entry declares `"immutable": true`; the producer keeps it unchanged while queued or running. Guests receive read-only input devices/shares and source permissions are preserved. Small mutable inputs retain independent copies. Files of 1 GiB or more require an immutable declaration or a real reflink; the runner rejects a physical-copy fallback. Offload reference preparation offers the same producer promise as `--immutable-disk`, using a pack on the Workspace NVMe volume. Every terminal job removes only its own submission directory. Cleanup receipts separate logical bytes removed from exclusive allocated blocks; referenced original inputs remain owned by their producer. `./modelos test cpu` also checks the same kernel with a separate read-only virtio timing input and the existing NVMe boot/metadata adapter. The Image loader uses that adapter when the first medium has no MOSGPU01 signature; a recognized Image with bad CRC/geometry still fails. The probe repeats full CPU fixture acceptance and verifies that the timing bytes stay unchanged. This is an input selection diagnostic, not model arithmetic or another performance setup. Frozen control audit manifests use `engine: "modelos-control"` with the existing pinned control payload/disk and the same ModelOS corpus/oracle. The default `modelos` engine uses the canonical UEFI/NVMe build. ## Owner control The same HTTP owner serves management requests; no management worker or service is started. With a running guest, use the one entry point: ```sh ./modelos control stats --url http://10.0.2.15:8000 ./modelos control drain --url http://10.0.2.15:8000 ./modelos control unload --url http://10.0.2.15:8000 ./modelos control load --url http://10.0.2.15:8000 ``` These call `GET /modelos/control/stats` and `POST /modelos/control/{drain,unload,load}`. Drain closes admission with HTTP 503 and finishes admitted streams, including output backpressure, before `drained` becomes true. Unload also waits for the text Op, retires the Instance and releases its resident model Image. HTTP 202 means the operation continues in the owner; read stats until the model state is `drained`, `unloaded` or `ready`. Load requires a fully unloaded model, drives the disk Image Move/CRC and the existing native restore, then opens admission. A failed Move/restore keeps admission closed and reports `failed`; recovery is explicit, with no automatic reuse of uncertain objects. Stats are lifetime counters across reloads. `queued` and `running` partition admitted live Requests; running includes fenced output awaiting stream release. Token input counts admitted prompts and output counts committed emitted IDs. Object byte arrays follow `object_kinds` in each tier and describe the shared object table, including system and Image objects. Step buckets are disjoint owner-observed post-round to completion intervals, reusing the loop clock; the last bucket has no upper bound. Polling a stats snapshot adds no timer. Core roles identify the owner, text helper and other CPU workers; worker idle means its last mailbox Op has fenced. The CPU suite checks fixture traffic/drain/reload; the GPU suite checks native retirement and fresh Image restore against the original-worker token/text gate.