Expand description
RLX package format (.rlxp) — flat mmap (default), ZIP, or directory.
§Overview
| Piece | Role |
|---|---|
Package | Open flat / ZIP / dir; mmap hot weights; inflate warm/cold |
write_package | Emit a pack from MIR graph + PackedWeight rows |
WriteOptions::include_graph | Optional executable MIR (default on); weight-only when false |
StorageTier | Hot (mmap) / warm (zstd_blocks) / cold (zstd) |
Spec: docs/rlxp.md.
Bake exports via package_from_bake / rlx-bake --format rlxp.
ONNX import with an executable graph lives on rlx-bake (--features onnx).
§Features
encrypt—seal_bytes/unseal_bytes(RLXSEAL1)remote—RemoteFlatHTTP Range reader
Structs§
- Auto
Tier Options - Options for
apply_auto_tier. - Bake
Weight - Minimal weight row matching bake’s table (avoids depending on
rlx-bake). - Dduf
Import Options - Options for
dduf_to_rlxp. - DistRef
- Optional distribution section.
- Expert
Placement - Expert-parallel placement for one expert id.
- Flat
Header - Fixed header before the TOC (24 bytes).
- FlatToc
- Table of contents after the fixed header.
- Gguf
Import Options - Options for
gguf_to_rlxp. - Graph
Ref - Graph member reference inside the pack.
- Manifest
- Root package manifest (
rlx.json). - MlxImport
Options - Options for
mlx_to_rlxp. - Nemo
Import Options - Options for
nemo_to_rlxp. - Package
- Opened RLX package.
- Packed
Weight - One weight to pack (from bake or another producer).
- Placement
- Distribution placement metadata.
- PtImport
Options - Options for
pt_to_rlxp. - Remote
Flat - Remote flat-pack handle: TOC in memory; tensor bytes fetched on demand.
- Sidecar
Ref - Named sidecar blob.
- Tensor
Shard - How one tensor is sharded across ranks.
- Verify
Report - Weight
Entry - One weight tensor in the package catalog.
- Weights
Index - Weight catalog file.
- Weights
Ref - Weights catalog pointer.
- Write
Options - Options for
write_package.
Enums§
- Codec
- On-disk encoding of a blob’s payload bytes.
- Container
Kind - On-disk container kind.
- Materialize
Mode - Which weight tiers to bind into graph Constants on
Package::graph. - Member
Source - Where package members are served from.
- Storage
Tier - Access class for a blob inside a flat package.
Constants§
- COMPAT_
VERSION - Minimum loader
compat_versionthis crate supports. - DEFAULT_
WARM_ BLOCK - Default uncompressed block size for warm
zstd_blocks(1 MiB). - FLAG_
BINCODE_ TOC - Flag bit: TOC is bincode rather than JSON.
- FLAG_
HYBRID - Flag bit: package uses hybrid hot/warm/cold codecs.
- FLAT_
CONTAINER_ VERSION - Flat container format version. v2 = hybrid tiers; v1 still readable.
- FLAT_
MAGIC - Magic for the flat package (
RLXPFLAT). - FORMAT_
NAME - Package format identifier (
"rlxp"). - FORMAT_
VERSION - Current structural schema version.
- SEAL_
MAGIC - Magic prefix for sealed blobs.
Functions§
- apply_
auto_ tier - Mutate
weightstiers in place using heuristics / allow-lists. - checksum_
hex - xxh3-64 hex checksum of raw (uncompressed) bytes.
- dduf_
to_ rlxp - Convert
model.dduf→.rlxp(weights + optional stub graph). - decode_
zstd_ block_ at - Decode one warm block by index without inflating the whole tensor.
- decode_
zstd_ blocks - Decode a warm
ZBLKblob to owned raw bytes (sequential). - decode_
zstd_ blocks_ parallel - Decode warm blocks in parallel via rayon (better for large tensors).
- dtype_
for_ weight_ scheme - Map RLXP
schemestrings to a host bind dtype forset_param_typed. - encode_
zstd_ blocks - Encode a warm blob: header + per-block zstd frames.
- gguf_
to_ rlxp - Convert
model.gguf→.rlxp(weights + optional stub graph). - graph_
with_ stripped_ weights - Strip named weight constant payloads from a graph clone (disk size win).
- http_
range - Fetch a byte range from
url(Range: bytes=start-endinclusive). - infer_
container - Infer container from path / explicit override.
- infer_
zip_ from_ path - Back-compat alias:
true→ Zip,false→ Dir;Noneuses path inference (.rlxp→ Flat). - is_
flat_ magic - is_
sealed - True if
bytesbegin with the seal magic. - mlx_
to_ rlxp - Convert an MLX weight path (dir /
.safetensors/.npz/.npy) →.rlxp. - nemo_
to_ rlxp - Convert
model.nemo→.rlxp(f32 weights + config / tokenizer sidecars). - package_
from_ bake - Write a package from a baked graph and weight table.
- pt_
to_ rlxp - Convert a PyTorch checkpoint →
.rlxp(dense f32 weights). - seal_
bytes - Seal plaintext bytes with a password (Argon2id + ChaCha20-Poly1305).
- unseal_
bytes - Open a sealed blob.
- verify_
package - Verify every tensor (and optional sidecars) against TOC checksums.
- write_
package - Write a package to
out(path inferred as flat / ZIP / dir unlessWriteOptions::containeris set). - write_
package_ dir - Write an unpacked directory package.
- write_
package_ flat - Write the flat mmap package (default
.rlxp). - write_
package_ zip - Write a ZIP64 STORE archive (inspectable; larger/slower than flat).