Snapshot ingest runtimes¶
A model served from your bucket needs its weights in that bucket first. When the control plane's ingest plan says a snapshot must be fetched, the node streams it from the model source straight into your bucket, file by file, with a checkpoint after each file so an interrupted ingest resumes where it stopped. It then writes a manifest of what it stored, reads the snapshot back from the bucket, and verifies it against that manifest before the model can use it. When the plan says the snapshot already exists, the node verifies it the same way and fetches nothing. This page covers the shared ingest lifecycle, the Hugging Face and Ollama readers, the manifest, and the evidence.
For the plan, see Snapshot ingest planning.
One ingest¶
flowchart TB
subgraph PLAN["FROM THE SERVE ASSIGNMENT"]
direction LR
MC[("materialization contract<br/>source, revision, runtime path")]
SP[("snapshot_ingest_plan<br/>transfer policy,<br/>target bucket operation")]
end
subgraph NODE["NODE"]
direction TB
SEL{{"Select reader and writer<br/>source family, delivery mode"}}
RD["Source reader<br/>hf_reader or ollama_reader"]
CK[("Checkpoint<br/>object, size, SHA-256")]
WR["Delivery writer<br/>bucket_writer"]
MF["Finalize manifest"]
VF{{"Read back and verify"}}
SEL --> RD --> WR
WR --> CK
CK -.->|"resume"| RD
WR --> MF --> VF
end
SRC[("Model source<br/>Hugging Face Hub, Ollama registry")]
BKT[("Your bucket")]
EV[("model.snapshot_ingest_runtime_evidence.v1")]
MC --> SEL
SP --> SEL
SRC ==>|"stream"| RD
WR ==>|"put"| BKT
BKT ==>|"download"| VF
VF --> EV
The bytes flow from the source through the node into your bucket without landing on the node's disk; each file is hashed as it streams. Verification reads the stored snapshot back, so a snapshot counts as ingested only when the bucket holds exactly what the manifest says.
Readers and writers¶
The node picks a source reader from the source family and a delivery writer from the delivery mode:
| Source family | Reader |
|---|---|
hf |
hf_reader |
ollama |
ollama_reader |
| Delivery mode | Writer |
|---|---|
bucket |
bucket_writer |
pvc |
pvc_writer |
The delivery mode comes from the plan, or from the runtime path when the plan
leaves it out. A source family with no reader, or a delivery mode with no
writer, fails with MODEL_SNAPSHOT_INGEST_RUNTIME_UNSUPPORTED. A snapshot for
the pvc lane is written by the stage job; see
Serve materialization and contract projection.
The transfer policy¶
The plan carries a transfer policy, model.snapshot_ingest_transfer_policy.v1:
| Field | Governs |
|---|---|
profile_id |
The named transfer profile |
ingest_required |
Whether a fetch is needed or the snapshot is reused |
expected_bytes_total |
The snapshot's expected size |
timeout_seconds |
The time allowed |
retry_max_attempts |
Attempts, at least 1 |
retry_initial_backoff_seconds, retry_max_backoff_seconds |
Backoff between attempts |
max_parallel_files |
Files transferred at once |
stream_chunk_bytes, multipart_threshold_bytes |
How large files are uploaded |
verify_mode |
strict |
Attempts, checkpoints and resume¶
flowchart TB
A["Attempt n"]
UP["Upload next object"]
CP[("Checkpoint the object<br/>key, size, SHA-256")]
DONE(["All objects stored"])
F{{"Failure"}}
BO["Back off<br/>initial x 2^(n-1), capped"]
EX(["retry_exhausted"])
A --> UP --> CP --> UP
CP --> DONE
UP -.-> F
F -->|"attempts left"| BO --> A
F -->|"none left"| EX
After each object is stored the node records it in the checkpoint with its size
and SHA-256. The next attempt skips every object already in the checkpoint and
resumes with the rest, so a large snapshot interrupted near the end costs only
what was left. Backoff doubles from retry_initial_backoff_seconds up to
retry_max_backoff_seconds. A checkpoint belongs to one snapshot digest; an
object reported under a different digest is refused.
An ingest that does not complete reports one failure reason:
| Reason | Means |
|---|---|
timeout |
The transfer did not complete in time |
partial_upload |
Fewer bytes were stored than the source declared |
digest_mismatch |
The stored snapshot does not match its manifest |
retry_exhausted |
Every attempt failed |
digest_mismatch describes a transfer that finished with the wrong bytes, and
the snapshot is never accepted. The other three describe a transfer that did
not finish.
The Hugging Face reader¶
| Runtime paths | hf_direct_staged_bucket, hf_bucket_staged_bucket |
| Source paths | hf_hub (fetch from the Hub), hf_bucket (a snapshot already in your bucket) |
| Source | source_uri, source_revision, resolved_revision_digest |
| Credential | The source_auth slot, for a gated or private repository |
With ingest_required, the reader lists the repository's files at the pinned
revision and streams each one into the bucket, then writes
model.hf_snapshot_manifest.v1:
contract_version model.hf_snapshot_manifest.v1
snapshot_digest from the plan
source_uri, source_revision
resolved_revision_digest the commit the revision resolved to
object_manifest_digest digest over every stored file's path, size and SHA-256
file_count, byte_count
manifest_digest SHA-256 of the manifest itself
Verification downloads the snapshot, recomputes the object manifest digest from
the files present, and requires it to equal the manifest's, and the manifest's
snapshot digest to equal the plan's. The ingest state is then ingested. With
the snapshot already in the bucket, the reader runs the same verification and
reports ready.
The Ollama reader¶
| Runtime paths | ollama_direct_staged_bucket, ollama_bucket_staged_bucket |
| Source paths | ollama_catalog, ollama_image, ollama_bucket |
| Registry | https://registry.ollama.ai |
| Credential | The source_auth slot, or a bearer token from the registry's challenge |
An Ollama model is an OCI artifact. The reader resolves the model reference to
a repository and a tag, library/<name> and latest when they are omitted,
and reads it the way an OCI client does:
GET /v2/<repository>/manifests/<tag>, accepting OCI and Docker manifests and indexes. For an index it takes the first manifest.- When the registry answers with a
WWW-Authenticatechallenge, it obtains a bearer token from the named realm and repeats the request. - For the config and each layer,
GET /v2/<repository>/blobs/<digest>, streamed into the bucket asblobs/<digest>for the config andblobs/<index>-<digest>for each layer, in order.
Each blob's streamed byte count must equal the registry's Content-Length;
a short blob is a partial_upload. The manifest,
model.ollama_snapshot_manifest.v1, lists every stored file with its path, size
and SHA-256, alongside the snapshot digest, the source and the model reference.
Verification reads the snapshot back and checks each file against it.
The evidence¶
The ingest reports model.snapshot_ingest_runtime_evidence.v1:
| Field | Holds |
|---|---|
source_reader_id, delivery_writer_id, delivery_mode |
Which reader and writer ran |
runtime_path_id, source_family, source_path, source_uri |
What was ingested |
ingest_required, ingest_handler_id, ingest_state |
ingested after a fetch, ready for a reused snapshot |
staged_ref |
bucket://<provider>/<bucket>/<prefix> |
manifest_digest, snapshot_digest |
The verified manifest and snapshot |
bytes_total, bytes_transferred, files_total, files_transferred |
Size and progress |
throughput_bps, duration_ms |
Speed and time |
attempt, resume_offset |
The attempt that succeeded and the bytes it resumed after |
failure_reason |
One of the four reasons, empty on success |
transfer_policy |
The policy applied |
The staged reference and the two digests become the weights lane's evidence, which the readiness gate and the trace chain check. See Serve observation and evidence.
| Code | Condition |
|---|---|
MODEL_SNAPSHOT_INGEST_RUNTIME_UNSUPPORTED |
No reader or writer for the source or delivery |
MODEL_SNAPSHOT_INGEST_RUNTIME_INVALID |
Evidence or checkpoint is inconsistent, or retries are exhausted |
MODEL_HF_SNAPSHOT_INGEST_RUNTIME_* |
The Hugging Face reader refused the contract or failed to fetch or verify |
MODEL_OLLAMA_SNAPSHOT_INGEST_RUNTIME_* |
The Ollama reader refused the contract or failed to fetch or verify |
Airgapped ingest¶
Under an airgapped posture the node has no route to a public model source, so the plan gives it a snapshot already in your bucket to verify and reuse. See Airgapped execution runtime.