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.6.tar.gz (125.1 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.6-cp310-abi3-win_amd64.whl (392.0 kB view details)

Uploaded CPython 3.10+Windows x86-64

aphelion_framework-1.2.6-cp310-abi3-manylinux_2_34_x86_64.whl (496.6 kB view details)

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

aphelion_framework-1.2.6-cp310-abi3-macosx_11_0_arm64.whl (449.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: aphelion_framework-1.2.6.tar.gz
  • Upload date:
  • Size: 125.1 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.6.tar.gz
Algorithm Hash digest
SHA256 6c65e234b92bb170b4c9e5434ab96585eb1e90260c74fd406caa7ad8ee0f9e50
MD5 89d59414f85c233a60609fa5d2252bee
BLAKE2b-256 29e0806dc16c9fcd566dec327c240e9f0088d9e2aabcff3d5b302eb7b184b98a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.6.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.6-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 21296a0d537bd883ef96fd75336d9d5fdd841b6f93904071a0014629a11eb893
MD5 b93073c2515bf77e27677cac41f584ae
BLAKE2b-256 e5e05c13185b5ad06ca2268dc09ae205f9d11115ee50ac3a78160d82ade74137

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.6-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.6-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.6-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8466359b49c4577e7f24cdbb67b6b531b977b8c76a64b5ec8c7e7b0e7c5daa9f
MD5 ba0d24c4f45b7811404a9e97a7cd9133
BLAKE2b-256 0ac56af68d7381efb5a3a6612a0c5f0d73445cbb082c9682d47c819e2cf4a9f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.6-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.6-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aphelion_framework-1.2.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42f70390d51e73860865f3c6e1c5f38fae89a7aa712e3e0b3745f41a87564007
MD5 7676e3cc4877b70651c01163889d5605
BLAKE2b-256 b4c7cc1a50bfdc8b59a68b15eee29a2ce026d4f91fb77ca88a6ab1fa0673d0b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aphelion_framework-1.2.6-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