Giter Site home page Giter Site logo

luc99hen / distillama Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shreyaskarnik/distillama

0.0 0.0 0.0 11.43 MB

Chrome Extension to Summarize or Chat with Web Pages/Local Documents Using locally running LLMs. Keep all of your data and conversations private. πŸ”

License: MIT License

Shell 0.17% JavaScript 9.08% TypeScript 68.65% CSS 21.29% HTML 0.78% SCSS 0.03%

distillama's Introduction

DistiLlama

image

What is DistiLlama?

DistiLlama is a Chrome extension that leverages locally running LLM perform following tasks.

Overview

One of the things that I was experimenting with is how to use a locally running LLM instance for various tasks and summarization (tl;dr) was on the top of my list. It was key to have all calls to LLM be local and all the data to stay private.

This project utilizes Ollama as the locally running LLM instance. Ollama is a great project that is easy to setup and use. I highly recommend checking it out.

To generate the summary I am using the following approach:

  • Grab the current active tab id
  • Use Readability to extract the text content from the page. In my experiments it was clear that the quality of the summary was much better when using Readability as it removed a lot of un-necessary content from the page.
  • Use LangChain (LangChain.js) to summarize the text content.
  • Display the summary in a popup window.

How to use DistiLlama?

  • Prerequisites:

    • Install Ollama you can also choose to run Ollama in a Docker container.
    • Start Ollama using the following command: OLLAMA_ORIGINS=* OLLAMA_HOST=127.0.0.1:11435 ollama serve
    • In another terminal you can run ollama pull llama2:latest or ollama pull mistral:latest
    • Choice of model depends on your use case. Here are the models supported by Ollama https://ollama.ai/library
    • Make sure you set OLLAMA_ORIGINS=* for the Ollama environment by following instructions here
  • Clone this repo

    • Install pnpm npm install -g pnpm
    • run pnpm install
    • run pnpm dev
    • Open Chrome and navigate to chrome://extensions/
      • Enable developer mode (if not already enabled)
      • Click on Load unpacked and select the dist folder from the base of the cloned project.
      • You should see the DistiLlama added to your Chrome extensions.
      • You may want to pin the extension to your Chrome toolbar for easy access.

Demo

Chat with LLM

Chat

Chat with Documents (PDF)

ChatWithDocs

Chat with Web Page

ChatWithPage

Summarization

Summary

TODOS

  • Make the summarization chain configurable
  • Make LLM model configurable
  • Save summary in local storage
  • Improve the UI (not an expert in this area but will try to learn)
  • Add TTS support
  • Check out performance with different tuned prompts
  • Extend to chat with the page (use embeddings and LLMs for RAG)
  • Use transformers.js for local in browser embeddings and Voy for the storage similar to this Building LLM-Powered Web Apps with Client-Side Technology
  • Focus on improving the quality of the summarization and chat
  • Multimodal support

References and Inspiration

distillama's People

Contributors

dependabot[bot] avatar shreyaskarnik 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.