AI-powered presentation generator. Enter a creative brief, get a polished, editable .pptx — a Flask backend renders real PowerPoint files with python-pptx, driven by a configurable LLM (or a dependency-free local fallback when no AI provider is configured).
developed by DG
- Local installation
- Virtual environment setup
- Installing dependencies
- Running locally
- Environment variables
- Render deployment
- API usage
- JSON schema example
- Example curl request
- Project architecture
- Adding a new slide layout
git clone <your-fork-url> the-ppt-makers
cd the-ppt-makerspython3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txt# Dev server (auto-reload with FLASK_DEBUG=1)
python app.py
# or, closer to production:
gunicorn app:app --bind 0.0.0.0:5000Visit http://localhost:5000. Without any AI_* environment variables set, the app runs on its local fallback generator — fully functional, no external calls, no API key required. This is intentional: the app should never be broken out of the box.
| Variable | Required | Description |
|---|---|---|
PORT |
On Render (auto-set) | Port the Flask app binds to. Defaults to 5000 locally. |
AI_BASE_URL |
No | Base URL of an OpenAI-compatible chat-completions API, e.g. https://api.openai.com/v1. If unset, the local fallback generator is used. |
AI_API_KEY |
No | API key for the configured provider. Never hardcode this — set it as an environment variable only. |
AI_MODEL |
No | Model name to request, e.g. gpt-4o-mini, claude-sonnet-4-6 (via an OpenAI-compatible gateway), or any model your provider exposes. |
MAX_CONTENT_LENGTH_BYTES |
No | Max request body size in bytes. Defaults to 2097152 (2 MB). |
FLASK_DEBUG |
No | Set to 1 for Flask's dev auto-reload. Never enable in production. |
The app never sends API keys to the frontend — all AI calls happen server-side in prompts.py.
Provider flexibility: call_llm() in prompts.py targets a standard {AI_BASE_URL}/chat/completions endpoint with an OpenAI-compatible request/response shape. This works directly with OpenAI, OpenRouter, most self-hosted OpenAI-compatible gateways (vLLM, LiteLLM, Ollama's OpenAI shim), and Anthropic via an OpenAI-compatible proxy. Swapping providers is a config change, not a code change.
This repo includes render.yaml for one-click infrastructure-as-code deployment.
- Push this repo to GitHub.
- In the Render dashboard: New → Blueprint, point it at your repo. Render will read
render.yamlautomatically. - Set
AI_BASE_URL,AI_API_KEY, andAI_MODELas environment variables in the Render dashboard (they're markedsync: falseinrender.yamlso they're never committed to source control). - Deploy. Render builds with
pip install -r requirements.txtand starts with:gunicorn app:app --bind 0.0.0.0:$PORT --workers 2 --timeout 120
The app binds to 0.0.0.0 and reads PORT from the environment, as required by Render Web Services.
If you'd rather configure the service by hand in the Render dashboard:
- Runtime: Python 3.12
- Build command:
pip install -r requirements.txt - Start command:
gunicorn app:app --bind 0.0.0.0:$PORT
Returns service status and whether an AI provider is currently configured.
{ "status": "ok", "service": "the-ppt-makers", "version": "1.0.0", "ai_configured": true }Generates just the structured JSON presentation plan (no file rendering). Used by the frontend to drive the live preview before the user downloads.
Request:
{ "config": { "title": "...", "audience": "...", "goal": "...", "slide_count": 10, "brief": "..." } }Response: { "spec": { ...full presentation JSON, see schema below... } }
Generates and returns a downloadable .pptx file. Accepts two modes:
Mode "brief" — full pipeline: AI (or fallback) generates the plan, then it's rendered.
{ "mode": "brief", "config": { "title": "...", "brief": "...", "slide_count": 10 } }Mode "spec" — render a presentation spec you already have (e.g. one edited client-side after /api/plan, or hand-written).
{ "mode": "spec", "spec": { "title": "...", "slides": [ ... ] } }On success: binary .pptx response with Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation and a Content-Disposition download header. On failure: JSON { "error": "...", "details": [...] } with an appropriate 4xx/5xx status. No internal file paths or stack traces are ever included in responses.
This is the presentation spec produced by the AI architect (prompts.py) and consumed by the renderer (ppt_generator.py + layouts.py):
{
"title": "Series A Pitch — Aurora Energy",
"subtitle": "Accelerating the distributed solar transition",
"audience": "Seed investors",
"goal": "Secure Series A funding",
"theme": { "mood": "confident", "primary": "#6C5CE7", "secondary": "#00D9C0" },
"slides": [
{
"type": "hero",
"eyebrow": "Overview",
"title": "Aurora Energy",
"subtitle": "Helping utilities integrate distributed solar at scale."
},
{
"type": "metrics",
"title": "Traction",
"items": [
{ "value": "3", "label": "Pilot utilities signed" },
{ "value": "80%", "label": "Battery cost drop since 2015" }
]
},
{
"type": "closing",
"title": "Thank you",
"subtitle": "Questions & discussion"
}
]
}Valid slide type values: hero, statement, cards, process, timeline, comparison, quote, metrics, image, closing. See prompts.py's SLIDE_TYPE_GUIDE for what each expects in items.
curl -X POST http://localhost:5000/api/generate \
-H "Content-Type: application/json" \
-d '{
"mode": "brief",
"config": {
"title": "Q3 Growth Strategy",
"audience": "Leadership team",
"goal": "Align on Q3 priorities",
"slide_count": 8,
"style": "modern",
"tone": "confident",
"brief": "Revenue grew 22% QoQ. Churn dropped to 3.1%. Doubling down on enterprise sales. Hiring 4 new AEs next quarter. Key risk is onboarding capacity."
}
}' \
--output presentation.pptxthe-ppt-makers/
├── app.py Flask routes: /, /api/health, /api/plan, /api/generate
├── ppt_generator.py Validation + render pipeline (spec JSON -> .pptx)
├── layouts.py Visual design system: add_* components, render_* slide types
├── prompts.py AI architect: system prompt, provider call, schema validation, local fallback
├── requirements.txt
├── render.yaml
├── templates/
│ └── index.html Frontend shell (sidebar, config form, preview panel)
└── static/
├── style.css Design tokens + full responsive layout
└── app.js Form handling, generation flow, live preview rendering
Pipeline:
Frontend config
│
▼
POST /api/generate (or /api/plan for preview-only)
│
▼
prompts.generate_presentation_plan()
│ if AI configured → call_llm() → parse_and_validate_llm_output()
│ else / on failure → local_fallback_plan()
▼
validated presentation spec (JSON)
│
▼
ppt_generator.build_presentation()
│ for each slide: layouts.RENDERERS[type](...)
▼
python-pptx Presentation object
│
▼
.pptx bytes → send_file() → browser download
The LLM never outputs Python or raw slide coordinates — only structured JSON describing semantic slide content (type, title, items, etc). All visual decisions (spacing, color, typography, shapes) live in layouts.py, so the design system stays consistent regardless of what the model generates, and can be restyled globally without touching the AI prompt.
- Design it in
layouts.py: write arender_my_type(prs, spec, theme, idx, total)function using the existingadd_*helpers (add_card,add_title,add_metric, etc.) or new ones if needed. Follow the pattern of existing renderers — background, header/eyebrow, content, footer, slide number. - Register it: add
"my_type": render_my_typeto theRENDERERSdict at the bottom oflayouts.py. - Document it for the AI: add a line to
SLIDE_TYPE_GUIDEinprompts.pydescribing when to use it and what fields it expects initems. - Add a preview mapping (optional but recommended): extend
miniSlideMarkup()instatic/app.jswith a case for"my_type"so the live preview shows something reasonable before download. - Test: validate a spec containing your new type against
validate_presentation_spec(), then render it withbuild_presentation()and confirm the.pptxopens correctly.
No other files need to change — ppt_generator.py's VALID_SLIDE_TYPES is derived automatically from RENDERERS.keys().
- No API keys are ever exposed to frontend JavaScript — all AI calls happen server-side.
- Generated files are streamed from memory (
io.BytesIO); no user-controlled filesystem paths are ever accepted or exposed. - Request bodies are size-limited (
MAX_CONTENT_LENGTH_BYTES) and slide counts are server-side clamped regardless of client input. - No user-provided Python or arbitrary code is ever executed.
- Malformed JSON, LLM failures, and rendering failures all return clean JSON errors — never stack traces.