Skip to main content

Python bindings for the Aphelion AI Framework - unified frontend for AI model development

Project description

aphelion-framework

Python bindings for the Aphelion AI Framework.

Installation

pip install aphelion-framework

Building from source

Requires maturin:

pip install maturin
cd crates/aphelion-python
maturin develop

Feature flags

Build with specific backends:

maturin develop --features burn
maturin develop --features cubecl
maturin develop --features tritter-accel
maturin develop --features full  # all backends

Quick Start

import aphelion
import asyncio

async def main():
    # Create configuration
    config = aphelion.ModelConfig("my-model", "1.0.0")
    config.with_param("hidden_size", 256)
    config.with_param("layers", 4)

    # Build graph
    graph = aphelion.BuildGraph()
    node1 = graph.add_node("input", config)
    node2 = graph.add_node("output", config)
    graph.add_edge(node1, node2)

    # Validate
    assert not graph.has_cycle()
    print(f"Hash: {graph.stable_hash()}")

    # Create pipeline context
    backend = aphelion.NullBackend.cpu()
    trace = aphelion.InMemoryTraceSink()
    ctx = aphelion.BuildContext(backend, trace)

    # Execute pipeline (async)
    pipeline = aphelion.BuildPipeline.standard()
    result = await pipeline.execute_async(ctx, graph)

    # Get trace events
    for event in trace.events():
        print(f"[{event.level}] {event.id}: {event.message}")

asyncio.run(main())

API Overview

Configuration

  • ModelConfig - Model configuration with typed parameters
  • ModelConfigBuilder - Builder pattern for configs

Graph

  • NodeId - Unique node identifier
  • GraphNode - Graph node with config and metadata
  • BuildGraph - Computation graph with cycle detection and hashing

Backend

  • NullBackend - CPU-only reference backend for testing

Note: Additional backends (Burn, CubeCL, Tritter-Accel) will be available in future releases. Check HAS_BURN, HAS_CUBECL, HAS_TRITTER_ACCEL feature flags at runtime.

Pipeline

  • BuildPipeline - Multi-stage build pipeline with hooks
  • BuildContext - Execution context with backend and tracing
  • PipelineStage - Custom stage protocol (subclass in Python)

Diagnostics

  • TraceLevel - Log levels (Debug, Info, Warn, Error)
  • TraceEvent - Structured trace event
  • InMemoryTraceSink - Collects events in memory

Validation

  • ValidationError - Validation failure details
  • NameValidator - Validates model names
  • VersionValidator - Validates semver versions
  • CompositeValidator - Combines multiple validators

Feature Flags

Python constants to check available backends at runtime:

  • HAS_BURN - Whether Burn backend is available
  • HAS_CUBECL - Whether CubeCL backend is available
  • HAS_RUST_AI_CORE - Whether rust-ai-core is available
  • HAS_TRITTER_ACCEL - Whether Tritter hardware acceleration is available

License

MIT OR Apache-2.0

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

aphelion_framework-1.2.2.tar.gz (129.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aphelion_framework-1.2.2-cp310-abi3-win_amd64.whl (392.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

aphelion_framework-1.2.2-cp310-abi3-manylinux_2_34_x86_64.whl (496.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

aphelion_framework-1.2.2-cp310-abi3-macosx_11_0_arm64.whl (449.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file aphelion_framework-1.2.2.tar.gz.

File metadata

  • Download URL: aphelion_framework-1.2.2.tar.gz
  • Upload date:
  • Size: 129.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aphelion_framework-1.2.2.tar.gz
Algorithm Hash digest
SHA256 e6ae688feea03559de911ffe94a9ef4b52410f41710b9c9ca1c842c87314dc68
MD5 c83ab2513d703321229d7405c24dea47
BLAKE2b-256 5d21a2cff28b9461d1624d327ba2bf84e4ae1654ff5a8e4a05d5f9af752d92c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.2.tar.gz:

Publisher: release.yml on tzervas/aphelion-framework-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aphelion_framework-1.2.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2f18289701959ba5671833b4c3f06d0db86ed9e830ca4a7576907c37236a0eae
MD5 f3d37e96d21aaf553960d919eafb1579
BLAKE2b-256 4b0000fe06a4de1fd15e3b595185b55915a013e69662c63493e80f00cbd8259d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.2-cp310-abi3-win_amd64.whl:

Publisher: release.yml on tzervas/aphelion-framework-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aphelion_framework-1.2.2-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.2-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7b45f23245e8145d81fcc5d4fe4a1af4a745dfa8a219fdced0b804dad0ceb479
MD5 56d1da128a00c3e17e24b9430db577aa
BLAKE2b-256 2ca2bd9139b23111830645d85ce56430b787c6221c434639bf88ccca8b4cf03c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.2-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on tzervas/aphelion-framework-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aphelion_framework-1.2.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d694e42a2d482d92f90063793d1e7ba6b67ecb79a7f749c095e7ff4c70b6818c
MD5 560783e9bc2c393a5f09f6e1f018cd4f
BLAKE2b-256 71593276810a3343a6c00ef60c676d4c00f85de193d268140fc55efb3c7288b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on tzervas/aphelion-framework-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page