Skip to content
Model Sharding

06. Model Sharding

Encrypted round trips and numerical compilation verified

The offline compiler reads config.json plus model.safetensors or its index, detects layer structure, partitions contiguous stages, applies verified dense/MoE transformations, and separates the client embedding/LM-head boundary. It rejects unsupported layouts instead of silently copying them.

Versioned artifacts

A .xurcroh file contains an 8-byte magic, format version, bounded canonical JSON header, 96-bit nonce, and ChaCha20-Poly1305 ciphertext. Header and prefix are authenticated associated data. Decryption additionally checks the plaintext digest. Per-stage DEKs are wrapped independently and never stored in the manifest as plaintext.

SecureShardLoader requires the correct key and stage metadata, decrypts into page-locked mutable RAM, loads safetensors from bytes, then wipes/unlocks the buffer and zeroes CPU tensors. Wrong keys, modified ciphertext, truncation, missing files, and unexpected stages fail closed. verify_manifest validates artifact hashes, common checkpoint identity, and complete layer coverage.

VerityPackager provides real EROFS/dm-verity command automation. It does not imply runtime integrity; that requires separate workload checks and hardware validation. See the developer reference and thin-client boundary.

Quantized checkpoint ingestion

The format-neutral reader supports Safetensors, GGUF v1–v3, EXL2/GPTQ, and EXL3 on the trusted compiler. GGUF handling covers all 37 current type codes, shard manifests, metadata arrays, embedded Hugging Face tokenizers, and little-/big-endian quantized blocks. EXL2 reconstruction handles mixed row bitrates, activation ordering, packed scales and padding; EXL3 handles integer/fractional trellis rates, 3INST/MCG/MUL1 codebooks, and Hadamard/sign restoration. Source reconstruction is followed by independent Fortress quantization, so exact quantized-reference equality and source-model quality error are separate measurements.

Canonical architecture adapters map GGUF physical names, fused QKV, and stacked experts into logical Fortress operations without decoding weights during shape discovery. GGUF is a container, not a computation graph: unknown future architectures or unexplained tensors fail closed with a CapabilityError rather than being guessed. Public SDK registration selects Fortress automatically for these formats and rejects incompatible plaintext engine overrides. See the quantized format laboratory.

Fortress role packages

Fortress uses a separate role-artifact format for the additive share grid. A seeded compilation uses HKDF-SHA256 domains for the operation, share index, basis purpose, and epoch. The xurcroh-fortress-role-v2 artifact contains a non-final share’s seed and matrix shape; the worker expands its own matrix with ChaCha20. The final share remains a full xurcroh-fortress-role-v1 AONT-RS artifact because it depends on the quantized weight and every preceding share. Seed-expanded shares provide computational obfuscation, not information-theoretic security.

During deployment, the compiler writes each operation’s role artifacts immediately and then discards worker matrices and dispersal bundles. The no-retention compilation mode also discards quantized weight values while retaining tensor descriptors, client-only signed permutations, and Freivalds challenge vectors. Reference arithmetic rejects descriptor-only operations when materialized values are required; that failure is explicit rather than silently weakening verification. An official Qwen3-0.6B compile with neither worker matrices nor quantized values retained completed in 108.79 seconds with 3,011,548 KiB maximum RSS on the development host. This is a process measurement, not a thin-client guarantee. Integrity challenges are fresh OS-generated secrets rather than values derived from the deployment seed. Arithmetic and reconstruction use canonical elements of the field 232−52^{32}-5, with compact 32-bit transport words. The official-model remote path uses FP32 client-side nonlinear computation; FP64 remains available for reference verification. Artifact distribution uses authenticated SSH, and inference uses mutually authenticated QUIC; these transport protections are distinct from the share-secrecy assumption.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical