Skip to main content

Run Llama3 (or any LLM / SLM) on Your MacBook in 2024

Listen:

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:

  1. 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.

  2. 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.

  3. Speed: Local models tend to be faster than cloud-based ones, simply because there's no round trip to a remote server. This makes for a much smoother, more responsive experience. Okay, depends on your hardware, and a MBP M2 with 8Gb RAM isn't the number cruncher et all. But instead to use 8B models, 4B highly tuned are running perfectly fine, like Phi3 (https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF)

  4. 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:

  1. 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; unzip Ollama-darwin.zip

  2. Run 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.

  3. Hugging: Want to play with other models from Hugging Face? No problem. Just download the .gguf file 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:

"give me some quotes from steve ballmer"

Ready to Roll?

Running Llama 3 locally on your MacBook is a game-changer for product ideation. You'll have the freedom, speed, and privacy to unleash your creativity and build products that truly matter to your users.


Comments

Popular posts from this blog

Why Is Customer Obsession Disappearing?

 It's wild that even with all the cool tech we've got these days, like AI solving complex equations and doing business across time zones in a flash, so many companies are still struggling with the basics: taking care of their customers.The drama around Coinbase's customer support is a prime example of even tech giants messing up. And it's not just Coinbase — it's a big-picture issue for the whole industry. At some point, the idea of "customer obsession" got replaced with "customer automation," and now we're seeing the problems that came with it. "Cases" What Not to Do Coinbase, as main example, has long been synonymous with making cryptocurrency accessible. Whether you’re a first-time buyer or a seasoned trader, their platform was once the gold standard for user experience. But lately, their customer support practices have been making headlines for all the wrong reasons: Coinbase - Stuck in the Loop:  Users have reported being caugh...

MySQL Scaling in 2024

When your MySQL database reaches its performance limits, vertical scaling through hardware upgrades provides a temporary solution. Long-term growth, though, requires a more comprehensive approach. This involves optimizing the database strategically and integrating complementary technologies. Caching The implementation of a caching layer, such as Memcached or Redis , can result in a notable reduction in the load and an increase ni performance at MySQL. In-memory stores cache data that is accessed frequently, enabling near-instantaneous responses and freeing the database for other tasks. For applications with heavy read traffic on relatively static data (e.g. product catalogues, user profiles), caching represents a low-effort, high-impact solution. Consider a online shop product catalogue with thousands of items. With each visit to the website, the application queries the database in order to retrieve product details. By using caching, the retrieved details can be stored in Memcached (a...

What the Heck is Superposition and Entanglement?

If you’ve ever heard the words superposition or entanglement thrown around in conversations about quantum physics, you may have nodded politely while your brain quietly filed them away in the "too confusing to deal with" folder.  These aren't just theoretical quirks; they're the foundation of mind-bending tech like Google's latest quantum chip, the Willow with its 105 qubits. Superposition challenges our understanding of reality, suggesting that particles don't have definite states until observed. This principle is crucial in quantum technologies, enabling phenomena like quantum computing and quantum cryptography. What's in for us? Short, nothing at the moment. 105 qubits sounds awesome, but it would neither crack encryption nor enhance AI in the next few years. There are some use cases for Willow, like drug (protein) discovery or solving certain mathematical problems when they aren't too complicated. Right now, Google managed to turn physical qubits ...