Skip to main content

A modular neural network component library

Project description

HaloBlocks Logo

HaloBlocks

Modern, Modular, and Composability-First Neural Network Components.

Build Status PyPI Version License: MIT Python Version


HaloBlocks is a high-performance Python library designed for building complex neural network architectures through simple, composable blocks. Whether you are building Transformers, Mixture-of-Experts (MoE), or Vision-Language-Action (VLA) models, HaloBlocks provides the foundational "bricks" you need.

✨ Key Features

  • 🧩 First-Class Composability: Every component is treated as a "block" that can be easily nested and combined.
  • 🚀 MoE Ready: Built-in support for advanced Mixture-of-Experts architectures, including routed and shared expert systems.
  • 👁️ VLA Integration: Optimized blocks for Vision-Language-Action models, featuring specialized decoders and attention mechanisms.
  • 🛠️ Config-Driven Architecture: Build entire models from JSON/YAML configurations using the BlockFactory.
  • Performance Optimized: Native PyTorch implementation with a focus on speed and memory efficiency.

🚀 Installation

Install the library via pip:

pip install haloblocks

Or using uv for faster dependency management:

uv add haloblocks

🛠️ Quick Start

[!TIP] New to HaloBlocks? Check out our interactive Tutorial Notebook to see the library in action!

1. Keras-like "Direct" Style (New! ✨)

No more nested dictionaries. Access blocks directly from haloblocks.layers:

import haloblocks.layers as layers

# Create a block as a class instance
attn = layers.multi_head_attn(emb_dim=512, num_heads=8)

2. The Convenience create Function

Use the top-level create function for easy instantiation by string name:

import haloblocks as hb

# Quick creation with keyword arguments
attn = hb.create('multi_head_attn', emb_dim=512, num_heads=8)

3. Config-Driven Style

Still fully supported and perfect for YAML/JSON configurations:

config = {
    'type': 'multi_head_attn',
    'emb_dim': 512,
    'num_heads': 8
}
attn = hb.create(config)

📂 Project Structure

haloblocks/
├── core/               # Foundational Block, Factory, and Registry
├── blocks/             # Specialized component implementations
│   ├── attention/      # Self-Attention, Multi-Head, Scaled Dot-Product
│   ├── moe/            # Mixture-of-Experts (DeepSeek style)
│   ├── vla/            # Vision-Language-Action specific blocks
│   └── transformer/    # Transformer layers and blocks
└── heads/              # Model output heads (Classification, LM, etc.)

🤝 Contributing

We welcome contributions! Please see our Contributing Guide to get started.

📄 License

HaloBlocks is released under the MIT License.


Built with ❤️ by Naveen

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

haloblocks-0.1.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

haloblocks-0.1.1-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file haloblocks-0.1.1.tar.gz.

File metadata

  • Download URL: haloblocks-0.1.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for haloblocks-0.1.1.tar.gz
Algorithm Hash digest
SHA256 35421a51ddfa1727290f675609db8471ff7b850e145f6dae654f2d9490b2e033
MD5 a02113bf49fc8723836702f9554b0ae3
BLAKE2b-256 deb28ac94537f37b8c0cfa57f8c53a1ec80b3ac5bc4523c7ba411a52ca79f3b7

See more details on using hashes here.

File details

Details for the file haloblocks-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: haloblocks-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for haloblocks-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1328f6f95e96137c7a451f75d01648709c940f4c86ebb97f0bf9cecc48857464
MD5 901dd20de37123052936fd045aac1c5e
BLAKE2b-256 5b6243f7f784c5e06da8efc0364c9baa454e19c68bbcc3fdfe47e8c218ed5ae5

See more details on using hashes here.

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