Coder Social home page Coder Social logo

riccardoeudizi / fully-local-pdf-chatbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacoblee93/fully-local-pdf-chatbot

0.0 0.0 0.0 4.14 MB

Home Page: https://webml-demo.vercel.app

License: MIT License

JavaScript 5.90% TypeScript 92.95% CSS 1.15%

fully-local-pdf-chatbot's Introduction

๐Ÿ  Fully Client-Side Chat Over Documents

Yes, it's another chat over documents implementation... but this one is entirely local!

It's a Next.js app that read the content of an uploaded PDF, chunks it, adds it to a vector store, and performs RAG, all client side. You can even turn off your WiFi after the site loads!

You can see a live version at https://webml-demo.vercel.app.

Users will need to download and set up Ollama, then run the following commands to allow the site access to a locally running Mistral instance:

$ OLLAMA_ORIGINS=http://localhost:3000 OLLAMA_HOST=127.0.0.1:11435 ollama serve

Then, in another terminal window:

$ OLLAMA_HOST=127.0.0.1:11435 ollama pull mistral

โšก Stack

It uses the following:

  • Voy as the vector store, fully WASM in the browser.
  • Ollama to run an LLM locally and expose it to the web app.
  • LangChain.js to call the models, perform retrieval, and generally orchestrate all the pieces.
  • Transformers.js to run embeddings in the browser.

I wanted to run as much of the app as possible directly in the browser, but you can swap in Ollama embeddings as well.

๐Ÿ”ฑ Forking

To run/deploy this yourself, simply fork this repo and install the required dependencies with yarn.

There are no required environment variables!

๐Ÿ™ Thank you!

Special thanks to @dawchihliou for making Voy, @jmorgan and @mchiang0610 for making Ollama and for your feedback, and @xenovacom for making Transformers.js.

For more, follow me on Twitter @Hacubu!

fully-local-pdf-chatbot's People

Contributors

jacoblee93 avatar riccardoeudizi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.