Shipping Multi-GB Model Artifacts to a Large Edge Fleet
System DesignModel answerLast updated
Design a secure, resumable pipeline that delivers 0.5–50 GB model bundles from a central registry to over 10,000 edge nodes, with staged rollouts, rollback, and fleet-wide monitoring.
You operate a central model registry whose storage layer is an object store such as S3. A fleet of 10,000+ edge inference nodes spread over several geographic clusters must receive new model bundles (weights, configuration files, tokenizers) from it. Bundles are 500 MB to 50 GB. Nodes differ in disk and GPU capacity, and some of them lose connectivity for hours at a time.
Design the system that gets these bundles onto the fleet and makes them live.
Requirements
- Efficiency: keep deployment latency and bandwidth cost low, including for nodes with flaky links.
- Integrity and security: published artifacts must be immutable and authenticated, and every node must verify them before loading.
- Versioning: support atomic rollouts, rollbacks, and A/B tests of different model versions across clusters.
- Observability: show download progress, success and failure rates, and storage usage across the fleet.
Constraints
- Node storage is limited, so you need a caching and eviction policy.
- The registry's backing store is an object store.
What to deliver
- A high-level architecture (component diagram or flow).
- An API for the on-node agent to discover updates and fetch artifacts.
- A strategy for partial downloads and network failures.
- A metadata store design for model versions and deployment manifests.
State your assumptions about scale, and discuss the main trade-offs.
Hints
Hint 1
Start with the arithmetic: 10,000 nodes times a 50 GB model is about 500 TB if every node pulls from the origin. What does that imply about where the bytes should come from?
Hint 2
Split the work into two phases: getting bytes onto disk ahead of time (staging) and switching the serving model (activation). Which of the two needs to be atomic, and which can be slow and eventually consistent?
Hint 3
Break files into content-addressed chunks and describe them in a signed manifest. Think about how that one idea gives you resumability, deduplication across versions, immutability, and verification.
Hint 4
Decide between push and pull for control. Consider what happens to a node that was offline during the rollout.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Scale and assumptions
- 10,000 nodes in roughly 10-20 clusters, with mixed disk and GPU sizes.
- A naive full rollout of a 50 GB model is 10,000 x 50 GB = 500 TB of origin egress. At about $0.05-0.09/GB that is $25k-45k per rollout, and it would saturate the origin. The design goal is to cut origin traffic to about one copy per region (about 1 TB for 20 regions).
- A few releases per week, plus canaries and A/B experiments.
- Delivery may be eventually consistent. Activation must be atomic per node and controllable per cluster.
The hard parts are fan-out, resumability, integrity, and safe activation. The registry itself is simple.
2. Architecture
Publisher CI -> Registry API -> Object store (chunks keyed by SHA-256)
|
Metadata store (Postgres) <- Rollout controller <- fleet health metrics
|
Control-plane API <--- node agents poll
Node agent fetch order: local CAS -> same-cluster peers -> regional cache/CDN -> origin
Publish path
- CI splits each file into fixed-size chunks (about 64 MB; a 50 GB model is about 800 chunks).
- Each chunk is hashed with SHA-256 and stored under its hash. Content addressing makes chunks immutable and deduplicated, so a fine-tune that touches a few layers uploads only the changed chunks.
- CI writes a manifest: files, chunk hashes and sizes, and requirements (minimum GPU memory, disk, runtime version).
- The manifest is signed with a KMS-held key. The manifest hash is the version ID.
Delivery path: local cache first, then peers in the cluster (BitTorrent-style or a Dragonfly/Kraken-like tracker), then a regional pull-through cache or CDN, with the object store as the last resort. Origin egress falls to about one copy per region, and peer traffic stays within the rack or cluster.
Pull, not push. Agents reconcile toward a desired state by polling every 30-60 s with jitter. A node that was offline simply converges when it returns. The control plane stays stateless, and 10k nodes polling every 30 s is only about 330 QPS of cheap requests. An optional push nudge may reduce latency, but correctness must not depend on it.
3. Agent API
GET /v1/nodes/{id}/desired-state (If-None-Match -> 304 or 200)
-> deployments: [{slot, manifest_id, previous}], prefetch: [manifest_id], etag
GET /v1/manifests/{manifest_id}
-> files/chunks, requirements, signature, signing_key_id
GET /v1/chunks/{sha256} (Range supported; served by CDN, peer, or object store)
POST /v1/nodes/{id}/status
-> inventory, active manifest, per-download progress and errors, disk_free, gpu_mem, health
The status call doubles as heartbeat and observability feed. prefetch entries are staged but not activated.
4. Partial downloads and failures
- Chunk-level resume. Write to
staging/<hash>.part, resume within a chunk using HTTPRange, verify the SHA-256 on completion, then atomically rename into the content-addressed store (CAS). Only verified chunks live in the CAS, so a crash never corrupts state. After a restart the agent fetches only the chunks it lacks. - Retries. Exponential backoff with jitter, source failover (peer, cache, origin), and a circuit breaker for bad peers. A hash mismatch marks the source bad and triggers a refetch elsewhere.
- Parallelism and fairness. Fetch 8-16 chunks concurrently, with a bandwidth cap so inference traffic is not starved.
- Verify before load. Check the manifest signature against a pinned root key, then every chunk hash. Nothing loads until the whole manifest verifies.
- Staging vs. activation. Download ahead of time as prefetch. Activation is a quick atomic symlink swap (
models/primary -> versions/<id>) followed by hot reload or drain-and-restart. Rollback is the same swap back to the retained previous version, so it takes seconds. - Cache and eviction. Reference-count chunks by the manifests that use them. Pin the active and previous versions. Evict prefetched-but-unused versions last among the unpinned ones, and evict the rest LRU by manifest. Shared chunks survive while any retained manifest references them. Before starting, require
disk_free >= manifest_size - already_cached + headroom, otherwise reportINSUFFICIENT_DISKrather than fail midway.
5. Metadata store
Use a strongly consistent store (Postgres), since rollout decisions need transactions. The data is small: thousands of versions and about 10k node rows.
artifacts(manifest_id PK, model_name, semver, created_at, signer, size_bytes,
requirements JSONB, status[active|yanked])
manifest_chunks(manifest_id, sha256) -- for garbage collecting the object store
channels(channel PK, model_name)
releases(id, channel, cluster, manifest_id, traffic_pct, cohort_selector,
state[canary|rolling|done|rolled_back], created_at, created_by) -- append-only
nodes(node_id PK, cluster, hw_class, labels, last_seen, active_manifest,
inventory JSONB, disk_free)
Desired state is resolved as channel x cluster x cohort -> manifest. A/B arms use a stable hash, hash(node_id) % 100 < traffic_pct, so nodes keep their arm as the percentage grows. Because releases are append-only, the table is also the audit log. Hardware requirements in the manifest keep a node from being assigned a model it cannot hold.
Rollout waves: 1% canary, one cluster, 25%, 100%. The controller advances only if SLOs hold (error rate, p99 latency, OOMs, eval probes) and rolls back automatically otherwise.
6. Observability
Agents report the status payload plus metrics: bytes by source (peer, cache, origin), cache hit ratio, chunk failures and hash mismatches, time-to-ready per version, and disk utilization. Dashboards should show rollout convergence (staged vs. active percentage per cluster), failure reasons, stuck or offline nodes, and disk pressure. Alert on convergence stalls, spikes in hash mismatches, and falling peer-hit ratios.
7. Trade-offs and common mistakes
- P2P vs. regional caches only: P2P saves more origin and cross-rack bandwidth but adds a tracker and complexity. Regional caches alone are simpler and often enough for smaller fleets.
- Chunk size: small chunks give better dedup and finer resume but a bigger manifest and more requests; 32-128 MB is a reasonable range.
- Push-only control fails for offline nodes. Pull with reconciliation is more robust.
- Verifying only at download time is a mistake. Re-verify the signature and hashes before load, or protect the CAS from tampering.
- Activating on download completion couples delivery to serving. Keep them separate so rollouts can be staged in advance and flipped quickly.
- Forgetting to pin the previous version makes rollback require a fresh 50 GB download exactly when it is most urgent.
- Thundering herd: add jitter to polling and rate-limit origin access, or a new release can overload the control plane and object store.