Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pdfGPT

> 编程语言
Open source

PDF GPT allows you to chat with the contents of your PDF file by using GPT capabilities. The most effective open source solution to turn your pdf files in a cha

7.2K stars0 likes2 views
WebsiteGitHub

About

PDF GPT allows you to chat with the contents of your PDF file by using GPT capabilities. The most effective open source solution to turn your pdf files in a cha

pdfGPT

Demo

  1. Demo URL: https://huggingface.co/spaces/bhaskartripathi/pdfChatter
  2. Demo Video:
  3. Despite so many fancy RAG solutions out there in Open Source and enterprise apps, pdfGPT is still the most accurate application that gives the most precise response. The first version was developed way back in 2021 as one of the world's earliest RAG open source solutions. To this day (Dec, 2024), it still remains one of the most accurate ones due to its very simple and unique architecture. It uses no third-party APIs such as langchain. It uses embeddings but no vectorDB, no indexing. But, it still doesn't compromise on the accuracy of response which is more critical than a fancy UI. The library documentation that you see below is a bit outdated as I do not get enough time to maintain it. However, if there is more demand then I am ready to put an enterprise grade RAG with more sophisticated retrieval tech available these days.

Version Updates (27 July, 2023):

  1. Improved error handling
  2. PDF GPT now supports Turbo models and GPT4 including 16K and 32K token model.
  3. Pre-defined questions for auto-filling the input.
  4. Implemented Chat History feature.

Note on model performance

If you find the response for a specific question in the PDF is not good using Turbo models, then you need to understand that Turbo models such as gpt-3.5-turbo are chat completion models and will not give a good response in some cases where the embedding similarity is low. Despite the claim by OpenAI, the turbo model is not the best model for Q&A. In those specific cases, either use the good old text-DaVinci-003 or use GPT4 and above. These models invariably give you the most relevant output.

Upcoming Release Pipeline:

  1. Support for Falcon, Vicuna, Meta Llama
  2. OCR Support
  3. Multiple PDF file support
  4. OCR Support
  5. Node.Js based Web Application - With no trial, no API fees. 100% Open source.

Problem Description :

  1. When you pass a large text to Open AI, it suffers from a 4K token limit. It cannot take an entire pdf file as an input
  2. Open AI sometimes becomes overtly chatty and returns irrelevant response not directly related to your query. This is because Open AI uses poor embeddings.
  3. ChatGPT cannot directly talk to external data. Some solutions use Langchain but it is token hungry if not implemented correctly.
  4. There are a number of solutions like https://www.chatpdf.com, https://www.bespacific.com/chat-with-any-pdf, https://www.filechat.io they have poor content quality and are prone to hallucination problem. One good way to avoid hallucinations and improve truthfulness is to use improved embeddings. To solve this problem, I propose to improve embeddings with Universal Sentence Encoder family of algorithms (Read more here: https://tfhub.dev/google/collections/universal-sentence-encoder/1).

Solution: What is PDF GPT ?

  1. PDF GPT allows you to chat with an uploaded PDF file using GPT functionalities.
  2. The application intelligently breaks the document into smaller chunks and employs a powerful Deep Averaging Network Encoder to generate embeddings.
  3. A semantic search is first performed on your pdf content and the most relevant embeddings are passed to the Open AI.
  4. A custom logic generates precise responses. The returned response can even cite the page number in square brackets([]) where the information is located, adding credibility to the responses and helping to locate pertinent information quickly. The Responses are much better than the naive responses by Open AI.
  5. Andrej Karpathy mentioned in this post that KNN algorithm is most appropriate for similar problems: https://twitter.com/karpathy/status/1647025230546886658
  6. Enables APIs on Production using langchain-serve.

Docker

Run docker-compose -f docker-compose.yaml up to use it with Docker compose.

UML

…

Flowchart

mermaid
flowchart TB
A[Input] --> B[URL]
A -- Upload File manually --> C[Parse PDF]
B --> D[Parse PDF] -- Preprocess --> E[Dynamic Text Chunks]
C -- Preprocess --> E[Dynamic Text Chunks with citation history]
E --Fit-->F[Generate text embedding with Deep Averaging Network Encoder on each chunk]
F -- Query --> G[Get Top Results]
G -- K-Nearest Neighbour --> K[Get Nearest Neighbour - matching citation references]
K -- Generate Prompt --> H[Generate Answer]
H -- Output --> I[Output]

Star History

I am looking for more contributors from the open source community who can take up backlog items voluntarily and maintain the application jointly with me.

Also Try this project - No Code LLM Quantization

Running Large Language Models on consumer hardware remains a challenge due to their massive size (in gigabytes). Model Quantization is a way to reduce their size while not compromising much on their performance. No-code Model Quantization is highly desired by ML Engineers and AI researchers for quick experimentation. I developed a no-code Model Quantization tool that addresses these key hurdles: Size: Reduces model size, making them feasible to run on consumer-grade hardware. Format: Converts training-optimized formats into ones suitable for efficient inference.

Project Link https://github.com/bhaskatripathi/LLM_Quantization

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

Citation

If you use PDF-GPT in your research or wish to refer to the examples in this repo, please cite with:

bibtex
@misc{pdfgpt2023,
  author = {Bhaskar Tripathi},
  title = {PDF-GPT},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\\url{https://github.com/bhaskatripathi/pdfGPT}}
}

Issues· 48 open

View all issuesOpen on GitHub
  • #123

    Dependency hardening: pin minimum safe dependency versions

    Updated Jun 24, 2026
  • #122

    Security: multiple gradio advisories appear reachable in pdfGPT

    Updated Jun 21, 2026
  • #121

    Unauthenticated arbitrary file read via gradio CVE-2024-4941 on pinned `gradio==4.11.0`

    Updated May 24, 2026
  • #118

    PDFGPT is rebuilt here ==> https://github.com/tuxxon/PDFGPT

    Updated Aug 27, 2024
  • #117

    How to use the api? Is it still available?

    Updated May 22, 2024
  • #116

    Anyway to use a repository of PDF files on disk?

    Updated Apr 29, 2024
  • #115

    Demo seems to be not working

    Updated Apr 27, 2024
  • #114

    `requirements > langchain-serve` is no longer maintained, any alternative?

    Updated Feb 21, 2024
  • #98

    requirements.txt takes too long to install

    Updated Feb 8, 2024
  • #112

    ChatPDF can create some exam questions based on the document, but pdfGPT failed

    Updated Jan 23, 2024

> Tags

Pythonchatpdfchatwithpdfpdfgpt

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 22, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言