BZML (GenDAM) is an enterprise-grade, high-assurance Generative Digital Asset Management (DAM) engine designed for sub-millisecond metadata search, continuous generative AI inference batching, and immutable provenance tracking backed by Backblaze B2 Cloud Storage.
Engineered in High-Assurance Rust (#![deny(unsafe_code)]) on top of Axum and Tokio, BZML provides B2B media archives with deterministic performance, multi-tier caching (RAM + LSM-Tree Disk), and automated sidecar lineage audit trails. It seamlessly bridges Local AI (Candle/HuggingFace) and Cloud AI (Genblaze SDK) orchestration.
Disclaimer: BZML is an independent, third-party project. It is not a Backblaze product, and it is not affiliated with, endorsed by, or sponsored by Backblaze, Inc. It simply uses the Backblaze B2 object storage service (via its S3-compatible API) as a storage backend, the same way it could point at any other S3-compatible provider.
+-------------------------------------------------------+
| Client (Web Browser / Tauri Desktop App) |
+---------------------------+---------------------------+
|
HTTP / REST API (Axum)
|
v
+-------------------------------------------------------+
| BZML Core Engine (Rust) |
| |
| +-------------------+ +-------------------+ |
| | L1 Cache (RAM) | <---> | L2 Cache (fjall) | |
| | quick_cache | | LSM-Tree Disk DB | |
| +---------+---------+ +-------------------+ |
| | | |
| v v |
| +-----------------------------------------------+ |
| | Continuous Request Aggregator (Batcher Actor) | |
| +-----------------------+-----------------------+ |
| | | |
| v v |
| [ Native Local AI ] [ Python Worker ] |
| (Candle + Tokenizers) (Genblaze Cloud SDK) |
+-------------|-----------------------------|-----------+
+--------------+--------------+
|
Upload Assets & Sidecars
|
v
+-------------------------------------------------------+
| Backblaze B2 Cloud Storage (S3 API) |
| |
| [ raw_asset.png ] + [ raw_asset.png.lineage.json ] |
+-------------------------------------------------------+
- L1 Memory Cache: Built on
quick_cache(S3-FIFO / Clock-PRO eviction policy), serving hot metadata lookups in< 800Β΅s. - L2 Persistent Storage: Powered by the
fjallLSM-Tree database, providing crash-resilient disk persistence across system restarts with automated non-blocking L1 cache warming.
- Enforces strict lint levels across all Rust submodules.
- Eliminates runtime panics (
unwrap/expect-free in core domain logic), fully propagating fallible domain operations via strongly typedResulttypes. - Fully audited for thread safety, memory leak protection, and atomic disk writes.
- Unified 8-Provider Cloud AI Management: Built-in dynamic configuration modal (
/api/v1/settings) with live status badges (β Configured/Not Set) and masked key previews. - Supported Cloud AI Providers:
- OpenAI: DALL-E 3, Sora 2, GPT-4o
- Google Gemini: Veo, Imagen 3
- ElevenLabs: Text-to-Speech & Sound Effects
- Replicate: FLUX.1, SDXL
- RunwayML: Gen-3 Alpha
- Luma AI: Dream Machine
- Stability AI: Stable Diffusion & Stable Audio
- GMI Cloud: Kling Video, Image & Audio
- Hot-Swappable Runtime Keys: Update API keys live from the Web UI without restarting the server.
- Native Local AI (Zero Python): Executes 1-step CPU Text-to-Image models directly in Rust RAM using
candleand HuggingFacetokenizers. - Atomic Hugging Face Downloader: Built-in asynchronous model downloader with concurrency semaphores, atomic
.tmpfile renames, and clamped progress tracking[0.0, 99.9]. - Process-Isolated Python Worker: Escalates to isolated Python workers running the
genblazeSDK with stdout clean JSON separation and automatic local CPU fallback.
- Implements a background Tokio actor with sliding time windows (50ms) and dynamic batch capacity limits (16 items).
- Features bounded MPSC channels for backpressure management, preventing memory exhaustion under traffic spikes.
- Native S3 integration via
aws-sdk-s3supporting custom endpoints, bucket listing pagination, multi-bucket switching, and secure presigned URLs. - Interactive Lineage Inspector: Every generative AI transformation automatically records and uploads a
.lineage.jsonsidecar object containing SHA-256 digests, latency metrics, and parent-child asset relations rendered on an HTML5 Canvas graph.
- Available as a standalone Web App (HTMX + Tailwind) or a native Tauri Desktop Application (
src-tauri). - Enhanced Compact (List) View: Layered z-index stacking (
z-index: 10..30) andpointer-events: autofor seamless multi-select, thumbnail viewing, metadata inspection, and transformation dropdowns.
- Core Runtime: Rust 2021, Tokio, Axum, Tower-HTTP
- Storage & Caching:
aws-sdk-s3,quick_cache,fjall - AI / ML:
candle-core(Local),tokenizers, Python 3.11+genblazeSDK (Cloud) - Presentation: HTMX, Tailwind CSS, Tauri v2 (Desktop)
- Infrastructure: Docker (Multi-stage), Docker Compose, Terraform, GitHub Actions
Create a .env file in the project root or export the required variables. Note: Bucket credentials and Cloud AI API keys can also be added dynamically via the Web UI.
# Backblaze B2 Storage Configuration (Optional at boot)
B2_KEY_ID="your_b2_key_id_here"
B2_APPLICATION_KEY="your_b2_application_key_here"
B2_BUCKET_NAME="bzml-media-bucket"
B2_ENDPOINT_URL="s3.eu-central-003.backblazeb2.com"
B2_REGION="eu-central-003"
# Cloud AI Provider API Keys (Optional - can be configured live via UI)
OPENAI_API_KEY="sk-proj-..."
GEMINI_API_KEY="AIzaSy..."
ELEVENLABS_API_KEY="sk_..."
REPLICATE_API_TOKEN="r8_..."
RUNWAYML_API_SECRET="key_..."
LUMAAI_API_KEY="luma-..."
STABILITY_API_KEY="sk-..."
GMI_API_KEY="gmi_..."
# Axum Web Server Configuration
SERVER_HOST="0.0.0.0"
SERVER_PORT=3000
SERVER_TIMEOUT_MS=10000
# Cache Subsystem Configuration
CACHE_L1_RAM_CAPACITY=10000
CACHE_L2_DISK_PATH="./data/fjall_db"
CACHE_BATCH_WINDOW_MS=50
CACHE_MAX_BATCH_SIZE=16
# Python Worker Configuration
WORKER_PYTHON_BINARY="python3"
WORKER_SCRIPT_PATH="./adapters/python/genblaze_worker.py"
WORKER_TIMEOUT_SECS=30
# Logging Filter
RUST_LOG="info,bzml=debug"Run BZML natively on Windows, macOS, or Linux with a dedicated Webview window and secured process isolation.
# Install Tauri CLI prerequisites if needed
cargo install tauri-cli
# Build and run the desktop application
cargo tauri devSpins up the BZML Rust engine and a pre-configured Alpine Python environment in seconds (~60MB footprint):
# 1. Clone repository & configure env
git clone https://github.com/artiprice/bzml.git && cd bzml
cp .env.example .env
# 2. Build and launch container stack
docker compose up --build -d
# 3. Access web interface
curl -i http://localhost:3000/health# Build high-performance release binary
cargo build --release
# Start the application server
./target/release/bzmlAccess the web interface at http://localhost:3000.
Automatically provision Private Backblaze B2 buckets and scoped application keys using Infrastructure-as-Code:
cd terraform
terraform init
terraform apply| Endpoint | Method | Description |
|---|---|---|
/ |
GET |
Serves the main Single Page Application HTML shell. |
/api/v1/search |
POST |
Executes sub-millisecond metadata search, returning HTMX grid partials. |
/api/v1/transform |
POST |
Submits AI transformation requests to the dynamic batcher actor. |
/api/v1/upload |
POST |
Accepts multipart/form-data uploads directly into B2 and the local cache. |
/api/v1/sync |
POST |
Scans target B2 bucket via ListObjectsV2 and imports missing assets. |
/api/v1/assets/open/{*key} |
GET |
Proxies asset bytes from B2 for inline viewing or download (?download=1). |
/api/v1/lineage/{*key} |
GET |
Fetches the .lineage.json sidecar and renders the Canvas provenance graph. |
/api/v1/settings |
GET / POST |
Fetches or updates Cloud AI API keys for all 8 providers live. |
/api/v1/models |
GET |
Renders the Model & API Registry management modal. |
/api/v1/models/add |
POST |
Registers a new Hugging Face Repo or Custom API endpoint. |
/api/v1/models/download/{id} |
POST |
Triggers background async download of .safetensors/.gguf files. |
/api/v1/connection |
POST |
Dynamically swaps the active B2 bucket connection at runtime. |
/health |
GET |
Returns JSON status telemetry, engine status, and cache capacities. |
Verify system integrity using Cargo:
# Check safety rules and workspace types
cargo check --workspace
# Enforce strict Clippy lint checks
cargo clippy --all-targets --all-features -- -D warnings
# Execute domain unit tests & integration checks
cargo test --workspaceThis project is licensed under the Apache License, Version 2.0. See the LICENSE-APACHE file for details.
Special thanks to Backblaze, Inc. for hosting the Backblaze Generative AI Media Hackathon and providing the cloud storage infrastructure.
