Provenance by Default: AI Media Pipelines in Python

A model can now generate a video that looks indistinguishable from one your camera recorded. The same is true for an image, a voice, or a song. As Python developers, we are building those pipelines — and we are also the ones who will be asked, very soon, to prove what came out of them. This talk is about building generative media pipelines in Python in a way that answers that question by default. We'll walk through Genblaze, an open-source SDK (github.com/backblaze-labs/genblaze, MIT licensed) that I work on at Backblaze, and use it as a vehicle to talk about the design problems any team faces when wiring AI generation into a real product. We will cover, with live code: 1. The Pipeline pattern. A fluent Pipeline → Step → Run → Manifest API built on Pydantic v2 and Runnable[In, Out] ABCs. Sync, async, and streaming runners share a single mental model. We'll see how chain=True propagates assets, how input_from=[0, 1] enables fan-in for AV compositing with FFmpeg, and how fallback_models=[...] retries automatically when a provider drifts. 2. One API, eleven providers. OpenAI Sora, Google Veo, Runway, Luma, Decart, Replicate, ElevenLabs, Stability Audio, LMNT, GMICloud, NVIDIA NIM — all behind the same submit / poll / fetch_output lifecycle. We'll see how a thin provider ABC plus a runtime-extensible ModelRegistry lets you adopt a model the same week it's released, without waiting for a library update. 3. Provenance that survives the file. Every run produces a canonical, SHA-256-verified manifest (deterministic JSON, sorted keys, NFC unicode, normalized floats) that gets embedded into the media itself PNG iTXt, JPEG/WebP XMP, MP4 UUID box, MP3 ID3v2, WAV LIST/INFO. We'll extract and verify a manifest from a real .mp4. We'll talk about what the hash does prove (integrity) and what it doesn't (authentication), and why that distinction is the entire point. 4. Privacy and policy. EmbedPolicy lets pipelines redact prompts, strip parameters, or swap to pointer-mode sidecars. SSRF protection on webhook and asset transfers. Trust modes for adversarial verification. 5. Storage and replay. Durable B2 / S3-compatible URLs, content-addressable layouts, and a CLI (genblaze extract / verify / replay / index) that turns any manifest back into an executable pipeline. 6. Agent loops with lineage. AgentLoop composes a pipeline factory with an evaluator; every iteration is linked via parent_run_id, so refinement chains are first-class in provenance — not a side note in your logs. By the end, attendees will have a clear, opinionated reference for how to architect generative-AI features in Python so that "what did this system actually produce, and can I prove it?" is a one-line answer instead of a ticket.

Speaker

Gonzalo Andrés Peña Castellanos

Gonzalo Andrés Peña Castellanos

Senior Software Engineer / Open Source AI @ Backblaze

I'm a Colombian software engineer with 11+ years of professional experience, and entrepreneur working in Python, TypeScript and open source development. I currently work as an AI Engineer at Backblaze. Previously, I worked at Datalayer building tools at the intersection of Jupyter, AI, and collaborative computing, at Quansight contributing to the scientific Python ecosystem, and at Anaconda as Technical Lead for Anaconda Navigator. My career spans from water resources engineering (MSc from IHE Delft and Erasmus Mundus) to becoming a core contributor to major open source projects including Spyder IDE, JupyterLab, and napari, conda-forge among others. I've created over 400+ conda-forge recipes and led internationalization efforts for JupyterLab and automating efforts in the Scientific Python Translations project. I also co-founded Trepa, a climbing gym in Bogotá, Colombia, where I have developed tools to manage the business and community by automating workflows with AI. These include scraping workflows, chatbots, automatic review and messaging system, and Data Analysis, all to support the Business decissions. I'm deeply committed to the Latin American Python and open source communities. I co-founded PyCon Colombia, helped organize SciPy Latam, and serve on the Python Software Foundation Grants Working Group. I believe in making technology accessible across languages and borders, and I'm passionate about mentoring the next generation of developers in Latin America. I have been a hobby climber since 2021 and a musician, playing keyboards, guitar and choruses with a local band.

View speaker

Want to know more?

Join PyCon Colombia newsletter and get a complete overview of our events, speakers and community participation.