Skip to main content

Core SDK for genblaze media generation orchestration

Project description

genblaze-core

Python SDK for building generative AI pipelines across video, image, and audio — with built-in SHA-256 provenance.

genblaze-core is the core of genblaze, an open-source orchestration framework by Backblaze for composing multi-step AI media generation workflows. It gives you a single, provider-agnostic Pipeline API for text-to-video, text-to-image, text-to-speech, image-to-video, and audio generation — so you can swap models (Sora, Veo, Runway, Luma, Flux, DALL·E, ElevenLabs, Stable Audio, LMNT, GMICloud) without rewriting pipeline logic.

Every pipeline run emits a canonical, hash-verified provenance manifest — a tamper-evident JSON document capturing the provider, model, prompt, parameters, timestamps, and output asset metadata. Outputs are sha256-covered once sha256 is populated, typically by a storage sink or byte-returning provider path. Manifests can be embedded directly into PNG, JPEG, WebP, MP4, MP3, and WAV files, uploaded alongside assets to S3-compatible storage, or exported to Parquet for analytics.

Why genblaze-core

  • One API for every generative AI provider — Pipelines, not per-vendor SDK glue. Fluent, composable, chainable.
  • Built-in provenance — Every asset gets a SHA-256–verified manifest. Prove how media was made; detect tampering.
  • Production-ready — Retries, timeouts, progress streaming, moderation hooks, OpenTelemetry tracing, step caching.
  • Storage-agnostic sinks — Drop into Backblaze B2, AWS S3, Cloudflare R2, MinIO, Parquet, or local disk.
  • Policy + privacy controls — Redact prompts, strip params, pointer-mode for sensitive content.
  • Agent loops + templates — Evaluator-driven iteration, reusable pipeline and step templates.
  • Zero lock-in — MIT licensed, typed, lazy imports, provider adapters are separate packages.

Features

Capability What you get
Pipeline API Fluent multi-step generation, fan-in (input_from), AV compositing via FFmpeg
Provider discovery Entry-point–based registry — pip install genblaze-<provider> and it's available
Manifest (Pydantic) Run, Step, Asset models with canonical JSON hashing, verify_hash(), and stricter .verify() output sha256 checks
Media embedding PngHandler, Mp4Handler, Mp3Handler, etc. — embed + extract manifests in-file
Storage sink ObjectStorageSink with hierarchical or content-addressable key layout
Parquet sink Partitioned run/step/asset tables for downstream analytics
Observability OTelTracer, LoggingTracer, CompositeTracer, structured events
Agents AgentLoop with pluggable Evaluator for iterative refinement
Moderation Pre/post moderation hooks, configurable embed policies
Testing MockProvider, MockVideoProvider, MockAudioProvider for offline tests

Install

pip install genblaze-core

Optional extras:

pip install "genblaze-core[parquet]"   # ParquetSink for analytics
pip install "genblaze-core[audio]"     # Audio metadata embedding (mutagen)

Add provider adapters separately:

pip install genblaze-openai genblaze-google genblaze-runway genblaze-luma \
            genblaze-decart genblaze-replicate genblaze-elevenlabs \
            genblaze-stability-audio genblaze-lmnt genblaze-gmicloud

pip install genblaze-s3    # Storage backend for Backblaze B2 / AWS S3 / R2 / MinIO
pip install genblaze-cli   # Extract / verify / replay / index manifests

Quickstart — local, zero API keys

from genblaze_core import Modality, Pipeline
from genblaze_core.testing import MockVideoProvider

run, manifest = (
    Pipeline("hello-genblaze")
    .step(MockVideoProvider(), model="mock-v1",
          prompt="A drone shot over a coastal city at golden hour",
          modality=Modality.VIDEO)
    .run()
)

print(manifest.canonical_hash)   # deterministic SHA-256 of the run
print(manifest.verify_hash())    # True: canonical payload hash matches
print(manifest.verify())         # True when every output asset declares sha256

Quickstart — Sora + Backblaze B2 storage

Generate a video, upload it + its manifest to Backblaze B2, verify the hash:

pip install genblaze-core genblaze-openai genblaze-s3
export OPENAI_API_KEY="sk-..."
export B2_KEY_ID="..."
export B2_APP_KEY="..."
from genblaze_core import KeyStrategy, Modality, ObjectStorageSink, Pipeline
from genblaze_openai import SoraProvider
from genblaze_s3 import S3StorageBackend

storage = ObjectStorageSink(
    S3StorageBackend.for_backblaze("my-bucket"),
    key_strategy=KeyStrategy.HIERARCHICAL,
)

result = (
    Pipeline("hero-reel")
    .step(SoraProvider(), model="sora-2",
          prompt="Aerial flyover of a mountain lake at sunrise",
          modality=Modality.VIDEO, seconds=4, size="1280x720")
    .run(sink=storage, timeout=300)
)

print(result.run.steps[0].assets[0].url)   # durable B2 URL
print(result.manifest.canonical_hash)      # SHA-256 of the full run
assert result.manifest.verify()

Manifest.verify() does not fetch remote asset URLs. It verifies the manifest hash and requires output assets to declare valid sha256 values. If your code fetches asset.url, hash those bytes separately and compare them to asset.sha256.

Storage — Backblaze B2 recommended

Backblaze B2 is the recommended default sink for genblaze — purpose-built for large AI-generated media with S3-compatible APIs, resilient multipart uploads, Object Lock for immutable manifests, and strong cost economics at scale. One-liner credentials from B2_KEY_ID / B2_APP_KEY. See the genblaze-s3 backend for the full recipe plus AWS S3, Cloudflare R2, and MinIO variants.

Documentation

Related packages

Provider adapters: genblaze-openai · genblaze-google · genblaze-runway · genblaze-luma · genblaze-decart · genblaze-replicate · genblaze-elevenlabs · genblaze-stability-audio · genblaze-lmnt · genblaze-gmicloud

Storage + tooling: genblaze-s3 · genblaze-cli · genblaze-langsmith

License

MIT

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

genblaze_core-0.3.4.tar.gz (384.3 kB view details)

Uploaded Source

Built Distribution

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

genblaze_core-0.3.4-py3-none-any.whl (258.7 kB view details)

Uploaded Python 3

File details

Details for the file genblaze_core-0.3.4.tar.gz.

File metadata

  • Download URL: genblaze_core-0.3.4.tar.gz
  • Upload date:
  • Size: 384.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for genblaze_core-0.3.4.tar.gz
Algorithm Hash digest
SHA256 fb2be7ccdfaf9dad60954b8878f0a516221dce3b73c9e6d068a5ddee9ab42673
MD5 7e0b9ae7c2743510dd49c573f9f88a63
BLAKE2b-256 0e43e6e012f1660c98fa25a630284b980b9fecdf71ec33401ad9bcbf9f970f86

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_core-0.3.4.tar.gz:

Publisher: release.yml on backblaze-labs/genblaze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genblaze_core-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: genblaze_core-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 258.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for genblaze_core-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7b71fce2c9a7dbb135f37019b7e19c4bafa0441c551ddffced067118b7b03bc4
MD5 11d4149c0ca46c097d73e884382d36d1
BLAKE2b-256 8b3c67a9b9051b819e7e0c23f0f70dac9a16af39a8f9ec06f88fa4b36fe3c6a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for genblaze_core-0.3.4-py3-none-any.whl:

Publisher: release.yml on backblaze-labs/genblaze

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