How to Run ChatGPT-like LLMs Locally on Your Computer in 3 Easy Steps
Running Large Language Models (LLMs) similar to ChatGPT locally on your computer and without Internet connection is now more straightforward, thanks to llamafile, a tool developed by Justine Tunney of the Mozilla Internet Ecosystem (MIECO) and Mozilla's innovation group. Llamafile is a game-changer in the world of LLMs, enabling you to run these models locally with ease.
In this post, I’ll show you how to run locally on your Mac LLaVA 1.5, an open-source multimodal LLM capable of handling both text and image inputs, or Mistral 7B, an open-source LLM known for its advanced natural language processing and efficient text generation, leveraging llamafile.
What is llamafile?
Llamafile transforms LLM weights into executable binaries. This technology essentially packages both the model weights and the necessary code required to run an LLM into a single, multi-gigabyte file. This file includes everything needed to run the model, and in some cases, it also contains a full local server with a web UI for interaction. This approach simplifies the process of distributing and running LLMs on multiple operating systems and hardware architectures, thanks to its compilation using Cosmopolitan Libc.
This innovative approach simplifies the distribution and execution of LLMs, making it much more accessible for users to run these models locally on their own computers.
What is LLaVA 1.5?
LLaVA 1.5 is an open-source large multimodal model that supports text and image inputs, similar to GPT-4 Vision. It is trained by fine-tuning LLaMA/Vicuna on GPT-generated multimodal instruction-following data. It is an auto-regressive language model, based on the transformer architecture.
What is Mistral 7B?
Mistral 7B is an open-source large language model with 7.3 billion parameters developed by Mistral AI. It excels in generating coherent text and performing various NLP tasks. Its unique sliding window attention mechanism allows for faster inference and handling of longer text sequences. Notable for its fine-tuning capabilities, Mistral 7B can be adapted to specific tasks, and it has shown impressive performance in benchmarks, outperforming many similar models.
Here’s how to start using LLaVA 1.5 or Mistral 7B on your own computer leveraging llamafile. Don’t get intimidated, the setup process is very straightforward!
Setting Up LLaVA 1.5
One Time Setup
Using LLaVA 1.5
Every time you want to use LLaVA on your compute follow these steps:
领英推荐
Terminating the process
Once you're done using the LLaVA 1.5 model, you can terminate the process. To do this, return to the Terminal where the server is running. Simply press Ctrl + C. This key combination sends an interrupt signal to the running server, effectively stopping it.
Setting Up Mistral 7B
One Time Setup
Using Mistral 7B
Every time you want to use LLaVA on your compute follow these steps:
Terminating the process
Once you're done using the Mistral 7B model, you can terminate the process. To do this, return to the Terminal where the server is running. Simply press Ctrl + C. This key combination sends an interrupt signal to the running server, effectively stopping it.
Conclusion
The introduction of llamafile significantly simplifies the deployment and use of advanced LLMs like LLaVA 1.5 or Mistral 7B for personal, development, or research purposes. This tool opens up new possibilities in the realm of AI and machine learning, making it more accessible for a wider range of users.
Originally published at https://ppaolo.substack.com