﻿# Resume a model artifact with a validated byte range

Append a resumed range only after validating its position and representation identity.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-http-range-artifact/
Language: en

A large weight file stops downloading near completion. Resuming from the local byte count looks straightforward, but a correct resume must establish that the remaining bytes belong to the same representation. Appending a complete replacement response or a range from a newer revision can produce a file of plausible size that fails only when the model loader reads it.

## Establish the existing prefix

Keep the local partial file separate from the published artifact. Record its byte length and a trustworthy identity for the remote representation, such as a suitable validator or a pinned object version. The local filename is insufficient evidence. If the downloader transparently decompresses content, its stored-byte offset may not correspond to the selected encoded representation. Resolve that transformation before constructing a byte range.

## Inspect the response before appending

A range request expresses a desired interval; it does not force the server to return a partial response. Validate the returned status and range metadata. A full response must replace or restart the partial download rather than be appended to it. A partial response needs to start at the expected position and describe a compatible total length when available. Reject inconsistent intervals instead of attempting to repair them by guessing where useful bytes begin.

## Bind continuation to one revision

Use a documented conditional range mechanism when the endpoint supports it. A revision mismatch should lead to a full restart or another explicit recovery path, not to mixing old and new content. Immutable artifact addresses simplify the reasoning, but verify what the storage service actually guarantees. A friendly model revision name may still point to mutable files unless the manifest pins concrete object identities or hashes.

## Handle the completed-file edge case

If the local prefix already equals the representation length, a requested continuation can be unsatisfiable even though the local artifact may be complete. Check the authoritative metadata and verify integrity before deciding to restart. Conversely, matching length alone cannot establish correctness. A damaged byte or mixed revision can preserve total size. Retain the expected checksum algorithm and value from a trusted manifest, not from the same unverified partial file.

A downloader that opens the active weight path before verification can expose partial data to a concurrent model reload. Keep temporary and published paths distinguishable in both logs and permissions. The resume test should include an observing worker that can see only the previously verified revision until publication completes.

## Publish only after verification

Write into a temporary location, validate the complete artifact and then expose it to model workers using the storage system's supported publication mechanism. Keep interrupted or rejected continuations out of the active model path. Test a server that honors ranges, one that ignores them and one whose object changes between attempts. Acceptance means those cases never create a silently mixed artifact. Resume support reduces repeated transfer in favorable conditions; it does not eliminate the need for a complete manifest or post-download integrity verification.

## Primary references

[HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html). Defines byte ranges, partial responses and conditional range retrieval.

[Digest Fields](https://www.rfc-editor.org/rfc/rfc9530.html). Defines integrity fields and their scope for downloaded content.

[HTTP/1.1](https://www.rfc-editor.org/rfc/rfc9112.html). Explains complete message framing before a received range is accepted.

Related reading: [Init container downloads an artifact again: making preparation idempotent](/journal/kubernetes-init-artifact-download/); [NVMe for model serving: where a faster disk changes results](/journal/nvme-for-model-serving/).
