# MoneyPrinterTurbo: AI-Powered Automated Short Video Generation Platform Explained

> Discover MoneyPrinterTurbo an open-source AI platform that automates short video creation. It converts text prompts into edited videos using LLM script generation TTS subtitles and auto composition.

- Repository: [Harry/MoneyPrinterTurbo](https://github.com/harry0703/MoneyPrinterTurbo)
- Tags: deep-dive
- Published: 2026-03-23

---

**MoneyPrinterTurbo is an open-source Python application that transforms text prompts into fully edited short-form videos by orchestrating LLM script generation, text-to-speech synthesis, subtitle creation, and automated video composition.**

MoneyPrinterTurbo is an AI video generation platform that automates the entire short-video creation pipeline. Written in Python, it integrates large language models, multiple TTS providers, and video editing libraries to convert simple keywords into publish-ready portrait (9:16) or landscape (16:9) content. The project provides both a FastAPI backend and a Streamlit web interface, making it accessible to developers and content creators alike.

## What Is MoneyPrinterTurbo?

MoneyPrinterTurbo is a turnkey solution for automated video generation. It accepts a **video subject** or keyword, uses AI to write a script, synthesizes voice audio, matches stock footage, adds subtitles, and renders a final MP4 file. The architecture separates concerns into distinct layers: web serving, API controllers, task management, and service logic.

The system supports multiple LLM providers (OpenAI, Azure, DeepSeek) and TTS engines, allowing users to configure their preferred AI models via [`config.example.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.example.toml). It handles concurrent processing through either an in-memory queue or Redis-backed task management, depending on deployment requirements.

## Architecture and Core Components

### Web Entry Point and Routing

The application bootstrap begins in **[`main.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/main.py)**, which launches a FastAPI server using `uvicorn.run()`. All API routes are aggregated in **[`app/router.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/router.py)**, which registers versioned endpoints under `/api/v1/*`. This includes the video generation router (`video.router`) and LLM utility router (`llm.router`).

### Controllers and API Layer

HTTP request handling resides in the controllers layer:

- **[`app/controllers/v1/video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/v1/video.py)** – Handles `POST /videos` for creating tasks, listing active jobs, deleting tasks, and uploading background music or custom video materials via dedicated endpoints.
- **[`app/controllers/v1/llm.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/v1/llm.py)** – Exposes endpoints for `generate_script` and `generate_terms`, validating requests against Pydantic schemas defined in **[`app/models/schema.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/models/schema.py)**.

### Task Management System

To prevent resource exhaustion, MoneyPrinterTurbo implements a task manager pattern. By default, it uses **[`app/controllers/manager/in_memory_task_manager.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/manager/in_memory_task_manager.py)** to track job state. For distributed deployments, setting `enable_redis=True` switches to **[`redis_task_manager.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/redis_task_manager.py)**, storing task metadata in Redis instead of process memory.

### Service Layer Implementation

The core business logic resides in the services directory:

- **[`app/services/llm.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/services/llm.py)** – Wraps provider-specific APIs (OpenAI, Azure, DeepSeek) to generate video scripts and extract key terms for material search.
- **[`app/services/voice.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/services/voice.py)** – Orchestrates text-to-speech synthesis across multiple providers, converting the generated script into synchronized audio.
- **[`app/services/subtitle.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/services/subtitle.py)** – Generates SRT subtitle files with precise timestamps matching the audio track.
- **[`app/services/video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/services/video.py)** – Handles the heavy lifting of `combine_videos` (stitching short clips) and `generate_video` (compositing subtitles, background music, and transitions).

### Frontend Interface

End users interact via **[`webui/Main.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/webui/Main.py)**, a Streamlit application that consumes the FastAPI endpoints. The UI provides fields for topic input, language selection, aspect ratio configuration, and voice preview, abstracting the REST API into a point-and-click experience.

## End-to-End Video Generation Workflow

When a client sends a request to `POST /videos`, the system executes the following pipeline:

1. **Script Generation** – The controller calls `llm.generate_script` with the user-provided subject and language parameters.
2. **Term Extraction** – `llm.generate_terms` analyzes the script to identify keywords for stock footage retrieval.
3. **Material Acquisition** – The service downloads relevant stock clips or uses user-uploaded assets from `/video_materials`.
4. **Voice Synthesis** – `voice.synthesize` generates the narration audio using the configured TTS provider and model.
5. **Subtitle Creation** – `subtitle.generate_srt` builds timestamped subtitle files aligned with the audio.
6. **Video Composition** – `video.combine_videos` assembles a playlist of clips (maximum 5 seconds each), applies requested transitions, and resizes to the target aspect ratio.
7. **Final Rendering** – `video.generate_video` overlays subtitle TextClips, mixes in background music (random selection or uploaded MP3), adjusts audio levels, and writes the final MP4.
8. **Task Completion** – The task ID and file URI are stored in the task manager (memory or Redis), and the API returns JSON metadata including download paths.

## Installation and Usage Examples

### Starting the FastAPI Server

After configuring API keys in [`config.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.toml) (copied from [`config.example.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.example.toml)), launch the backend:

```bash
python main.py

# or explicitly

uvicorn main:app --host 0.0.0.0 --port 8080

```

### Generating Videos via REST API

Create a video task using the `/videos` endpoint:

```bash
curl -X POST http://127.0.0.1:8080/videos \
     -H "Content-Type: application/json" \
     -d '{
           "video_subject": "How to boost your productivity",
           "video_language": "en",
           "video_aspect": "portrait",
           "video_concat_mode": "random",
           "video_transition_mode": "fade_in",
           "bgm_type": "random",
           "subtitle_enabled": true,
           "voice_provider": "openai",
           "voice_model": "tts-1"
         }'

```

The response includes a `task_id` for tracking:

```json
{
  "status": 200,
  "data": {
    "task_id": "c6b5e2a1-3f4b-4d7a-9e1c-2b7f6d5e9a1f",
    "request_id": "req-168...",
    "params": { }
  }
}

```

### Python Client Implementation

Automate video creation and retrieval using Python:

```python
import requests
import time

API = "http://127.0.0.1:8080"

# Create the video task

payload = {
    "video_subject": "Why cats are awesome",
    "video_language": "en",
    "video_aspect": "portrait",
}
resp = requests.post(f"{API}/videos", json=payload)
task_id = resp.json()["data"]["task_id"]

# Poll until completion

while True:
    r = requests.get(f"{API}/tasks/{task_id}")
    info = r.json()["data"]
    if info.get("videos"):
        print("Video ready:", info["videos"][0])
        break
    print("Processing...", info["status"])
    time.sleep(5)

# Download the result

video_data = requests.get(info["videos"][0]).content
open("final.mp4", "wb").write(video_data)

```

### Using the Streamlit Web Interface

Launch the frontend for interactive use:

```bash

# Windows

webui.bat

# Linux/macOS

sh webui.sh

```

Navigate to `http://localhost:8501`, enter a **Video Subject**, select language and aspect ratio, then click generate. The interface displays the AI-generated script, provides voice previews, and offers one-click downloads of the rendered video.

## Configuration and Customization

All provider credentials and hardware limits are managed in **[`config.example.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.example.toml)**. Key configuration sections include:

- **LLM Provider** – Select between OpenAI, Azure, DeepSeek, or other compatible APIs.
- **Voice Settings** – Configure TTS providers (OpenAI, Edge TTS, etc.) and default voice models.
- **Hardware Limits** – Set maximum concurrent tasks and Redis connection parameters.
- **Storage** – Define local paths for temporary files and final video outputs.

## Summary

- **MoneyPrinterTurbo** automates short-form video creation by combining LLM script writing, text-to-speech, subtitle generation, and video composition.
- The **FastAPI** backend in [`main.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/main.py) exposes REST endpoints defined in [`app/controllers/v1/video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/v1/video.py) and [`app/controllers/v1/llm.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/v1/llm.py).
- **Task management** supports both in-memory and Redis-backed queues to handle concurrent generation jobs.
- Core services in `app/services/` handle AI generation ([`llm.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/llm.py)), voice synthesis ([`voice.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/voice.py)), subtitles ([`subtitle.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/subtitle.py)), and final rendering ([`video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/video.py)).
- The **Streamlit** frontend in [`webui/Main.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/webui/Main.py) provides a non-technical interface for the same API functionality.
- Users configure providers and limits via [`config.example.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.example.toml) before deployment.

## Frequently Asked Questions

### What video formats does MoneyPrinterTurbo support?

The platform outputs MP4 files in either **portrait (9:16)** or **landscape (16:9)** aspect ratios. The `video_aspect` parameter in the API request controls this setting, and the [`video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/video.py) service handles the resizing and padding logic to ensure compatibility with platforms like TikTok, YouTube Shorts, and Instagram Reels.

### Which LLM providers work with MoneyPrinterTurbo?

According to the source code in [`app/services/llm.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/services/llm.py), the system supports **OpenAI**, **Azure OpenAI**, **DeepSeek**, and other OpenAI-compatible endpoints. Configuration is provider-agnostic; users specify the base URL and API key in [`config.toml`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/config.toml) to route requests to their preferred model.

### Can I use custom video clips instead of stock footage?

Yes. The API exposes endpoints in [`app/controllers/v1/video.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/v1/video.py) for uploading custom materials to the `/video_materials` directory. When generating a video, set the material source to use uploaded files rather than fetching stock footage, allowing complete control over the visual content while maintaining automated script and audio generation.

### How does MoneyPrinterTurbo handle concurrent video generation?

The system uses a task manager pattern to limit resource usage. By default, **[`app/controllers/manager/in_memory_task_manager.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/app/controllers/manager/in_memory_task_manager.py)** tracks jobs in application memory. For production deployments, enabling Redis in the configuration switches to **[`redis_task_manager.py`](https://github.com/harry0703/MoneyPrinterTurbo/blob/main/redis_task_manager.py)**, which persists task state externally and allows multiple server instances to share a single job queue.