Skip to main content

Modular pipeline agents for automated YouTube video production

Project description

YouTube Factory Pipeline

Modular, provider-agnostic agents for automated YouTube video production.

PyPI Python License


Overview

youtube-factory-pipeline is the core orchestration library behind the "Weight and See" YouTube channel. It provides a clean, modular set of agents that handle every stage of video production:

Research → Idea Generation → Script Writing → Voiceover → Visuals → 
Audio Generation → Assembly → Shorts → Upload → Guide Deployment

Each agent is independently usable, provider-agnostic, and configured via a single JSON file.


Features

Agent Purpose Key Capability
ResearchAgent GitHub/HF/arXiv/web analysis Structured JSON briefs from any URL
IdeaGeneratorAgent Video concept + SWOT 3 concepts → 1 selected, niche diversity enforced
ScriptwriterAgent 3-act retention scripts Hook → Breakdown → Deep Dive + CTA
VoiceoverAgent TTS via OmniVoice/Edge Multi-speaker, word-level timestamps
VisualAssetAgent B-roll + AI images + thumbnails Pexels / SD / Fal / Pollinations / local
AudioGenAgent BGM via Stable Audio 3 Ducking, volume automation
VideoAssemblerAgent FFmpeg assembly Subtitles, ducking, 4K output
ShortGenerator 9:16 vertical clips Auto-scene selection ≤58s
UploaderAgent YouTube Data API v3 Playlists, thumbnails, Shorts
GuideGeneratorAgent HTML resource pages SEO-optimized, deployable to GitHub Pages
CommunityAgent YouTube Community posts Auto-generated from video outputs

Installation

# Core dependencies only
pip install youtube-factory-pipeline

# With optional providers
pip install "youtube-factory-pipeline[omnivoice]"      # Local TTS
pip install "youtube-factory-pipeline[stable-audio]"  # BGM generation
pip install "youtube-factory-pipeline[all]"           # Everything

Quickstart

from youtube_factory.orchestrator import PipelineOrchestrator
from youtube_factory.config import load_config

# Load your config (see Configuration below)
config = load_config("path/to/config.json")

# Create orchestrator
orchestrator = PipelineOrchestrator(workspace_dir="~/youtube_factory")

# Start a run
run_id, state = orchestrator.create_new_run(
    topic_seed="Ollama 0.9.0 local LLM benchmark",
    target_audience="Tech enthusiasts",
    competitor_analysis="Existing LM Studio reviews"
)

# Execute full pipeline (runs in background thread)
orchestrator.execute(run_id)

# Or run individual stages
from youtube_factory.agents.idea import IdeaGeneratorAgent
idea_agent = IdeaGeneratorAgent(config)
result = idea_agent.run({
    "topic_seed": "...",
    "target_audience": "...",
    "competitor_analysis": "..."
})

Configuration

All agents read from a single config.json with environment variable interpolation (${VAR}):

{
  "freellmapi": {
    "api_key": "${FREELLAPI_KEY}",
    "base_url": "http://localhost:3001/v1",
    "timeout": 120
  },
  "omnivoice": {
    "base_url": "http://localhost:3900/v1",
    "voice_id": "brian_ref"
  },
  "pexels_api_key": "${PEXELS_API_KEY}",
  "local_sd": {
    "base_url": "http://127.0.0.1:7860",
    "lora_url": "https://.../style.safetensors"
  },
  "video_settings": { "width": 1920, "height": 1080 },
  "upload_settings": { "privacy_status": "private" }
}

Environment variables loaded from .env:

FREELLAPI_KEY=freellmapi-xxx
PEXELS_API_KEY=xxx
GEMINI_API_KEY=xxx
# etc.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    PipelineOrchestrator                       │
│  (state management, cancellation, threading, config reload)  │
└──────────────────────────┬──────────────────────────────────┘
                           │
       ┌───────────────────┼───────────────────┐
       ▼                   ▼                   ▼
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  Research   │    │   Scraper   │    │   Idea Gen  │
│  (LLM)      │    │  (HTTP)     │    │  (LLM+JSON) │
└──────┬──────┘    └──────┬──────┘    └──────┬──────┘
       │                  │                  │
       ▼                  ▼                  ▼
┌─────────────────────────────────────────────────────────────┐
│                      Scriptwriter (LLM)                     │
└──────────────────────────┬──────────────────────────────────┘
                           │
       ┌───────────────────┼───────────────────┐
       ▼                   ▼                   ▼
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  Voiceover  │    │  Visuals    │    │    Guide    │
│  (Edge/OV)  │    │ (Pexels/SD) │    │  (LLM+HTML) │
└──────┬──────┘    └──────┬──────┘    └──────┬──────┘
       │                  │                  │
       ▼                  ▼                  ▼
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│ Audio Gen   │    │  Assembly   │    │  Guide      │
│ (Stable     │    │ (FFmpeg)    │    │  Deploy     │
│  Audio 3)   │    │             │    │  (GitHub)   │
└──────┬──────┘    └──────┬──────┘    └──────┬──────┘
       │                  │                  │
       ▼                  ▼                  ▼
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│   Shorts    │    │  Upload     │    │ Community   │
│  (Scene     │    │ (YouTube)   │    │  Posts      │
│  select)    │    │             │    │             │
└─────────────┘    └─────────────┘    └─────────────┘

All LLM calls route through FreeLLMAPI → automatic provider failover, penalty tracking, system prompt injection.


Provider Abstraction

Capability Providers Fallback Chain
LLM Gemini, Cerebras, Groq, Z.ai, LM Studio FreeLLMAPI router
TTS OmniVoice, Edge TTS VoiceoverAgent
Images SD WebUI, Pollinations, Gemini, Fal VisualAssetAgent
Video Fal (Hunyuan), Kling, Veo, Pexels VideoProviderManager
BGM Stable Audio 3 AudioGenAgent
Stock Pexels VisualAssetAgent

Development

# Clone
git clone https://github.com/bgill55/youtube-factory-pipeline.git
cd youtube-factory-pipeline

# Install in editable mode with dev deps
pip install -e ".[dev]"

# Run tests
pytest tests/

# Lint
ruff check src/
mypy src/youtube_factory/

Related Projects

  • FreeLLMAPI — The unified LLM router this pipeline depends on
  • OmniVoice-Studio — Local TTS service
  • YouTube Factory — Full production deployment (Flask dashboard, scheduler, bootstrap scripts)

License

MIT © 2026 bgill55


Disclaimer

This is the orchestration library only.
You must run the required external services yourself:

  • FreeLLMAPI (port 3001)
  • OmniVoice-Studio (port 3900)
  • Stable Diffusion WebUI --api (port 7860)
  • FFmpeg (system binary)

See the main YouTube Factory repo for Docker Compose, bootstrap scripts, and the Flask dashboard.

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

youtube_factory_pipeline-0.1.0.tar.gz (116.9 kB view details)

Uploaded Source

Built Distribution

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

youtube_factory_pipeline-0.1.0-py3-none-any.whl (127.1 kB view details)

Uploaded Python 3

File details

Details for the file youtube_factory_pipeline-0.1.0.tar.gz.

File metadata

  • Download URL: youtube_factory_pipeline-0.1.0.tar.gz
  • Upload date:
  • Size: 116.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for youtube_factory_pipeline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d58dcb08acb15b2e9de4448dba9186eb4d7650785bb6844f474933c6d89722b3
MD5 61bbc8f0239f2e0ac4b1e5e027f16cd8
BLAKE2b-256 b711de538647fa974eaa201a1c747e6046167d33c48825a8afc52d17ba60a1ed

See more details on using hashes here.

File details

Details for the file youtube_factory_pipeline-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_factory_pipeline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48240e93efa9668a2c543db176f3ef6b9a636db207a966721fdfc1bfd4c1e980
MD5 4082a3d9ad00acf6ab1b4efa6326d3b7
BLAKE2b-256 e873bf90cff683f22e0ec684a2659653718731277f2871b71f6db32b62670984

See more details on using hashes here.

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