Expand description
Hanzo AI Format - Universal .ai file format for AI artifacts
This crate provides a standard format for packaging, distributing, and sharing AI artifacts across the Hanzo/Zoo network. The .ai format supports:
- Model weights and biases
- Fine-tuning deltas (LoRA, QLoRA)
- Quantized models (GGUF, AWQ, GPTQ)
- Datasets and evaluation data
- Embeddings and vector stores
- Agent state and memory
- Configuration and hyperparameters
§File Structure
artifact.ai (ZIP archive with .ai extension)
├── manifest.json # Artifact metadata and manifest
├── data/ # Primary artifact data
│ ├── weights/ # Model weights (safetensors, bin, etc.)
│ ├── config/ # Model configuration
│ └── tokenizer/ # Tokenizer files
├── delta/ # Fine-tuning deltas (optional)
├── dataset/ # Training/eval datasets (optional)
├── embeddings/ # Pre-computed embeddings (optional)
├── state/ # Agent state/memory (optional)
└── signatures/ # Cryptographic signatures§Storage Backends
The format supports multiple storage backends:
- Local filesystem
- HuggingFace Hub (fallback/mirror)
- P2P swarm (BitTorrent-style distribution)
- IPFS (content-addressed storage)
§Example
ⓘ
use hanzo_ai_format::{AiArtifact, ArtifactType, Storage};
// Create a new artifact
let artifact = AiArtifact::builder()
.name("my-model")
.artifact_type(ArtifactType::Model)
.add_weights("weights.safetensors", weights_data)
.build()?;
// Save to .ai file
artifact.save("my-model.ai").await?;
// Upload to storage
let storage = Storage::new_with_hf_fallback();
storage.upload(&artifact).await?;Re-exports§
Modules§
- artifact
- AI Artifact - Read/write .ai files
- error
- Error types for hanzo-ai-format
- manifest
- Manifest - File listing and metadata for .ai archives
- storage
- Storage backends for AI artifacts
Structs§
- Artifact
Metadata - Metadata about the artifact
- Artifact
Ref - Unique identifier for artifacts
- Artifact
Stats - Statistics about artifact usage across the network
- Compute
Requirements - Compute requirements for using this artifact
Enums§
- Artifact
Type - Type of AI artifact
- Dataset
Task - Dataset task type
- Delta
Method - Fine-tuning delta method
- License
- License type for artifacts
- Network
- Network where artifact is available
- Quant
Format - Quantization format
- Storage
Location - Storage location for an artifact
Constants§
- AI_
EXTENSION - File extension for AI artifacts
- AI_
MAGIC - Magic bytes for .ai file format
- FORMAT_
VERSION - Current format version
Type Aliases§
- Artifact
Id - Artifact identifier (content-addressed)