Ep 3: Local AI, Raspberry Pi, and Running Cybersecurity Simulations

A weathered hand pinching a glowing microchip; title text AI For Luddites
A weathered hand pinching a glowing microchip; title text AI For Luddites
AI For Luddites
Ep 3: Local AI, Raspberry Pi, and Running Cybersecurity Simulations
Loading
/

John Wee and Gonzo D discuss running local open-source AI models on basic hardware for cybersecurity simulations without breaking the bank.

In this episode, Gonzo D and John Wee explore how to run open-source artificial intelligence models locally without relying on expensive cloud subscriptions. Recording while hiking in Boise, they discuss John's cybersecurity simulation project at Boise State University, which pits AI agents against each other using basic Raspberry Pi hardware. They explain the relationship between model parameter sizes and processing speed, demonstrating why smaller models often perform just as well for specific tasks. The conversation also covers how to find and download pre-trained models from repositories like Hugging Face to start experimenting with local AI at home.

In this episode

  • Running local AI models on everyday hardware.
  • Built-in AI capabilities on newer Mac computers.
  • Setting up a red team versus blue team cybersecurity simulation.
  • Preparing for the Hackfort technology exhibition in Boise.
  • Why larger AI models slow down processing times significantly.
  • Understanding AI parameters and hardware memory requirements.
  • Testing 27-billion, 9-billion, and 4-billion parameter models.
  • Using Hugging Face to find and download open-source models.
  • The importance of pre-training models for specific industry tasks.
  • Starting small with basic hardware like a Raspberry Pi.

Chapters

Time Chapter
00:00 Introduction to local open-source models
01:28 Built-in AI on newer Mac computers
03:01 Simulating cybersecurity with Raspberry Pi
05:21 Why bigger AI models aren't always better
07:23 Explaining AI parameters in layman's terms
09:45 Testing 9-billion and 4-billion parameter models
14:30 Finding models on Hugging Face
16:25 The value of pre-trained industry models
20:05 Following the BSU ITM student club

Worth quoting

The whatever model that you have locally is not going to be outsmarting or be as smart as your cloud model.

Think of a parameter as the capability of the model. The more model, the bigger it is, the more memory you need.

You go to Hugging Face, you select a model, and guess what? They also have people that already pre-trained model based on whatever industry.

Full transcript

Episode 3, recorded on a fall hike in Boise. Speakers: Gonzo D, and John Wee. This transcript was machine-generated and lightly cleaned for readability; it may contain small errors. Timestamps match the audio.

Introduction to local open-source models [00:00]

[00:02] Gonzo D: And welcome to another episode of AI for Luddites with John Wee and Gonzo D.

[00:08] John Wee: The Luddites are still here.

[00:10] Gonzo D: The Luddites are still here. Cody and Jesus are in absentia. And I think our friend Jesus is taking a step back from this. However, today we will be talking about more open source models. Yes, ladies and gentlemen, you do not have to token max your way to a burnt wallet. You can get a lot done. And John, who is AI lead at Boise State University, is going to walk us through on how to get started with cheap AI. Although that's a misnomer, you do need some hardware.

[00:49] John Wee: You still need hardware, you need electricity.

[00:52] Gonzo D: Electricity.

[00:54] John Wee: And you have to support people that want to buy Anthropic IPO. How are they going to make money if you're doing local?

[01:00] Gonzo D: So, so for someone, I'm a good example, for someone who uses Claude Code and is using it on a daily basis, how can I get started? What do I need to do to go from a paid account of either Perplexity, ChatGPT, or Claude to… Can you give us some examples of some open source models aside from Llama of Meta?

Built-in AI on newer Mac computers [01:28]

[01:28] John Wee: Well, number one, if you have a Mac, um, the latest Mac, I forgot the version number, Mac already has AI model built into your laptop or your Mac Mini.

[01:46] Gonzo D: Interesting. So some people might already have some models and they're not aware of this.

[01:49] John Wee: You already have it. All you have to do is activate and you have local AI.

[01:58] Gonzo D: Wow. So, so when the internet is down, you can still…

[02:01] John Wee: You can still be accessing AI and you'll be a local token maxing.

[02:08] Gonzo D: So how did you get started and what was your first approach to open source models? And which model did you use and why?

[02:19] John Wee: Well, number one, let's just face it. The whatever model that you have locally is not going to be outsmarting or be as smart as your cloud model.

[02:36] Gonzo D: However, I've seen some benchmarks that are pretty darn high, right? You can get up to 60%, 70% with some levels of testing almost at par, if not the same, right? And are these Moonshot?

[02:53] John Wee: Yeah, Moonshot, you have Kimi, K3s.

[02:57] Gonzo D: Which ones were you drawn towards and why?

Simulating cybersecurity with Raspberry Pi [03:01]

[03:01] John Wee: Um, you also have Qwen and they have different weight model. For example, in my latest cybersecurity project, it's going to be a simulation of cybersecurity between a red team fighting to hack into three servers in Raspberry Pi. And then you have another four Raspberry Pi as a blue team to defend. And we're running a simulation.

[03:36] Gonzo D: Wow. So you're creating an artificial environment so that you can learn more about security.

[03:44] John Wee: Yes.

[03:45] Gonzo D: And to prepare or to grow and to build with that in mind. That's brilliant.

[03:50] John Wee: Okay. So…

[03:51] Gonzo D: Now this is at, uh, the technology club at BSU.

[03:56] John Wee: Yes, this is my IT BSU student club.

[04:00] Gonzo D: Well, let's have a plug in for them. Tell us a little bit about the club and how we can support it.

[04:05] John Wee: Well, this is the club where you want to join when you want to do hands-on latest and greatest experiment, uh, like this cybersecurity simulation.

[04:16] Gonzo D: So this is wonderful. And for someone at Boise State University who wants to get exposed to technology, they should reach out to you.

[04:24] John Wee: Yeah, they should, uh, if you're in the area, in the Boise area, come check us out during Hackfort next April, April 27th.

[04:30] Gonzo D: Nice. Hackfort 27th in April.

[04:33] John Wee: Hackfort is part of Treefort Festival.

[04:35] Gonzo D: So you're preparing for that with this. And what models are you using for this particular project? It sounds like the hardware is a Raspberry Pi.

[04:41] John Wee: Yeah, we have Raspberry Pi as our hardware.

[04:44] Gonzo D: So what's the minimum CPU and RAM required for a local sourced model and which one did you choose for this particular setup?

[04:56] John Wee: Hello.

[04:58] Gonzo D: By the way, we're walking.

[04:59] John Wee: By the way, we are hiking in the beautiful fall area of Boise. So if you're hearing footsteps, we are surrounded by trees and we thought what better way to have a conversation than moving. And there are dogs.

[05:13] Gonzo D: So this is no regular studio.

[05:15] John Wee: Other people dogs versus other people dogs.

[05:17] Gonzo D: We thought we might as well enjoy it and people can get the vibe.

Why bigger AI models aren't always better [05:21]

[05:21] John Wee: Okay, so going back. So, okay, this is a simulation, right? Simulation, we're going to show it during the, during the, during Hackfort. So obviously the first thing you would think is you want the biggest model, the biggest model that you can fit into your computer. And guess what? Yeah, you can run a bigger model, but the bigger model, the more the agent is going to ask questions.

[05:52] Gonzo D: You also need memory.

[05:54] John Wee: And now one battle takes 10 minutes.

[06:01] Gonzo D: Okay.

[06:02] John Wee: So who would want to stand in front of a computer for 10 minutes to just see one result?

[06:07] Gonzo D: So, so for those who might not understand, this is not type output. There's, there's a lot of compute happening. There's a lot of…

[06:17] John Wee: There's a lot of compute. The model is going to go into the server and see what services are open. Um, they're going to try to maybe hack into it. The blue model will be able to sense, oh, wait a minute, somebody's pinging this particular port and then, oh, maybe I should patch the port.

[06:34] Gonzo D: So this particular program you're creating is cybersecurity focused. And for somebody just coming in and not understanding how models work, they also need to understand that, that this is not lightning speed. You don't just type and you have an output for those who are using ChatGPT.

[06:53] John Wee: Yes, yes. Especially when you want the model to think, because you want the model to simulate the attack, right?

[07:02] Gonzo D: So…

[07:03] John Wee: Okay, what we found out, we started with 27 billion parameter model, and we found out that it takes five minutes for one attack.

[07:13] Gonzo D: Five billion parameters.

[07:15] John Wee: 27 billion parameters. 27B.

[07:17] Gonzo D: 27 billion parameters.

[07:19] John Wee: Yeah, so it's too long. And then we're like, okay, let's scale down.

Explaining AI parameters in layman's terms [07:23]

[07:23] Gonzo D: For someone who doesn't know what a parameter is, could you explain it in layman's terms?

[07:27] John Wee: Parameter, think of a parameter as the capability of the model. The more model, the bigger it is, the more memory you need, the more GPU memory, because the way, the way LLM works is that every time you ask a question, it has to load the entire model into your memory.

[07:46] Gonzo D: So it's like a, so it's like a library. The bigger your library, the more information you can use to do what it is that you want to do with it on your computer. In this case, so it sounds like the larger your model, you obviously need a larger hard drive.

[08:04] John Wee: Yes, yeah, yeah, you need a bigger computer with bigger RAM where the model needs to go.

[08:14] Gonzo D: Do you want to go some more or you want to…

[08:16] John Wee: Uh, let's, let's keep walking.

[08:20] Gonzo D: So, so there is a hardware investment for those who hear, hey, open source models, cheap. So yes, cheap. However, what isn't cheap is your hardware. So your computer will also need, depending on what it is that you're trying to do, because just like browsing the web, there's people that don't need a MacBook Pro to browse the web. People have computers depending on their extensive use. Some people have deep software, are running programs, and in this…

[09:02] Gonzo D: this case, these models occupy a lot of space.

[09:05] John Wee: Yes.

[09:06] Gonzo D: What, how, how much memory did your Raspberry Pis or are they using currently and what models did you use for them?

[09:13] John Wee: Yeah, so we, uh, we were able, at first we were able to fit the 27, uh, billion, uh, parameter model. And then it's, but it just doesn't make sense because I want to simulate a lot of battle, like a battlefield. A battlefield doesn't, doesn't end after one, one, one of your knights hit one of the, uh, the other guy, right?

[09:35] Gonzo D: Right, you, you need… Yeah.

[09:36] John Wee: It's a battle. It's, it's gazillion of, uh, fighting, so to say. Okay, so obviously that didn't work. So, we scaled down.

[09:43] Gonzo D: So you needed more… Oh, interesting.

Testing 9-billion and 4-billion parameter models [09:45]

[09:45] John Wee: And then we say, okay, let's take a look at 9 billion parameters. Let's see what 9 billion parameters can do.

[09:51] Gonzo D: This is for cybersecurity and, uh, a simulation of, uh…

[09:53] John Wee: Yeah. So the agent is still using the model, but now instead of having to ask a big brain 27, now it's asking 9 billion. Okay. So that cut down the time quite significantly.

[10:07] Gonzo D: Oh, interesting.

[10:08] John Wee: Right? Because the model is smaller.

[10:09] Gonzo D: But you were still able to learn from what was happening.

[10:12] John Wee: Yeah, they were still, they were still, yeah, able to learn. And then…

[10:16] Gonzo D: And who won and why?

[10:18] John Wee: Okay, that, that you have to come to the exhibition and see.

[10:21] Gonzo D: Nice. Okay, great.

[10:23] John Wee: Because it is not just like, you cannot just plug in the, uh, the, uh, the, uh, LLM and then you still have to give it some rules.

[10:32] Gonzo D: This is not a… But this is not like a boxing match.

[10:35] John Wee: No. You… Okay, even in a boxing match, you have to have rules.

[10:38] Gonzo D: Yeah.

[10:39] John Wee: You cannot hit somebody below the belt.

[10:41] Gonzo D: Below the belt, certain amount of weight.

[10:43] John Wee: You cannot bite their ears. You cannot bite their, their nose. You cannot bring a gun. You still have to have rules, right? Okay. So you still have to hardcode those rules so that the model will know, hey, this is the rule of this game.

[11:01] Gonzo D: How long did it take to download and how, what was the size of the model for this particular, uh…

[11:08] John Wee: Okay. So we tried 9 billion parameters.

[11:11] Gonzo D: Okay.

[11:12] John Wee: Okay.

[11:12] Gonzo D: What model was this?

[11:14] John Wee: We used Qwen.

[11:16] Gonzo D: Qwen.

[11:16] John Wee: Qwen 9 billion. Okay. And then we tried it. We're still not happy with the time.

[11:18] Gonzo D: Qwen 9 billion.

[11:21] Gonzo D: How much memory did the computer have and what was the processor?

[11:25] John Wee: My, okay, I, I prototyped everything on my Mac.

[11:29] Gonzo D: Okay.

[11:29] John Wee: On my MacBook Pro.

[11:32] Gonzo D: Okay.

[11:32] John Wee: 36 gig of RAM is what I have.

[11:35] Gonzo D: Okay.

[11:36] John Wee: Um, but I did not use all of them because the, the model is very small. 9 billion is very small. And then we tried that and then we tried 4 billions. And guess what the result is? The intelligent level is almost the same.

[11:52] Gonzo D: Interesting. So you, you can, you don't need to do something large to learn. You can, you can make a small scale, uh, simulation to understand a rubric or, uh…

[11:59] John Wee: That is the thing. Because our rule are tiny.

[12:06] Gonzo D: Mm.

[12:07] John Wee: Right? It's not like, it's not like there's no holds barred, right? The rule are tiny. So…

[12:14] Gonzo D: So if someone has a concept that they want to study, they could also do it at a smaller scale with a smaller model.

[12:19] John Wee: Yes. And so, so we tested 27 billion, 9 billion, 4 billion, and then we tested hybrid. Hybrid means that we let our agent come in and say, do I need big brain? So hybrid we use 9 billion and 4 billion. We let it choose between 9 billions and 4 billions.

[12:36] Gonzo D: Oh, interesting. You let it choose whether, what, what amount of parameters it needed. And what did it choose and why?

[12:44] John Wee: Yeah. So that is where the log…

[12:46] Gonzo D: So you're gonna tell us more about this at Hackfort.

[12:47] John Wee: That is what we are going to show, why.

[12:51] Gonzo D: Oh, what a nice, what a, what a nice project.

[12:53] John Wee: Yeah. So that is the type of thing that, that, that…

[12:57] Gonzo D: So that's what you learn in these projects.

[12:59] John Wee: Yes, exactly.

[13:00] Gonzo D: So you get to find out, uh, not, not only is it about what you started out wanting to find out, but you actually realized, uh, when does an agent choose a specific model for more efficiency? Uh, do you actually need a lot of parameters to, to, to, uh, find a solution to your hypothesis?

[13:11] John Wee: Yes. Yes. In other words, if you have a problem, if you have a rat problem in your house, do you need to, do you need to buy an atomic bomb?

[13:27] Gonzo D: You don't burn down the house.

[13:30] John Wee: You don't. You don't.

[13:32] Gonzo D: You don't, you don't.

[13:33] John Wee: You don't. And the next one that we're gonna do is, we are going to hardcode, we're gonna see what if we just take the rule and just hardcode it. I don't need the rest of the intelligence of the AI, but I just want it to be based on these rules for the game. And see how fast we can have the results. So, every time we do this, we simulate, at first we, we, we do a smoke test, they call it a smoke test. We do it with one battle, seven round first, to see if there are any errors. And trust me, my friend, there will be errors.

[14:09] Gonzo D: And this probably, you know, I'm, I'm… It's wild because these things aren't being taught at a cybersecurity university.

[14:10] John Wee: There will be errors. I don't think they really teach you about this in the books, in the textbooks. They teach you the theory, right?

[14:20] Gonzo D: No, because, no, because these models have also just come out recently. So for someone who wants to download Qwen, uh, where can I do that? And how can I do that?

Finding models on Hugging Face [14:30]

[14:30] John Wee: Okay. I call it the eBay of, uh, LLM.

[14:35] Gonzo D: Uh-huh.

[14:36] John Wee: Where you can get everything you want.

[14:37] Gonzo D: Uh-huh.

[14:38] John Wee: The eBay for programming is GitHub, yes?

[14:40] Gonzo D: GitHub.

[14:41] John Wee: Okay. eBay for, uh, LLM is Hugging Face.

[14:43] Gonzo D: Even for starters when they go like, Hugging Face.

[14:46] John Wee: Hugging Face. There we go. Yes. This is, uh, this is your GitHub of AI and robotics.

[14:53] Gonzo D: Just purchased by Nvidia.

[14:55] John Wee: Yeah. Uh, it was, uh, very, used to be low-key some years ago. Now, Nvidia wants to buy the whole supply chain.

[15:06] Gonzo D: Well, they're in the right place.

[15:08] John Wee: Right? So you go to Hugging Face. You go to Hugging Face, you select a model, and guess what? They also have people that already pre-trained model based on whatever industry.

[15:10] Gonzo D: Or GitHub.

[15:22] Gonzo D: So I don't have to start from scratch if I'm in marketing or if I'm in cybersecurity, if I'm in education.

[15:23] John Wee: You don't have to start pre-training. Yeah. There will be model optimized for that.

[15:28] Gonzo D: There are individuals that have already been playing around with models and have, uh, pre-trained it. For somebody who doesn't understand what pre-training is…

[15:33] John Wee: Yeah. They already pre-trained. Pre-training is like, uh… Okay. Which is, this is really important because I've heard many people thinking, uh, uh, depending on your model, you get certain results. And going like, no, this model helps you interact with the world, and you might have some very unique data that you want to feed it, so that it's understanding not only of its existing database and information, but of yours. Because, and here's what's important, when people say it's gonna take our jobs, then you go, it shouldn't, because you should have a lot of information and data that you have to offer, which will set you apart from everybody else. Your company, your expertise can be used to pre-train a large language model.

[16:22] Gonzo D: Okay. I'm so glad we had this conversation and it kind of started…

The value of pre-trained industry models [16:25]

[16:25] John Wee: Let me think of a, an analogy. You want to have a party, okay? It's, uh, it's, it's summer. You're gonna have a summer, uh, get-together party.

[16:39] Gonzo D: Which by the way, we should have a party. I was gonna say, we should have a party. Why don't we have a party?

[16:42] John Wee: In which we should have next year. Okay. All right. So, you can go to, if you want to hire catering, you can go and hire generic catering people that does everything for you. Okay? So that's a model. Or, if you know that you want to do Japanese food, you can hire somebody that is only catered for Japanese food. So, you hired a specific LLM. You train your LLM to do specific tasks that you want it to do.

[17:17] Gonzo D: So go on Hugging Face, open your account, and start looking for…

[17:21] John Wee: And just search for, for, for whatever your industry is, and then…

[17:25] Gonzo D: Just like eBay, there's a, there's a lot of people creating some really fun things. Some of these models have their repositories there. Uh, what is a repository?

[17:27] John Wee: I bet you there's a… Yeah.

[17:36] John Wee: Repository is just the place, think about it like Google Drive for all LLMs.

[17:41] Gonzo D: There we go. Stored, so where they're stored.

[17:43] John Wee: Yeah.

[17:44] Gonzo D: And where I can go and use them and download them on my computer.

[17:46] John Wee: Yeah. For, for LLM. But for programming, you go to GitHub, right? It's the same thing. It's, it's the same, uh, concept. Hugging Face is also a place where there are datasets for those of us who have been playing around with robotics.

[18:02] Gonzo D: Every time that you're playing around with robotics, you want to have, uh, you want the robot to learn from what you've been doing so that the next time you do something similar, the robot already knows how to do it. Which is what, what, what is beautiful about this journey that everybody is taking, that some of us might not know it when we have free accounts or aren't using APIs, we are actually enriching the knowledge of many of these large language models and ChatGPT. There's nothing wrong with that. I think where many people are being given a lot of, uh, power to, to accentuate their current work, sometimes their, their everyday lives, uh, from making recipes.

[18:43] John Wee: Yeah.

[18:44] Gonzo D: And yes, are we in a conversation where people go like, it's not fair, where were these trained? Why aren't people getting, uh, maybe that's a conversation to have later with, with intellectual property, maybe attorneys and maybe artists. Uh, however, the reality is that we have all this abundant information and what's the best way to use of it? To remember that you have a lot to do to feed it and to pre-train it. We can talk about post-training later, but, um, if, if anybody takes anything from this episode, it is, uh, go, go get a, go, go open an account on, on Hugging Face.

[19:20] John Wee: Hugging Face.

[19:21] Gonzo D: And, um, I think it's huggingface.co.

[19:25] John Wee: I believe so.

[19:26] Gonzo D: And, uh, open, open up your account, uh, and start playing around with it.

[19:32] John Wee: And if you have a Mac, uh, newer Mac with a new OS, you, you already have, uh, they, they already pre-downloaded a model for you.

[19:40] Gonzo D: Some people are very freaked out. They're like, I don't want it. I want some software to take it away. I, I, I think I've used it on my computer and I think it's wonderful. Personally, I use, uh, Claude and, uh, but, uh, we've been talking about getting some hardware and starting to test open source. So John Wee, thank you so much. Tell us a little, uh, again, the name of, of your technology group at BSU.

Following the BSU ITM student club [20:05]

[20:05] John Wee: Oh, uh, yeah, if you want to follow us to see what we do, uh, we post frequently about technology news worldwide. It is, uh, go to Instagram and look for BSU ITM, M stands for management, club, uh, student club. Just look for that.

[20:27] Gonzo D: ITM student club. BSU ITM student club. Thank you so much. I think we still would like to know a little bit more about the benchmarks, maybe for next conversation. We'll miss Cody. We're sorry this wasn't your cup of tea, Jesus. And in the meantime, let's continue talking about artificial intelligence from people who are using it in education. And, uh…

[20:48] John Wee: Yeah, use it in the cloud, use it locally on your computer, but…

[20:51] Gonzo D: Get started. Get started playing around with it, download it, and even from a small, uh, Raspberry Pi to, to a small computer, try, try, try to find out what's the, how, how far you can push the hardware that you have before thinking that you need to get a lot.

[21:08] John Wee: My Raspberry Pi is only 8 gig, uh, gigabyte of, uh, memory. 8 gig and it runs fine.

[21:14] Gonzo D: Wow. So people don't need a lot.

[21:17] John Wee: They don't.

[21:17] Gonzo D: Uh, and from what you were saying is try, try smaller scale activities to, to learn.

[21:23] John Wee: Yeah, try, try the smaller model first, you know, or, um, um, uh, before you, uh, spend your money on expensive hardware. Maybe, maybe it's enough.

[21:33] Gonzo D: I think I'd love to start seeing a test next time of an open source model with, with Claude code side by side and, and, uh, something that we already do. Because usually these benchmarks that are done on medical tests and scholastic tests, I kind of go like, why don't we use it to do some tests that, that let's try to see if it can take on some software from our own computer and how, how, how well it does in that. And, uh, with that, let's wrap it up. Thank you for our followers. And, uh, leave us a message if there's anything that you'd like to listen to for next time. And, uh…

[22:12] John Wee: Don't forget to get out and touch grass sometimes too.

[22:15] Gonzo D: Oh yeah, we're walking. Yeah. The, sometimes the aha moments don't happen in front of a screen. So get out in nature and, uh, and tap into your wisdom. You have a lot to offer AI.

[22:28] John Wee: All right, we'll see you guys.

About the show

AI For Luddites is a plain-English podcast for the skeptical, the resistant, and the merely exhausted — no hype, no jargon, no promises that everything is about to change forever. Hosted by Gonzo D, John Wee and Cody, from 210 Digital Marketing in Eagle, Idaho.

Catch up: Episode 2: Local Models, 950 Million Tokens, and Why Free AI Isn’t Free and Episode 1: AI Reality Check, or see every episode on the AI For Luddites show page.

More from 210 Digital: our HIPAA-aware healthcare AI implementation roadmap · AI capabilities.