Skip to main content

Crate jugar_apr

Crate jugar_apr 

Source
Expand description

Aprender Package Resource (.apr) model format.

Per spec Section 4.1: The .apr format is a compact, portable container for trained AI behaviors that can be hot-swapped like trading cards.

§File Structure

┌─────────────────────────────────────────────────────────────┐
│                    .APR File Structure                       │
├─────────────────────────────────────────────────────────────┤
│  Magic Number: "APNR" (4 bytes)                             │
│  Version: u16 (2 bytes)                                      │
│  Checksum: CRC32 (4 bytes)                                   │
├─────────────────────────────────────────────────────────────┤
│  Metadata (CBOR encoded):                                    │
│    - name, version, author, license                          │
│    - difficulty_levels, input_schema, output_schema          │
├─────────────────────────────────────────────────────────────┤
│  Model Data (compressed):                                    │
│    - weights: [f32; N]                                       │
│    - biases: [f32; M]                                        │
│    - architecture: string                                    │
└─────────────────────────────────────────────────────────────┘

Structs§

AprFile
Parsed APR file
AprMetadata
Metadata for an APR model
AprModel
A complete APR model with metadata and data
ModelData
Neural network weights and architecture

Enums§

AprError
Errors that can occur when working with APR models
ModelArchitecture
Network architecture specification

Constants§

APR_MAGIC
Magic number for APR files
APR_VERSION
Current APR version
CURRENT_VERSION
Current model version
MAX_MODEL_SIZE
Maximum allowed model size (1 MB per spec Section 9.1)
MIN_SUPPORTED_VERSION
Minimum model version supported