High-Performance Rust Library for AI Data Loading
StreamBit is a zero-copy, multi-modal data ingestion engine designed to eliminate bottlenecks in AI/ML workflows. Built in Rust with Python bindings, it provides blazing-fast data loading for images, video, audio, text, and tabular data.
- Multi-Modal Support: Images, Video, Audio, Text (PDF/DOCX), CSV/Parquet
- Zero-Copy Python Integration: Direct memory sharing with NumPy/PyTorch/TensorFlow
- Parallel Processing: Automatic CPU parallelization with Rayon
- Async Streaming: Process data while downloading from URLs
- Pure Rust: Minimal external dependencies (FFmpeg only for video)
- Memory Efficient: Memory-mapped file search, streaming decoders
- Professional CLI: Beautiful progress bars and performance metrics
- Interactive Dashboard: Streamlit GUI with live performance graphs
| Operation | Target Performance |
|---|---|
| Image Loading | >1000 images/second (224x224 resize) |
| Video Processing | >60 FPS frame extraction |
| Audio Decoding | >100x realtime for MP3 |
| Text Extraction | >50 PDFs/second |
| File Search | <100ms for 1000+ files |
StreamBit is organized as a modular Rust workspace:
streambit/
βββ streambit-core/ # Shared utilities and types
βββ streambit-vision/ # Image and video processing
βββ streambit-audio/ # Audio decoding and spectrograms
βββ streambit-text/ # Document extraction and search
βββ streambit-tabular/ # CSV/Parquet support
βββ streambit-streaming/ # Async HTTP streaming
βββ streambit-cli/ # CLI with progress bars
βββ streambit-python/ # PyO3 Python bindings
βββ dashboard/ # Streamlit GUI dashboard
βββ benchmarks/ # Performance comparisons
System Requirements:
- Rust 1.70+ (install from rustup.rs)
- Python 3.8+ with pip
- FFmpeg (for video processing only)
Install FFmpeg:
# Ubuntu/Debian
sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
# macOS
brew install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.htmlpip install streambitOr build from source:
git clone https://github.com/Dpro-at/StreamBit.git
cd StreamBit/streambit-python
pip install maturin
maturin develop --releaseimport streambit
import torch
# Load and resize images in parallel
processor = streambit.ImageProcessor()
images = processor.load_batch(
['img1.jpg', 'img2.jpg', 'img3.jpg'],
resize=(224, 224),
num_threads=8
)
# Zero-copy conversion to PyTorch
tensor = torch.from_numpy(images) # Shape: (3, 3, 224, 224) - CHW formatimport streambit
# Decode audio and convert to Mel-spectrogram
audio_processor = streambit.AudioProcessor()
spectrogram = audio_processor.load_mel_spectrogram(
'audio.mp3',
sample_rate=22050,
n_mels=128
)import streambit
# Extract text from documents
text_extractor = streambit.TextExtractor()
text = text_extractor.extract('document.pdf')
# Batch processing
texts = text_extractor.extract_batch(['doc1.pdf', 'doc2.docx', 'doc3.txt'])import streambit
# Search across 1000+ files in milliseconds
search_engine = streambit.SearchEngine()
search_engine.index_directory('./data')
results = search_engine.search('machine learning', max_results=10)# Run benchmarks with progress bars
streambit benchmark
# Process files with live progress
streambit process images/*.jpg --resize 224x224
# Search files instantly
streambit search "pattern" --path ./dataLaunch the interactive Streamlit dashboard:
cd dashboard
pip install -r requirements.txt
streamlit run app.pyFeatures:
- π Live performance graphs (StreamBit vs Python libraries)
- πΌοΈ File preview gallery with processing stats
- π Instant search demo (1000+ files)
- π Dark mode with StreamBit branding
cargo build --workspace --releasecargo test --workspacecargo bench --workspacecd streambit-python
maturin develop --release
pytest tests/- Implementation Plan - Complete technical roadmap
- Task Checklist - Detailed task breakdown
- Project Metadata - Author and license information
- Stage 1: Core infrastructure and vision module (In Progress)
- Stage 2: Streaming and Python bindings
- Stage 3: Search engine and medical imaging
- Stage 4: CLI, dashboard, and benchmarks
- Stage 5: Documentation and publishing
Contributions are welcome! Please feel free to submit a Pull Request.
Licensed under the MIT License.
Copyright (c) 2025 Mohamed ALarade (Dpro GmbH)
Permission is granted to use, modify, and distribute this software freely, with the requirement to include attribution to the original source.
StreamBit builds on excellent Rust crates:
- image - Image decoding
- symphonia - Audio decoding
- rayon - Data parallelism
- PyO3 - Python bindings
- polars - DataFrame operations
Author: Mohamed ALarade
Email: m.alarade@dpro.at
Company: Dpro GmbH
GitHub: @9mtm | @Dpro-at
β If you find StreamBit useful, please give it a star on GitHub!