Skip to content

Repository files navigation

CraftPPT

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.

Who this is for

  • 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.

Who this is not for

  • 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.

Why this repo

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”)

Requirements

  • .NET 8 SDK
  • Optional: any OpenAI-compatible Chat Completions API key. Without a key, Stub LLM runs offline.

Build

cd CraftPPT
dotnet build CraftPPT.sln -c Release

Configure LLM

Connection (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.

Quick demo

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

CLI contract (for automation)

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.

Input JSON

{
  "topic": "Your topic",
  "brief": "Short brief (≤500 chars)",
  "audience": "Who will watch"
}

Samples: samples/ (including 06-english-intro.json).

Solution layout

Project Role
CraftPPT.Core Models, LLM, planning, validation, generator
CraftPPT.Pptx Open XML deck writer
CraftPPT.Cli Command-line entry

Batch run & metrics

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.

Docs

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)

Support & consulting

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

CONTRIBUTING.md · CODE_OF_CONDUCT.md · GOVERNANCE.md
License: MIT.

Non-goals

  • 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)

Security

Do not commit secrets. Report sensitive issues per SECURITY.md.

About

Generate PowerPoint decks from JSON using .NET 8, OpenAI-compatible LLMs, and deterministic Open XML rendering.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages