pdf2beamer
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 base package:
pip install pdf2beamer
With local model download and inference support only:
pip install "pdf2beamer[models]"
With the full local pipeline for native PDFs and real local models:
pip install "pdf2beamer[models,pdf,docling]"
Download default models into ./models/:
pdf2beamer download-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
The models extra includes Hugging Face download tooling. If your Hugging Face account needs access to a model, authenticate once:
hf auth login
Download the expected local model layout:
pdf2beamer download-models .
Equivalent manual Hugging Face commands:
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-Nemotron3-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-3Nano-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/
Metadata
Release files for pdf2beamer 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdf2beamer-0.1.2.tar.gz | 456.7 kB | With provenance | Details for pdf2beamer-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdf2beamer-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pdf2beamer-0.1.2-py3-none-any.whl |
Total release size: 549.0 kB
Release files / pdf2beamer-0.1.2.tar.gz
| Download URL | pdf2beamer-0.1.2.tar.gz |
|---|---|
| Size | 456.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c97c727fadbcb906a73a11df65f354c4143211443077961b6f85eb8ab9c2021
|
|
BLAKE2b-256 checksum How to use checksums |
7b4038fef473e693682cbafc2b47836c060c07a15c0834d91fc86a131cf9ede3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 29, 2026.
Transparency logRelease files / pdf2beamer-0.1.2-py3-none-any.whl
| Download URL | pdf2beamer-0.1.2-py3-none-any.whl |
|---|---|
| Size | 92.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
812b7fa4015bd54b0a0b54344d15405bc8be77934da0ec6906f69d87e4ebd506
|
|
BLAKE2b-256 checksum How to use checksums |
36bfe2ad281a81ecba95afd0c820843ca4eb31b9cec5f8ba94f14e742ce3a6a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 29, 2026.
Transparency logSecurity for pdf2beamer 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pdf2beamer-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.