aphelion-core
Core library for the Aphelion Framework - a unified frontend for AI model development in Rust.
Overview
aphelion-core provides the foundational APIs for building AI pipelines:
- BuildGraph - Directed acyclic graph for model architecture with deterministic SHA-256 hashing
- BuildPipeline - Composable pipeline stages for training, inference, and deployment
- ModelConfig - Type-safe configuration with parameter validation and versioning
- Backend - Hardware abstraction trait for CPU, GPU, and accelerators
- Diagnostics - Structured tracing and event logging
Installation
[]
= "1.2"
= "1.0" # Required for parameter values
Optional Features
[]
= { = "1.2", = ["rust-ai-core", "tritter-accel", "tokio"] }
| Feature | Description |
|---|---|
rust-ai-core |
Memory tracking, device detection, dtype utilities via rust-ai-core |
tritter-accel |
BitNet b1.58 ternary ops, VSA gradient compression via tritter-accel |
cuda |
CUDA GPU support (requires rust-ai-core) |
burn |
Burn deep learning framework backend |
cubecl |
CubeCL GPU compute backend |
tokio |
Async pipeline execution |
python |
Python bindings via PyO3 (builds aphelion-framework wheel) |
Quick Start
use *;
use ModelConfig;
use NullBackend;
use InMemoryTraceSink;
use BuildGraph;
use ;
// Create model configuration
let config = new
.with_param
.with_param;
// Build graph
let mut graph = default;
let node = graph.add_node;
// Execute pipeline
let backend = cpu;
let trace = new;
let ctx = new;
let pipeline = standard;
let result = pipeline.execute.unwrap;
println!;
Core Modules
config - Model Configuration
use ModelConfig;
let config = new
.with_param
.with_param;
// Type-safe retrieval
let hidden: u32 = config.param?;
let layers: u32 = config.param_or?;
graph - Build Graph
use BuildGraph;
let mut graph = default;
let input = graph.add_node;
let hidden = graph.add_node;
graph.add_edge;
// Deterministic hash
let hash = graph.stable_hash;
pipeline - Pipeline Execution
use ;
let pipeline = new
.with_stage
.with_stage
.with_pre_hook;
let result = pipeline.execute?;
backend - Hardware Abstraction
use ;
// Use null backend for testing
let backend = cpu;
// Implement custom backend
diagnostics - Tracing
use ;
let trace = new;
trace.info;
trace.warn;
let json = trace.to_json;
Ecosystem Integration
aphelion-core is part of the rust-ai ecosystem:
- rust-ai-core - Memory tracking, device detection
- tritter-accel - Ternary acceleration
- Candle - Tensor operations
See the framework README for full ecosystem documentation.
License
MIT License - see LICENSE