Python bindings for the Aphelion AI Framework - unified frontend for AI model development
Project description
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
[dependencies]
aphelion-core = "1.2"
serde_json = "1.0" # Required for parameter values
Optional Features
[dependencies]
aphelion-core = { version = "1.2", features = ["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 aphelion_core::prelude::*;
use aphelion_core::config::ModelConfig;
use aphelion_core::backend::NullBackend;
use aphelion_core::diagnostics::InMemoryTraceSink;
use aphelion_core::graph::BuildGraph;
use aphelion_core::pipeline::{BuildContext, BuildPipeline};
// Create model configuration
let config = ModelConfig::new("transformer", "1.0.0")
.with_param("d_model", serde_json::json!(512))
.with_param("n_heads", serde_json::json!(8));
// Build graph
let mut graph = BuildGraph::default();
let node = graph.add_node("encoder", config);
// Execute pipeline
let backend = NullBackend::cpu();
let trace = InMemoryTraceSink::new();
let ctx = BuildContext::new(&backend, &trace);
let pipeline = BuildPipeline::standard();
let result = pipeline.execute(&ctx, graph).unwrap();
println!("Hash: {}", result.stable_hash());
Core Modules
config - Model Configuration
use aphelion_core::config::ModelConfig;
let config = ModelConfig::new("llama", "2.0.0")
.with_param("hidden_size", serde_json::json!(4096))
.with_param("num_layers", serde_json::json!(32));
// Type-safe retrieval
let hidden: u32 = config.param("hidden_size")?;
let layers: u32 = config.param_or("num_layers", 12)?;
graph - Build Graph
use aphelion_core::graph::BuildGraph;
let mut graph = BuildGraph::default();
let input = graph.add_node("input", config.clone());
let hidden = graph.add_node("hidden", config.clone());
graph.add_edge(input, hidden);
// Deterministic hash
let hash = graph.stable_hash();
pipeline - Pipeline Execution
use aphelion_core::pipeline::{BuildPipeline, ValidationStage, HashingStage};
let pipeline = BuildPipeline::new()
.with_stage(Box::new(ValidationStage))
.with_stage(Box::new(HashingStage))
.with_pre_hook(|ctx| {
println!("Starting on {}", ctx.backend.name());
Ok(())
});
let result = pipeline.execute(&ctx, graph)?;
backend - Hardware Abstraction
use aphelion_core::backend::{Backend, NullBackend, DeviceCapabilities};
// Use null backend for testing
let backend = NullBackend::cpu();
// Implement custom backend
impl Backend for MyGpuBackend {
fn name(&self) -> &str { "my_gpu" }
fn device(&self) -> &str { "cuda:0" }
fn capabilities(&self) -> DeviceCapabilities { /* ... */ }
fn is_available(&self) -> bool { true }
fn initialize(&mut self) -> AphelionResult<()> { Ok(()) }
fn shutdown(&mut self) -> AphelionResult<()> { Ok(()) }
}
diagnostics - Tracing
use aphelion_core::diagnostics::{InMemoryTraceSink, TraceSinkExt};
let trace = InMemoryTraceSink::new();
trace.info("model.init", "Initializing model");
trace.warn("config", "Deprecated parameter");
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aphelion_framework-1.2.10.tar.gz.
File metadata
- Download URL: aphelion_framework-1.2.10.tar.gz
- Upload date:
- Size: 133.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ca7cd0cbbbc42dfa14ce941282235754053378e989063ec6cec0bd1994267c6
|
|
| MD5 |
09e1c5a0efaa6f6e8b6abaadb8fe7626
|
|
| BLAKE2b-256 |
260dff82cc2eaddde9d180ab90529f68fbe15b3b98b808506003c21cf31dadb9
|
Provenance
The following attestation bundles were made for aphelion_framework-1.2.10.tar.gz:
Publisher:
release.yml on tzervas/aphelion-framework-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aphelion_framework-1.2.10.tar.gz -
Subject digest:
3ca7cd0cbbbc42dfa14ce941282235754053378e989063ec6cec0bd1994267c6 - Sigstore transparency entry: 869367388
- Sigstore integration time:
-
Permalink:
tzervas/aphelion-framework-rs@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Branch / Tag:
refs/tags/v1.2.10 - Owner: https://github.com/tzervas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aphelion_framework-1.2.10-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: aphelion_framework-1.2.10-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 392.2 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a36c3fdcea0cd7a1af0937ad418bc8c14d22cad011ec41e87bb010bd163819a7
|
|
| MD5 |
963bcdd286cd250bcb237171da233aed
|
|
| BLAKE2b-256 |
fce72981ea8d63d7b9fc9a635d6cd9e399d95cf8774f755855c41e48dd35670d
|
Provenance
The following attestation bundles were made for aphelion_framework-1.2.10-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on tzervas/aphelion-framework-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aphelion_framework-1.2.10-cp310-abi3-win_amd64.whl -
Subject digest:
a36c3fdcea0cd7a1af0937ad418bc8c14d22cad011ec41e87bb010bd163819a7 - Sigstore transparency entry: 869367394
- Sigstore integration time:
-
Permalink:
tzervas/aphelion-framework-rs@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Branch / Tag:
refs/tags/v1.2.10 - Owner: https://github.com/tzervas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aphelion_framework-1.2.10-cp310-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: aphelion_framework-1.2.10-cp310-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 491.4 kB
- Tags: CPython 3.10+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40008c5e744cc6ca78bd0593c0d771002666d3700065e2e9f470985da9b6482
|
|
| MD5 |
12f17f14488cbf036c9b3691d15cc528
|
|
| BLAKE2b-256 |
3e584dc1dd472c1b7525856c2027c676551b80266186978999aed862f8780f58
|
Provenance
The following attestation bundles were made for aphelion_framework-1.2.10-cp310-abi3-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on tzervas/aphelion-framework-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aphelion_framework-1.2.10-cp310-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
a40008c5e744cc6ca78bd0593c0d771002666d3700065e2e9f470985da9b6482 - Sigstore transparency entry: 869367399
- Sigstore integration time:
-
Permalink:
tzervas/aphelion-framework-rs@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Branch / Tag:
refs/tags/v1.2.10 - Owner: https://github.com/tzervas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aphelion_framework-1.2.10-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: aphelion_framework-1.2.10-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 447.6 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dfeaef0e1fe65f062520fbaea05f4ff2a9d7f58819b496896f1e387568e6a7e
|
|
| MD5 |
1a8802b1027e9f7e1986bf9d6cc59ba2
|
|
| BLAKE2b-256 |
bc739c9cdb0d85195e8406046bcb82b7b552f29529fc3e09694f388ce29cf76f
|
Provenance
The following attestation bundles were made for aphelion_framework-1.2.10-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on tzervas/aphelion-framework-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aphelion_framework-1.2.10-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
7dfeaef0e1fe65f062520fbaea05f4ff2a9d7f58819b496896f1e387568e6a7e - Sigstore transparency entry: 869367395
- Sigstore integration time:
-
Permalink:
tzervas/aphelion-framework-rs@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Branch / Tag:
refs/tags/v1.2.10 - Owner: https://github.com/tzervas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a9a621beb7b9025b2a91edfe8b6cbef593d8287 -
Trigger Event:
push
-
Statement type: