Skip to content
프로젝트

소개

PDF 파일 안에서 LLM을 실행합니다.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+1
in 7 days
+1
in 15 days
+2
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Run LLMs inside a PDF file.

Watch how llm.pdf was built on YouTube.

What is llm.pdf?

This is a proof-of-concept project, showing that it's possible to run an entire Large Language Model in nothing but a PDF file.

It uses Emscripten to compile llama.cpp into asm.js, which can then be run in the PDF using an old PDF JS injection.

Combined with embedding the entire LLM file into the PDF with base64, we are able to run LLM inference in nothing but a PDF.

Watch the video on YouTube to learn the full story!

Load a Custom Model in the PDF

The scripts/generatePDF.py file will help you create a PDF with any compatible LLM.

The easiest way to get started is with the following command:

cd scripts
python3 generatePDF.py --model "path/for/model.gguf" --output "path/to/output.pdf"

Choosing a Model

Here's the general guidelines when picking a model:

  • Only GGUF quantized models work.
  • Generally, try to use Q8 quantized models, as those run the fastest.
  • For reference, 135M parameter models take around 5s per token input/output. Anything higher will likely be unreasonably slow.

Inspiration and Credits

Thank you to the following for inspiration and reference:

Thank you to the following for creating the tiny LLMs that power llm.pdf:

관련 프로젝트 살펴보기

불러오는 중…