Guide · Open source
How to use Nougat: convert scientific PDFs to Markdown
Updated · written with AI from the project's own documentation and checked against our catalogue data
Nougat is an open-source model from Meta's research team that reads scientific PDF papers and converts them into a lightweight markup format called .mmd. It is built to handle LaTeX math and tables, which plain PDF text extraction often mangles. This guide shows you how to install it, run it from the command line or a local API, and check whether it fits your documents.
Quick start
- 1Check your documents. Confirm they are English or Latin-alphabet academic papers. Nougat is not made for invoices, forms or Chinese, Russian or Japanese text.
- 2Install Python and PyTorch. Install Python 3.9 or newer. On Windows with a GPU, install the correct PyTorch version first.
- 3Install nougat-ocr. Run pip install nougat-ocr, or the git install from the repository if you need the latest code.
- 4Run a conversion. Run nougat with your PDF and an output directory with -o. Each PDF becomes a .mmd file.
- 5Handle failures. If you see many [MISSING_PAGE] results, rerun with --no-skipping.
- 6Optional: start the API. Install the api extras, run nougat_api, and POST your PDF to the predict endpoint.
Check whether Nougat fits your documents
Nougat was trained on scientific papers from arXiv and PMC, so it is aimed at academic documents in English or other Latin-alphabet languages. The README says Chinese, Russian, Japanese and similar languages will not work.
- Good fit: arXiv-style papers with equations and tables
- Poor fit: invoices, forms and other non-academic PDFs
- Poor fit: Chinese, Russian, Japanese and similar languages
Install Nougat with pip
You need Python 3.9 or newer and PyTorch. On Windows, if you want to use a GPU, install the correct PyTorch version first by following the PyTorch instructions. You can install from PyPI or directly from the repository.
- Extras for the API: pip install "nougat-ocr[api]"
- Extras for dataset generation: pip install "nougat-ocr[dataset]"
pip install nougat-ocrConvert a PDF from the command line
Run nougat with a PDF path and an output directory. Each PDF is saved as a .mmd file in that directory. You can also pass a directory of PDFs, or a file where each line is a path to a PDF.
The default model tag is 0.1.0-small. To use the base model, pass -m 0.1.0-base. The --pages option only works for single PDFs.
- --recompute: recompute a PDF and discard previous predictions
- --batchsize / -b: set the batch size
- --checkpoint / -c: path to a checkpoint directory
- --full-precision: use float32 instead of bfloat16
- --no-markdown: skip the markdown compatibility step
- --no-skipping: turn off the failure detection heuristic
$ nougat path/to/file.pdf -o output_directoryFix [MISSING_PAGE] results
On some devices the failure detection heuristic does not work properly. If you get many [MISSING_PAGE] responses, run again with the --no-skipping flag. The README notes that CPU use and older GPUs can trigger these false positives.
The README also says the model weights are available from the GitHub release section, and can be downloaded on first run.
$ nougat path/to/file.pdf -o output_directory --no-skippingRun Nougat as a local API
With the API extras installed, start the server with nougat_api. Then send a POST request with your PDF to the predict endpoint. The response is a string with the markdown text of the document. You can limit conversion to a page range with the start and stop parameters.
$ nougat_apiNext steps: datasets, training and evaluation
The repository includes scripts for building a dataset of paired PDFs and markup, training or fine-tuning a model, and evaluating results. These steps need extra inputs such as LaTeXML HTML files and the pdffigures2 binary, so read the README sections on dataset generation before starting.
python train.py --config config/train_nougat.yamlWhat people use it for
- Turning arXiv-style papers with equations and tables into editable text
- Building datasets of scientific documents in markup form
- Adding a local PDF-to-markup step to a data pipeline
- Converting selected pages of a single paper with --pages
Frequently asked questions
Is Nougat free to use?
The Nougat codebase is licensed under MIT. The model weights are licensed under CC-BY-NC, which the README says restricts commercial use. Check that license before using it in a commercial project.
What are the requirements for Nougat?
The README lists Python 3.9 or newer and PyTorch. For GPU use on Windows, install the correct PyTorch version first. CPU use may be slow.
Why does Nougat return [MISSING_PAGE]?
The README says this can happen when the document is not similar to the arXiv and PMC training papers, or when failure detection gives false positives on CPU or older GPUs. Try the --no-skipping flag.
Does Nougat support languages other than English?
It works best with English papers, and other Latin-based languages might work. The README says Chinese, Russian and Japanese will not work.
What output format does Nougat produce?
Each PDF is saved as a .mmd file, a lightweight markup language that is mostly compatible with Mathpix Markdown. The project uses LaTeX tables.
How does Nougat compare to Marker, Docling, GROBID or Mathpix?
The source lists these as comparable projects but does not compare their accuracy or speed. Nougat is specifically built for LaTeX math and tables in academic PDFs, so test the candidates on your own documents.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Nougat suits researchers and developers who want local, editable markup from English academic PDFs with equations and tables, and who have a GPU. It is a poor choice for non-academic documents, non-Latin languages, or commercial use that needs unrestricted model weights.
Install options & downloads