0:06 Introduction to MLX Support in Olama for Apple Silicon
2:23 Live Demo: Running CRAM 3.535B Model on MacBook with MLX
8:56 Conclusion and Call to Action
Here is a good news for running large-language models on MacBook.
One of the most popular inference engine, Olama, has released a new support for Apple Silicon,
which is MLX. So as you can see, MLX is an Apple Silicon-specific inference engine.
There are some big benefits. One of the obvious ones is the performance for the latest version,
which has MLX support, which is 1810. And the previous version is 1154. So that's a really
big jump, right? And for the text-generating performance, it's 112 versus 58. Wow, that's
make it so excited. And I think there's also many new support here. So for example,
one of the most advanced local model, which is the CRAM 3.535B, quantized to the NVFP4 format.
So this one is the NVIDIA quantized 4-bit format. You need to upgrade it to the 0.9.
So I think that can be easy to install for your MacBook. So just download for macOS,
drag it onto your applications, double-click the downloaded file, and drag it to your applications.
And that should be easy. So once you have it, you can click it on your applications launcher,
and now you have the user interface. You have an icon on your top bar here.
And if you look at the OLAMA, about OLAMA, so that's the version, 0.19, which is we want,
right? Great, great news. All right, so now we will do a live demo on running it on my MacBook.
So my Mac specification is Apple M3 Max, which has 36 gigabytes of the unified RAM. Be careful
that if you are running this CRAM 3.535B model, so it's recommended that you have at least
32 gigabytes of unified memory. We will be using the chat model here. Let's open a terminal and
paste here. I will add a verbal so we can see the actual performance for it. The first time you're
running it, you will need to download the model, which is a pretty big model. Press enter. Yeah,
so the model size is 21 gigabytes, so make sure you have enough disk space. I'm also opening the
monitoring for the RAM for GPU. So when it's running, we can see what's actually going on.
So this is a CPU here. So for the RAM, I'm having 36 gigabytes of unified RAM. So right now,
I'm having 22 gigabytes of free RAM here. So luckily, I think that should be enough for this
one. Also, I'm having some swap. Currently, nothing is using the swap. But if the RAM usage
gets high, so I think the swap can be used to help. Yeah, we can see it's almost complete.
The 21 gigabytes can be downloaded. So now, after just successfully downloaded the model,
it will start the loading. So you can see that from the RAM here, there's a big spike from 40%
to 77%. So the compressed is 18.66. Olama uses 19 gigabytes of the RAM here.
All right, and we also see that on the terminal, we can see it shows up the
prompt entering. We can ask any question here. Yeah, we can see that it shows us the response.
There's a syncing part, and there is the final response. And it also printed out the statistics
for the generating. So for the prompt evaluation, it's 5.3 tokens per second. For the generating,
it's 66 tokens per second. Wow, this is quite fast. Although I think the prompt evaluation takes
much slower compared to the generating. How many letters in strawberry? Yeah,
we see that the GPU has been used almost 100%. So this shows that the GPU has been
efficiently used. And for the RAM, it's about 80%. Not too terrible. I think still within
our RAM limit. So I think that's a great model that fits my RAM very well. So also, we see the
statistics for the generating. The evaluation rate is about 66 tokens per second. So that's
pretty fast, I think. As you can see, it's running real time, right? Yes, correct. Three letters.
All right. Say about MLX, Apple Silicon. Okay, press Enter. Yeah, it's paying attention to the
GPU here. A big sudden spike to 100% for the utilization and all three of them. And the RAM
is at 81%. CPU doesn't use much here. All right. Yeah, it's generated quite a lot. Generated
1,640 tokens. Takes about 25 seconds for each second. Generates 65 tokens. Yes, the performance
is pretty consistent. And we do see that it works really well. And I think one of the good thing
right now, it has user interface. For example, here, you can pretty much
like user interface, right? So you can tune your parameters here. You can even enable web search.
There is a model selecting here. So yes, we can see that we can use the model. We just
download it here. And also, you can feel free to download other models.
So we'll use this one model here. And then we can enter our messages. Yeah, I think similarly,
works really well, similar to the terminal for the web UI. I think it also works very well here.
And we see similarly, the GPU utilization 100%. And it's like a nicer interface, right? If you
look at the response. So right now, there is some emoji. There is different icons. I think that's
much also the formatting over here. It's much nicer than the terminal. You can also easily
copy it, as I just showed, right? So it works quite well for the MLX together with Olama.
Thanks, Olama, for the supporting of MLX for the MacBook Mac users. Support more models.
We can support more architectures. And we can expect even faster generating. Thank you very
much. Yeah, I hope you can try it. And please post your generating speed in the comments. So I
think other people will be very interested at it. Thank you for watching. Please give it a thumb up
and share it. Please subscribe to the channel for future content. Thank you for your support.
Goodbye.