Coder Social home page Coder Social logo

offline_chatgpt's Introduction

Offline ChatGPT using Large Language Model (LLM)

Here we will see, how to run a ChatGPT-like LLM on a local machine without internet. This I have tested on macOS(13.1)

Prerequisite

Build with

What is Alpaca and LLaMA?

Alpaca is a small AI language model developed by a group of computer scientists at Stanford University. Alpaca is fine-tuned on LLaMa, Meta’s large language model which recently leaked online.

Follow the below steps to install and start Offline ChatGPT

  1. Here we are using Alpaca 7B LLM model (around 4.2 GB disk space). If we want to install the Alpaca 13B model, then we need to replace 7B with 13B. Note the larger model needs 8.1 GB of space. We can use the below command to install alpaca model.
npx dalai alpaca install 7B
  1. Run the below command to start the Web Server
npx dalai serve
  1. Open the Web Browser at the below URL
http://localhost:3000

Offline ChatGPT

Offline Alpaca

  1. We can now start using this Offline ChatGPT-like language model on our PC without internet connectivity. Replace PROMPT with the query we wanna try and click on Go.

  2. Optional: We can also install LLaMa models. LLaMA models are much larger. Its 7B model takes up to 31 GB of space. We can also replace 7B with 13B, 30B, and 65B. The largest model takes up to 432 GB of space. We can use the below command to install llama model.

npx dalai llama install 7B
  1. We can also select the model name and try various options.

References

https://github.com/ggerganov/llama.cpp

https://github.com/tatsu-lab/stanford_alpaca

offline_chatgpt's People

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.