EvanZhouDev/llm.pdf

Run LLMs inside a PDF file.

What it solves

It demonstrates that a Large Language Model (LLM) can be executed entirely within a standalone PDF file, removing the need for external servers or traditional software installations.

How it works

The project uses Emscripten to compile llama.cpp into asm.js, which is then executed within the PDF via a JavaScript injection technique. The LLM model file itself is embedded directly into the PDF using base64 encoding.

Who it’s for

Developers and researchers interested in proof-of-concept experiments in LLM deployment and the creative use of PDF capabilities.

Highlights

  • Runs LLM inference locally within a PDF document.
  • Supports GGUF quantized models.
  • Includes a script to generate custom PDFs with different compatible models.
  • Leverages asm.js and llama.cpp for execution.

Related

  • Project
  • Project
  • Project
  • Project