Skip to main content

Local-first conversion of native scientific PDFs into editable Beamer decks.

Project description

pdf2beamer

pdf2beamer is a local-first Python package for converting native scientific PDF papers into editable, compilable Beamer presentations.

The project is intentionally structured around inspectable intermediate representations:

PDF -> PaperIR -> ArgumentGraph -> DeckPlan -> SlideIR -> Beamer

The package defines strict Pydantic v2 data models and keeps real Docling, PyMuPDF, Nemotron generation, validation, rendering, and compilation behind local integration points.

Constraints

  • No external API calls.
  • No OCR or scanned-PDF fallback.
  • Local Nemotron generation plus Qwen embedding/reranking adapters are dependency-injected.
  • LLM components generate structured JSON only.
  • Beamer is rendered deterministically from SlideIR.

Public API Sketch

from pdf2beamer import PdfToBeamerPipeline, PipelineConfig

config = PipelineConfig(
    model_path="./models/nemotron-3-nano-4b-gguf/NVIDIA-Nemotron-3-Nano-4B-Q4_K_M.gguf",
    embedding_model_path="./models/Qwen3-Embedding-0.6B",
    reranker_model_path="./models/Qwen3-Reranker-0.6B",
    duration_minutes=10,
    audience="technical",
    theme="clean",
)

pipeline = PdfToBeamerPipeline(config)
result = pipeline.generate("paper.pdf", "out/")

Local Models

Real model and PDF backends are optional. The base package imports without installing heavy extraction or model dependencies, and the library never downloads model files at runtime.

Install the extras you need:

pip install -e ".[pdf,docling,latex,models]"

Expected local files, auto-detected by --real-models when present:

  • Generation: models/nemotron-3-nano-4b-gguf/NVIDIA-Nemotron-3-Nano-4B-Q4_K_M.gguf
  • Embedding: models/Qwen3-Embedding-0.6B
  • Reranking: models/Qwen3-Reranker-0.6B

You can override paths with --model, --embedding, or --reranker.

Model files are local assets and should not be committed. Store them under models/; .gitignore excludes models/ and common model-weight formats.

Download Models From Hugging Face

Install the models extra, which includes Hugging Face download tooling:

pip install -e ".[pdf,docling,latex,models]"

If your Hugging Face account needs access to a model, authenticate once:

hf auth login

Download the expected local model layout:

mkdir -p models/nemotron-3-nano-4b-gguf \
  models/Qwen3-Embedding-0.6B \
  models/Qwen3-Reranker-0.6B

hf download nvidia/NVIDIA-Nemotron-3-Nano-4B-GGUF \
  NVIDIA-Nemotron-3-Nano-4B-Q4_K_M.gguf \
  --local-dir models/nemotron-3-nano-4b-gguf

hf download Qwen/Qwen3-Embedding-0.6B \
  --local-dir models/Qwen3-Embedding-0.6B

hf download Qwen/Qwen3-Reranker-0.6B \
  --local-dir models/Qwen3-Reranker-0.6B

Quick local check:

test -f models/nemotron-3-nano-4b-gguf/NVIDIA-Nemotron-3-Nano-4B-Q4_K_M.gguf
test -d models/Qwen3-Embedding-0.6B
test -d models/Qwen3-Reranker-0.6B
git check-ignore -v models/nemotron-3-nano-4b-gguf/NVIDIA-Nemotron-3-Nano-4B-Q4_K_M.gguf

Then run with real local models. Use --no-compile if you only want the editable out/main.tex file:

uv run --extra pdf --extra docling --extra models pdf2beamer generate paper.pdf --real-models --no-compile

LaTeX Compilation

pdf2beamer always writes out/main.tex. To also produce out/main.pdf, install a TeX distribution that provides the latexmk command, then run without --no-compile.

Debian/Ubuntu:

sudo apt update
sudo apt install latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended

Windows:

winget install --id MiKTeX.MiKTeX --exact
winget install --id StrawberryPerl.StrawberryPerl --exact

MiKTeX provides the TeX toolchain, and latexmk needs Perl on Windows. Restart the terminal after installation so the updated PATH is visible.

macOS:

brew install --cask mactex-no-gui

Check that latexmk is available:

latexmk --version

Compile during generation:

uv run --extra pdf --extra docling --extra models pdf2beamer generate paper.pdf --real-models

Fake-model command for lightweight local development:

pdf2beamer generate paper.pdf \
  --use-fake-models \
  --duration 10 \
  --output out/

Real local-model command:

pdf2beamer generate paper.pdf \
  --real-models \
  --duration 10 \
  --audience technical \
  --output out/

Structured GGUF Output

The GGUF generator is exposed as LocalNemotronGenerator and loads a local Nemotron instruct GGUF through llama-cpp-python. For ArgumentGraph and SlideIR, it first tries Instructor's local llama-cpp-python integration:

instructor.patch(
    create=llama.create_chat_completion_openai_v1,
    mode=instructor.Mode.JSON_SCHEMA,
)

This path returns Pydantic response models directly and retries validation failures. If Instructor or the OpenAI-compatible llama.cpp method is unavailable, the generator falls back to llama.cpp response_format JSON schema/object mode, then to strict JSON parsing.

CLI controls:

pdf2beamer generate paper.pdf \
  --real-models \
  --instructor \
  --instructor-max-retries 2 \
  --no-compile \
  --output out/

Disable Instructor and use llama.cpp response format fallback:

pdf2beamer generate paper.pdf --real-models --no-instructor --output out/
  1. 12_quality_report.json - synthese qualite finale.
  2. assets/ - images extraites du PDF et reutilisables dans les slides.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf2beamer-0.1.0.tar.gz (68.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf2beamer-0.1.0-py3-none-any.whl (90.6 kB view details)

Uploaded Python 3

File details

Details for the file pdf2beamer-0.1.0.tar.gz.

File metadata

  • Download URL: pdf2beamer-0.1.0.tar.gz
  • Upload date:
  • Size: 68.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdf2beamer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e30839be88317ab1a66aea1dfdec63768d50e48a721bb67d2d89da9e5cdde4b8
MD5 f00de1ae2bb4b7ba2f1345cedf1b474b
BLAKE2b-256 ba53292e8a4c722b360a4fb05b239d32443e4bdc4b52abc96df07261e3e4cd7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf2beamer-0.1.0.tar.gz:

Publisher: publish.yml on LelioG/pdf2beamer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdf2beamer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdf2beamer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 90.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdf2beamer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 798ead1361686e0c894e2f7ccb383121ac40f9a1e697cefc7ec13056eca9d944
MD5 763156b6d39d9a8d4596a06e6f3cd56a
BLAKE2b-256 f62de443fafc4d92f9a67564ec8d2602aa0a41ce36bccaf7035c3fa6fb7c2453

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf2beamer-0.1.0-py3-none-any.whl:

Publisher: publish.yml on LelioG/pdf2beamer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page