Machine Learning

Machine Learning in Linux: Dalai – LLaMA and Alpaca

In Operation

Point our web browser to http://localhost:3000

Here’s example output to a question we posed.

Image of Dalai in action
Click image for full size

The dashboard lets you customize the configuration options. For example, we can increase the number of response words by changing n_predict. The project doesn’t explain the parameters in any detail.

Dalai templatesA number of templates are available from a dropdown box.

  • ai-dialog – user interacts with AI. AI is helpful, kind, obedient, honest, and knows its own limits.
  • chatbot – an intelligent chatbot.
  • default – writes a response that appropriately completes the request.
  • instruction-alpaca
  • rewrite-alpaca
  • translate – translates English text to a foreign language.
  • tweet-sentiment

Summary

Dalai lets you run ChatGPT-like models locally on your device with a simple installation although we had to update Node.js from the standard package available in Ubuntu 22.04 LTS.

From our initial testing, we find the 13B and 30B LLaMA model to offer a more natural conversation than ChatGPT. However, we need to perform a lot more testing and experiment with the other models and investigate Alpaca.

One major criticism of all LLMs is that because they are “large”, they need huge globs of computational power. Bear in mind you’ll also need a lot of disk space to store Dalai’s models. The smallest model (7B) consumes over 31GB hard disk (quantizing reduces this to approximately 4GB). The largest model uses a whopping 432GB of disk space (quantized 41GB). And don’t forget that the larger models have high RAM requirements.

Dalai is cross-platform software running under Linux as well as macOS and Windows.

At the time of writing the latest version of Dalai is 0.3.1. We can update to that version with the command:

$ npx dalai@0.3.1 setup

The web UI is powered by llama.cpp, llama-dl CDN and alpaca.cpp. Note, llama-dl’s repository is currently disabled due to a DMCA takedown notice.

Website: cocktailpeanut.github.io/dalai
Support: GitHub Code Repository
Developer: cocktailpeanut and contributors
License: MIT License

Artificial intelligence icon For other useful open source apps that use machine learning/deep learning, we’ve compiled this roundup.

Dalai is written in CSS and JavaScript. Learn CSS with our recommended free books and free tutorials. Learn JavaScript with our recommended free books and free tutorials.

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

9 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
broken
broken
1 year ago

Not working for me, node -v now is now v12.22.9

Roge
Roge
1 year ago
Reply to  broken

Works fine for me

TheDogGod
TheDogGod
1 year ago

Loved this post – heress my feedback –
I think Dalai is an excellent project that makes it easy for researchers to experiment with machine learning on their local machines. The fact that it focuses on Large Language Model Meta AI (LLaMA) is impressive, as this subfield of AI has enormous potential. LLaMA’s ability to perform various tasks from textual instructions, generate creative text, solve math problems, and answer reading comprehension questions is truly remarkable. I am excited to see how Dalai will advance the work of researchers in this subfield and look forward to seeing more updates on this project.
Thanks for reading , Love The Blog !!

Mo
Mo
1 year ago
Reply to  TheDogGod

Sounds like spam written with ChatGPT

TheDogGod
TheDogGod
1 year ago
Reply to  Mo

not at all buddy lol !!!

Cody Hodges
Cody Hodges
1 year ago

Awesome! Its genuinely remarkable post, I have got much clear idea regarding from this post

Donald Knight
Donald Knight
1 year ago

Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.

eti tiny house
eti tiny house
10 months ago

I just like the helpful information you provide in your articles

mirc sohbet
mirc sohbet
7 months ago

Pretty! This has been a really wonderful post. Many thanks for providing these details.