English · 简体中文
A .NET 8 reference sample: JSON in → LLM storyboard → .pptx out (25–30 slides, one coherent narrative).
Learn OpenAI-compatible LLM clients, DI, validation/retry, cost metrics, and a stable CLI contract for other apps.
Educational reference implementation—not a hosted SaaS. Trademarks (OpenAI, DashScope, etc.) belong to their owners.
- Developers learning production-style LLM integration (structured JSON, retries, provider abstraction, metrics).
- Teams that need on-prem / private gateways (LiteLLM, vLLM) and a callable CLI or .NET library—not another chat UI.
- Anyone building document pipelines who wants deterministic rendering separate from the model.
- Replacing Gamma, Copilot, WPS AI, or similar products on slide polish and design out of the box.
- No-code users who only want a website button—this is a repo you build and configure.
- 30 separate LLM calls per deck or multi-agent “designer” demos—we intentionally use one plan JSON + local Open XML.
| Topic | What you can learn |
|---|---|
| LLM boundary | ILlmClient, single completion → structured JSON |
| Providers | One OpenAiCompatibleClient; presets + LiteLLM / private gateways |
| Reliability | Parse, validate, retry; Stub for CI without API keys |
| Integration | Exit codes, --json, stdin -i - |
| Rendering | Deterministic Open XML layouts (not “LLM draws pixels”) |
- .NET 8 SDK
- Optional: any OpenAI-compatible Chat Completions API key. Without a key, Stub LLM runs offline.
cd CraftPPT
dotnet build CraftPPT.sln -c ReleaseConnection (CraftPPT:Llm) is shared by the whole CLI. Profiles (Quality / Balanced) only change model, tokens, and retry—same provider.
Copy appsettings.example.json to src/CraftPPT.Cli/appsettings.json and set ApiKey locally (do not commit), or use:
export CRAFTPPT_LLM_API_KEY="sk-..."Preset |
Default base URL | Notes |
|---|---|---|
DashScope |
Alibaba compatible-mode | Qwen |
DeepSeek |
api.deepseek.com | |
OpenAI |
api.openai.com/v1 | |
LiteLlmProxy |
set BaseUrl |
LiteLLM / corporate gateway |
Custom |
set BaseUrl |
vLLM, Ollama OpenAI shim, etc. |
Optional cost table: CraftPPT:Pricing (InputPerM / OutputPerM per model). See docs/providers.md.
dotnet run --project src/CraftPPT.Cli/CraftPPT.Cli.csproj -c Release -- \
-i samples/01-python-intro.json \
-o out/demo-quality.pptx \
-p quality-p quality— stronger model / more tokens (beauty-first profile)-p balanced— cost/latency trade-off
| Exit code | Meaning |
|---|---|
0 |
Success |
1 |
Args, profile, input JSON |
2 |
LLM / plan validation |
3 |
IO, file write, LLM config |
Use --json for a single JSON line on stdout (logs at Warning). Details: docs/cli-contract.md.
.NET in-process: reference CraftPPT.Core + CraftPPT.Pptx, AddCraftPptCore, PresentationGenerator.GenerateAsync.
{
"topic": "Your topic",
"brief": "Short brief (≤500 chars)",
"audience": "Who will watch"
}Samples: samples/ (including 06-english-intro.json).
| Project | Role |
|---|---|
CraftPPT.Core |
Models, LLM, planning, validation, generator |
CraftPPT.Pptx |
Open XML deck writer |
CraftPPT.Cli |
Command-line entry |
Windows: .\scripts\run-all.ps1
Linux / macOS: chmod +x scripts/run-all.sh && ./scripts/run-all.sh
Outputs under demos/ (gitignored) and demos/metrics.csv. Full steps: TESTING.md · TESTING.zh-CN.md.
Full index: docs/README.md · docs/README.zh-CN.md
| Doc | |
|---|---|
| docs/product-requirements.md | Scope & acceptance criteria |
| docs/architecture.md | Pipeline & design tokens |
| docs/providers.md | Presets, gateways, private deploy |
| docs/cli-contract.md | JSON schema & exit codes |
| DESIGN.md | Design decisions & evolution |
| TESTING.md | Verify locally & metrics |
| docs/support.md | Sponsorship & consulting (individual) |
CraftPPT is free (MIT), maintained by an individual. Optional: Star, contribute, or voluntary sponsor (GitHub Sponsors / QR tips). Tips do not buy priority on public Issues.
Paid help (freelance): on-prem LLM setup, custom layouts, integration, workshops — docs/support.md. Edit contact email in that doc before publish.
中文(个人维护、自愿打赏、定制咨询):docs/support.zh-CN.md.
CONTRIBUTING.md · CODE_OF_CONDUCT.md · GOVERNANCE.md
License: MIT.
- Multi-tenant SaaS, web editor, or Gamma/Tome-style hosted product
- Native Claude/Gemini SDKs in-tree (use OpenAI-compatible gateways)
- Per-slide LLM calls for 30 pages (we use one plan JSON + local render)
Do not commit secrets. Report sensitive issues per SECURITY.md.