$git clone https://github.com/myccarl/ai-shortVideo-pipeline> An end-to-end automated short-video production pipeline. One command in, a publish-ready video out.
| 1 | # myAiVideos |
| 2 | |
| 3 | > An end-to-end automated short-video production pipeline. One command in, a publish-ready video out. |
| 4 | |
| 5 | **English** | [简体中文](README.zh-CN.md) |
| 6 | |
| 7 | [](LICENSE) |
| 8 | |
| 9 | ## Overview |
| 10 | |
| 11 | `myAiVideos` is an open-source engineering project for automated Chinese-language short-video production, covering the full pipeline from **topic discovery → creative generation → visuals → audio → post-production → distribution**. It uses FastAPI as the orchestration core and a Java gateway as the platform governance layer (auth / routing / circuit breaker / metering / observability), coordinating multiple AI models for generation and quality gating. |
| 12 | |
| 13 | Suitable content formats: |
| 14 | |
| 15 | - Hot-news commentary |
| 16 | - Knowledge explainers |
| 17 | - Emotional storytelling |
| 18 | - Curiosity / strange facts |
| 19 | - Social insight clips |
| 20 | |
| 21 | ## Key Features |
| 22 | |
| 23 | - **Seven-layer pipeline architecture**: Topic (L1) → Creative (L2) → Visual (L3) → Audio (L4) → Post-production (L5) → Distribution (L6) → Optimization (L7). Layers are decoupled and independently replaceable. |
| 24 | - **Multi-model failover + circuit breaker**: Java gateway aggregates DeepSeek / Qwen / GLM with Resilience4j protection; failed providers are automatically rotated. |
| 25 | - **AI consistency governance** |
| 26 | - Prompt anchoring: maintain visual identity of subjects across video segments |
| 27 | - CLIP text-image consistency gating: reject off-prompt keyframes early |
| 28 | - Audio-video sync auto-rescue: 4-tier strategy (audio tempo / video pad / narration rewrite) |
| 29 | - **Full-stack observability**: `trace_id` propagated across Java/Python; Langfuse call-tree visibility. |
| 30 | - **Metering & rate limiting**: AOP aspect captures token / cost without code changes, aggregated by tenant. |
| 31 | - **Production-ready**: SSE progress streaming, single-segment regeneration, rolling log archives. |
| 32 | |
| 33 | ## Tech Stack |
| 34 | |
| 35 | | Layer | Components | |
| 36 | |---|---| |
| 37 | | Orchestration (Python) | FastAPI · asyncio · Pydantic · SQLAlchemy (asyncpg) · Alembic · ARQ | |
| 38 | | Gateway (Java) | Spring Boot 3.5 · WebClient · Resilience4j · Caffeine · Prometheus | |
| 39 | | Frontend | Vue 3 · Vite · Vue Flow · Pinia · Tailwind | |
| 40 | | Data | PostgreSQL · Redis · MinIO | |
| 41 | | Observability | Langfuse · cross-language trace context | |
| 42 | | AI Models | DeepSeek · Zhipu GLM-4V · Kling v2.5 · Volcengine / MiniMax TTS · faster-whisper | |
| 43 | | Containers | Docker Compose | |
| 44 | |
| 45 | ## Architecture |
| 46 | |
| 47 | ``` |
| 48 | +----------------+ |
| 49 | | Client / Bot | |
| 50 | +--------+-------+ |
| 51 | | |
| 52 | +--------v-------+ |
| 53 | | Java Gateway | JWT / TraceId / Router / Breaker / Meter |
| 54 | +--------+-------+ |
| 55 | | |
| 56 | +--------v-------+ |
| 57 | | FastAPI orch. | webhook · session · job orchestration |
| 58 | +--+---------+---+ |
| 59 | | | |
| 60 | +----------v---+ +-v-----------+ |
| 61 | | ARQ Worker | | 7-layer | |
| 62 | +-----+--------+ | pipeline | |
| 63 | | +-+-----------+ |
| 64 | | | |
| 65 | +----------v--+ +------v-----------------+ |
| 66 | | Redis(queue)| | DeepSeek / Kling / TTS | |
| 67 | +-------------+ +------------------------+ |
| 68 | ``` |
| 69 | |
| 70 | For details, see [`architecture.md`](architecture.md). |
| 71 | |
| 72 | ## Quick Start |
| 73 | |
| 74 | ### Prerequisites |
| 75 | |
| 76 | - Docker Desktop ≥ 24 |
| 77 | - Node.js ≥ 20 (only for frontend development) |
| 78 | - Python ≥ 3.11 (only if running locally without Docker, or running tests on host) |
| 79 | |
| 80 | ### One-Click Start |
| 81 | |
| 82 | ```bash |
| 83 | # 1. Clone and prepare env |
| 84 | git clone <your-fork>.git |
| 85 | cd myAiVideos |
| 86 | cp .env.example .env |
| 87 | # Edit .env to fill in at least the required AI provider API keys. |
| 88 | |
| 89 | # 2. Start backend (postgres + redis + orchestrator + worker) |
| 90 | docker compose up -d postgres redis orchestrator worker |
| 91 | |
| 92 | # 3. Run database migrations |
| 93 | docker compose exec -T orchestrator alembic upgrade head |
| 94 | |
| 95 | # 4. (Optional) Start Java gateway |
| 96 | docker compose up -d gateway |
| 97 | |
| 98 | # 5. Start frontend |
| 99 | cd sl-vue && npm install && npm run dev |
| 100 | ``` |
| 101 | |
| 102 | Health check |