Expand description
§apr-format — sovereign .apr model container format
Minimal, dependency-light read/write for the .apr model container (v1
APRN + v2 APR\0), extracted from aprender-core so that downstream
consumers (realizar inference, xpile, external tooling) can read and write
.apr files without pulling the full ML/GPU/tokenizer/quantization stack.
See issue #2231 — “depend on the format, not the framework.”
§Status: Stage 1 foundation + cut-feasibility spike
This crate currently ships:
- The sovereign error seam (
error::AprFormatError, wrapped byaprender-coreviaimpl From). - The single deduplicated
crc32::crc32and [f16] conversions. - A representative v1 (
APRN) slice —types(header/metadata/flags) andcore_io(save/load) — proving the error-seam compiles at a crate boundary. - The byte-only structural validator split (
validate), demonstrating the Structure-vs-Physics separation.
The bulk git-mv of the rest of format/ (v2 container, mmap, spec, …) lands
in Stage 2.
§Locked design decisions (issue #2231)
- The GGUF/SafeTensors/ONNX converter stays in
aprender-core(it needsf32physics + the ML stack); only the container moves. - std-only for v1 (no
no_stdyet — the std surface is kept thin). - Wrapper error seam: the leaf owns
AprFormatError; core From-wraps it. - mmap is feature-gated (
mmapfeature, off by default).
Re-exports§
pub use core_io::inspect;pub use core_io::inspect_bytes;pub use core_io::load;pub use core_io::load_auto;pub use core_io::load_from_bytes;pub use core_io::load_mmap;pub use core_io::save;pub use core_io::MMAP_THRESHOLD;pub use crc32::crc32;pub use error::AprFormatError;pub use error::Result;pub use f16::f16_to_f32;pub use f16::f32_to_f16;pub use model_card::ModelCard;pub use model_card::TrainingDataInfo;pub use types::Compression;pub use types::DistillMethod;pub use types::DistillationInfo;pub use types::DistillationParams;pub use types::Flags;pub use types::Header;pub use types::LayerMapping;pub use types::LicenseInfo;pub use types::LicenseTier;pub use types::Metadata;pub use types::ModelInfo;pub use types::ModelType;pub use types::SaveOptions;pub use types::TeacherProvenance;pub use types::TrainingInfo;pub use types::FORMAT_VERSION;pub use types::HEADER_SIZE;pub use types::MAGIC;pub use types::MAX_UNCOMPRESSED_SIZE;pub use validate::validate_structure;pub use validate::StructureCheck;
Modules§
- core_io
- v1 (
APRN) core I/O — spike slice for issue #2231 Stage 1. - crc32
- Single, deduplicated CRC32 implementation for the
.aprcontainer. - error
- Error type for the sovereign
apr-formatleaf crate. - f16
- IEEE-754 half-precision (f16) conversion, delegating to the
halfcrate. - falsifiers
- GREEN contract falsifiers for the apr-format extraction (issue #2231).
- model_
card - Model Card for .apr format (spec §11)
- types
- v1 (
APRN) container type definitions — sovereign leaf (issue #2231). - v2
- APR Format Module (v2
APR\0) — sovereign leaf (issue #2231) - validate
- Structural validation — the Structure-category half of the validator split (issue #2231 Stage 1 spike, part b).