Hook
LLM inference in C/C++. Contribute to ggml-org/llama.cpp development by creating an account on GitHub.
More breakout videos from this creator.
If you have any PC from the last five years, you can run a real AI on it. And everyone's been asking me for this. So hit that save button. Let's get in. The trick is that the entire model doesn't actually have to live on your RAM. It actually lives on your SSD. Memory mapped. Only the necessary parts are brought into the fast VRAM at any one point. And this is called memory mapped inference. And llama.cpp does support this. So I'm going to teach you how to do it. So here's what you'll need. Any computer from the last five years with at least 8 gigabytes of RAM, but 16 is definitely preferred. You're gonna need a fast SSD. And you'll also need a quantized GGUF model like this one here. Qwen's always good. If you have Windows, you're gonna do this and install the latest llama.cpp. Place the AI we mentioned before anywhere on your SSD. Open the command prompt inside of the llama.cpp folder and run this. llama-cli.exe -m model.gguf --mmap -c 2048 -n 256. If you're on Mac, you're gonna need to install Homebrew like this. Then install llama.cpp like this. Again, make sure your quantized model is on your SSD. And then run this. Notice the --mmap option. This tells llama.cpp to memory map the model onto the SSD. So instead of loading the entire model into your RAM, it just chooses the parts and pieces that it needs at the time. Now let's talk about FPGAs because this is kind of a choke point. FPGA is like hardware that can be reprogrammed as necessary. The problem is, there is no ready-made FPGA bitstream that just allows you to do all of these things we're wanting to do with. We've gotta build it. So if you wanna attach an FPGA and we wanna talk about how to make the FPGA, I can make another how-to on that, but I can't make a how-to on creating an entire codebase that doesn't exist. One of us is just gonna have to step up and do it. The big problem, the big problem is that every FPGA is different. And a program that would work on one wouldn't necessarily work on another. So it's a bit of a complex issue. If you made it to the end, I appreciate you.