A modular neural network component library
Project description
HaloBlocks
Modern, Modular, and Composability-First Neural Network Components.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35421a51ddfa1727290f675609db8471ff7b850e145f6dae654f2d9490b2e033
|
|
| MD5 |
a02113bf49fc8723836702f9554b0ae3
|
|
| BLAKE2b-256 |
deb28ac94537f37b8c0cfa57f8c53a1ec80b3ac5bc4523c7ba411a52ca79f3b7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1328f6f95e96137c7a451f75d01648709c940f4c86ebb97f0bf9cecc48857464
|
|
| MD5 |
901dd20de37123052936fd045aac1c5e
|
|
| BLAKE2b-256 |
5b6243f7f784c5e06da8efc0364c9baa454e19c68bbcc3fdfe47e8c218ed5ae5
|