# Puffin: The full power of LaTeX for your agents.

Puffin is an ultralight engine that exposes real LaTeX through an API and MCP to generate any document. Set your letterhead once and generate the rest without worrying about anything else, with scientific-grade math. Built to work with AI agents. Now in early access.

Status: early access, open to a small group of teams. Request it by email (see Contact below): tell us what documents you want, roughly how many per month, and whether you will use REST or MCP.

## Set your letterhead and forget the rest
- Your brand, no extra work: letterhead, logo, typography and colors live in the template.
- High-precision math: equations, units and numbered references at the quality of a scientific publication, hard to reach with engines that convert HTML to PDF.
- Charts and diagrams with TikZ and pgfplots, as vectors.
- A person can always review it: the document is readable LaTeX, so the human stays in the loop even when an agent writes it.

## Sample gallery
Six synthetic documents compiled by Puffin: a two-column scientific paper, an invoice, a quarterly financial report, a medical prescription, a lab report and a certificate.

## Built for agents
The agent writes LaTeX and Puffin compiles it.
MCP tools: compile_latex, check_latex, list_templates, preview_template, test_component and compose_document. The same operations exist over REST.
When a document fails, the response includes the file, the line and a hint to fix it.

## API
- POST /v1/templates/sandwich-document/render: prescription, note or visit summary (same contract as BlinkPDF).
- POST /v1/templates/layout-document/render: pre-printed form (same contract as BlinkPDF).
- POST /v1/latex: your own LaTeX, with strict mode and check-only mode.
- POST /v1/documents/compose: a document built from blocks.
- GET /v1/templates and /v1/components: catalog with options and previews.

## Security
- Every document compiles under Landlock and a seccomp filter: no network, no other programs, only its own folder.
- Stateless: no document is stored.
- The server checks its own isolation at startup.
- A PDF made from your own LaTeX is rejected if it carries JavaScript, actions or attachments.

## Numbers (measured on October 25, 2026, server time)
- ~0.4 s per prescription on Render's smallest instance (half a CPU).
- ~0.6 s for a 7-page medical record.
- 47 KB for a prescription with logo and signature.

## FAQ
### What is Puffin?
Puffin is a LaTeX engine that compiles real LaTeX (pdfTeX) into PDF through a REST API and an MCP server. You set your letterhead once in a template and generate every document from it, from a prescription or an invoice to a scientific paper.

### How do AI agents use Puffin?
The agent writes LaTeX and Puffin compiles it. Over MCP it can call compile_latex, check_latex, list_templates, preview_template, test_component and compose_document. The same operations exist over REST, so an agent without MCP can do everything an agent with MCP can.

### What happens when a LaTeX document fails to compile?
Instead of a log hundreds of lines long, Puffin answers with HTTP 422 and structured diagnostics: the file, the line and a hint, so an agent can fix the document without guessing.

### Why LaTeX instead of converting HTML to PDF?
LaTeX typesets equations, units and numbered references at the quality of a scientific publication, and draws charts and diagrams with TikZ and pgfplots as vectors. The source stays readable, so a person can review and fix a document even when an agent wrote it.

### Does Puffin store my documents?
No. Puffin is stateless: it has no database and no storage. Each document's folder is deleted after the response, and every document compiles under Landlock and a seccomp filter, with no network and no other programs.

### How fast is Puffin?
Measured on October 25, 2026, on the server with test data: about 0.4 s per prescription on Render's smallest instance (half a CPU) and about 0.6 s for a 7-page medical record. A prescription with logo and signature weighs 47 KB.

### Can I switch from BlinkPDF to Puffin?
For prescriptions, notes, visit summaries and pre-printed forms, yes: those templates keep the same contract as BlinkPDF, so you can switch services without touching the client. Fillable PDF forms are not part of Puffin.

### How do I get early access?
We're opening Puffin to a small group of teams. Press “Request early access” and tell us what documents you want to generate, roughly how many per month, and whether you'll call Puffin from your own code (REST) or from an AI agent (MCP). Early access comes with your API key and the server address.

## Contact
contacto [at] neuroglias.com
