A content factory that runs on free tiers
Script → images → narration → word-level captions → render → upload, in one command — with a spend ceiling on every paid API in the chain.
10
pipeline stages, one command
11,437
lines of Python (44 modules)
15
providers across 4 fallback chains
6/day
hard YouTube upload cap
The problem
Faceless short-form content looks like a growth hack until you produce it manually. Scripting, image sourcing, narration, word-perfect captions, rendering, thumbnails, metadata, upload — a daily grind that scales with headcount, not with ideas.
The obvious fix — automate it with paid APIs — creates two new failures. One expired key or provider outage and production stops dead. And without hard ceilings, a runaway loop quietly turns into a runaway invoice.
The approach
One command, a finished video
The pipeline is a fixed ten-stage program: an AI director plans semantic beats and a storyboard (audited by a coach pass before anything renders), images are generated per prompt and validated with PIL before use, edge-tts produces keyless neural narration, and faster-whisper word timestamps drive karaoke-style per-word caption overlays.
A SQLite journal makes reruns free: videos already marked Uploaded are never regenerated, rendered files on disk are skipped, and every channel/topic pair is idempotent.
- Reveal timing is derived from the audio itself — the Whisper countdown is located so the real photo lands exactly on the final beat, with a heuristic fallback and graceful disable if it can't be trusted
- MoviePy v1/v2 compatibility shims across composition, captions and looping, because the dependency has no version ceiling
- Docker Compose splits the system into API, polling worker and review UI
A missing key never blocks production
Every external capability is a ranked fallback chain that degrades instead of dying. Scripts route through an LLM SmartRouter (Ollama → g4f → Pollinations → 9Router → OpenAI → Jimeng → a template provider that always works). Images route DashScope → Cloudflare FLUX → keyless Pollinations → local Stable Diffusion. Backgrounds route Pexels → Pixabay → Coverr → keyless AI video.
The floor of the whole system is keyless: edge-tts for voice, Pollinations for generation, Wikimedia Commons for licensed real photos. Run out of budget or credentials and the factory keeps producing, just cheaper.
The bill is bounded by code
Cloudflare FLUX spend is tracked in a daily neuron budget (9,000/day by default). When the budget is consumed, the router automatically drops to the free model tier instead of erroring.
Uploads are guarded against YouTube's quota arithmetic: 10,000 daily units, 1,658 per upload, and a hard refusal at six videos — checked against live API usage before any request is made.
Human-in-the-loop without abandoning automation
Scripts move through APPROVED → GENERATING → UPLOADED / FAILED under a polling worker. A swipe-review UI lets a non-technical operator approve or reject scripts while rendering and upload continue unattended.
Architecture
AI writer (SmartRouter, 7 providers) --> review UI (approve) --> worker (poll 30s)
|
+--> images (4-tier fallback) -----+
+--> narration (edge-tts+whisper) -+--> MoviePy render 1080x1920 @ 30fps
+--> backgrounds (4-tier) ---------+ |
v
quota-guarded YouTube upload
|
v
SQLite journal (idempotent: skip if Uploaded)Fallback chains everywhere, one journal of record.
Outcomes
- ✓Content production becomes a scheduled job instead of a daily chore: topic name in, finished MP4 + thumbnail + metadata out
- ✓Operational cost is provable up front — every paid path has a ceiling and an automatic free-tier fallback
- ✓The system has produced and uploaded real videos across configured channels (5 uploads documented in the repo, with render packs of 20+ files)
- ✓An operator can run production without touching code: approve scripts in a UI, the worker handles the rest
What I learned
- →Reliability must be designed-in: multi-provider fallback chains and hard budget ceilings prevent single points of failure from becoming production outages.
- →Idempotency is critical for unattended systems — skip-if-uploaded logic and durable state prevent duplicate work and runaway costs.
- →Graceful degradation (free-tier fallbacks) keeps pipelines running under constraints instead of hard-failing.
Scope, honestly
The part most portfolios leave out. Here is exactly what is shipped today, and what is designed but not yet wired — read the repo and check me on it.
Shipped & verified
- ·Full 10-stage render pipeline with provider fallback chains and budget guards
- ·Swipe-review UI, polling worker, FastAPI service, Docker Compose deployment
- ·Idempotent SQLite journal with skip-if-uploaded logic and status transitions
- ·CI syntax gate (compileall) on push
Designed · next
- ·No automated test suite yet — the CI gate is a compile check, and I'd add golden-file render tests first
- ·The documented 'curiosity' learning loop is designed but not shipped; its CLI commands are intentionally called out as not wired
- ·Upload and channel figures are self-reported in repo docs, not cross-checked against YouTube analytics exports
Next case study
A scraper that survives crashes, bans and 3 AM failures
Start a project
Have a system that should run itself?
Tell me what breaks today — the manual loop, the API bill, the scraper that dies overnight — and I'll tell you what I'd build, what it costs, and what I wouldn't bother automating.