Run Llama3 (or any LLM / SLM) on Your MacBook
I'm gonna be real with you: the Cloud and SaaS / PaaS is great... until it isn't. When you're elbow-deep in doing something with the likes of ChatGPT or Gemini or whatever, the last thing you need is your AI assistant starts choking (It seems that upper network connection was reset) because 5G or the local WiFi crapped out or some server halfway across the world is having a meltdown(s).
That's why I'm all about running large language models (LLMs) like Llama3 locally. Yep, right on your trusty MacBook. Sure, the cloud's got its perks, but here's why local is the way to go, especially for me:
Privacy: When you're brainstorming the next big thing, you don't want your ideas floating around on some random server. Keeping your data local means it's yours, and that's a level of control I can get behind.
Offline = Uninterrupted Flow: Whether you're on a plane, at a coffee shop with spotty wifi, or just hate being at the mercy of your internet connection, having an LLM on your local machine means you can brainstorm, draft,and refine ideas anytime, anywhere.
Speed: Small local models can feel snappy because there's no round trip to a remote server. How fast they are depends on your hardware, though, and big cloud models on fast GPUs are often quicker. A MBP M2 with 8GB RAM isn't a number cruncher at all. Instead of 8B models, small tuned models with around 4B parameters run fine, like Phi3 (https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF)
Experimentation: Want to tweak parameters, try out different model versions, or play around with custom prompts? Having a local setup gives you a sandbox to tinker and explore without worrying about cloud costs or throttling.
Alright, Enough Talk. Let's Get This Thing Running
If you're ready to ditch the cloud and take control of your AI, here's the lowdown on how to get Llama 3 up and running on your MacBook:
Ollama is Your Friend: Download the Ollama app for macOS. It's a simple way to manage and run various LLM models locally. Just grab it from their website:
wget https://ollama.com/download/Ollama-darwin.zip; unzipOllama-darwin.zipRun Llama3: Move ollama.app into Application, start up ollama.app, and allow the command line setup. Open the terminal and run the following command:
ollama run llama3;this will download the model if you don't have it already and start it up.Hugging: Want to play with other models from Hugging Face? No problem. Just download the
.gguffile and create a simple model file with the details from the model card on Hugging Face.wget https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q3_K_S.gguf
Create the modelfile:
vi mf-mistral
<-- SNIPP
FROM "./capybarahermes-2.5-mistral-7b.Q3_K_S.gguf"
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
TEMPLATE """
<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
SNAP -->
Create your model:ollama create h1 -f mf-mistral
ollama run h1
list all installed models:ollama list
Pro Tip: Tailor your prompts for product ideation! Instead of generic questions, focus on specific problem areas or target audiences.
Example:
Ready to Roll?
Running Llama 3 locally on your MacBook is a useful tool for product ideation. You'll have the freedom, speed, and privacy to unleash your creativity and build products that truly matter to your users.Need help with distributed systems, backend engineering or data platforms? See my consulting services.
