Running a Large Language Model on a Raspberry Pi 5

I never said it was perfect

I found this article which describes how you can get a something a bit like ChatGPT running on a Raspberry Pi. You need the latest Raspberry Pi 5, and it also needs the largest one with 8Gb of memory but it does work. It’s a bit slow and not very accurate, but it is fun to chat with. I think it is very useful to show slightly broken versions of the technology to folks so that they start to understand their limitations.

I’m now very tempted to make an “exchange” for the Red Phone which runs this engine and rings you back with answers to questions.

Finding Serial Ports in Python on the Raspberry Pi

Nothing to do with the post. But another picture I like

One of the more annoying quirks of using usb serial ports is that they move about a bit. The precise port that you get when you plug the same device into your computer is subject to change. This can be annoying; particularly if you want to make something that just works. With all that in mind I present this:

def get_port(self, portNames):
result = None
for portName in portNames:
    try:
        print("Connecting to " + portName)
        result = serial.Serial(portName, 115200)
        print("    Connected")
        return result
    except :
        print("    Connect failed to " + portName)
return result

The get_port function is given a list of ports that might have something behind them. It then works through the list trying each one and returns either a port that worked or None.

ports = ["/dev/ttyACM0","/dev/ttyACM1","/dev/ttyACM2"]
serial_port = self.get_port(ports)

You call it as shown above. The ports variable contains a list of addresses. When the function completes it will either have a useable port or None. I’ve found it quite useful.

Musical Meetup Fun

We had a fair amount of hardware to play with

We had a lovely meetup this evening, greatly enlivened by some newcomers keen to learn stuff. The theme was musical and so we had a few devices to play with including my Chocolate Synthbox, a Synthstrom Deluge, an Organelle, a Norns Shield and Tenori-On. Much fun was had, with plenty of clicks, beeps and musical-ish sounds beating out.

We had some wonderful chats about ChatGPT, air quality, how a piano works (and how to mechanise it), lithophanes, HueForge and of course robots.

There was so much interest in Hull Pixelbots that we’ve decided to get together and build a bunch. We’ll be meeting up in two weeks (20th March) at 5:30pm in Hull MakerSpace and having a go. I’ll be publishing a shopping of list of parts soon. If you want to go on the mailing list for the Meetup send an email to addmetothelist@hullpixelbot.com

Dead Mouse

I don’t think it was my mending that broke it

My mouse has broken. I’ve had it ages. It’s a Microsoft Sculpt Comfort mouse and I really like it. Everything works but the scroll wheel. This has happened before so I took it apart and cleaned it. And it is still broken. This is a big thing. I’ve had it for ages. It came with a keyboard/mouse pack from which the keyboard has long gone. I’m now making do with a flat mouse and looking at horribly expensive “new-old” stock.

Pro tip. If you find a keyboard or a mouse that you really like you should buy a couple of them and pop one away for the future….

Speaker Wisdom at DDD North

This picture has nothing to do with the subject of this post. I just like how it came out.

One of the best bits of DDD yesterday was getting together with some students to talk about plans for the future. Boss had organised a bunch of speakers to have a word with a bunch of students. For me it was great to hear folks echoing what I used to tell students all those years ago. All of the speakers had great stories and I chipped in occasionally too. But I think all the advice can really be summed up very simply:

Do stuff and tell people about it.

People who might fancy hiring you will expect you to have completed your studies successfully. But if the only “war stories” that you have to tell are about your assessments you will find yourself at a disadvantage. You need to have other things you have made, done or failed at to talk about. And they don’t necessarily have to be in software. You should form a policy of finding things to do and ways in which you can use them to your advantage. If you take care of that you might find that your future will take care of itself.

Talking ChatGPT at DDD North 2024

A great audience here in black and white

Did my talk at DDD 2024 this morning. After a brief panic where it turned out that my HDMI adapter wouldn’t talk to the video system I managed to get everything working (thanks Warren for lending a working adapter). The audience was great and we had a splendid discussion afterwards. You can find the slide deck here.

Musical Hardware Meetup March 6th

I’ll be keeping the lid on though

Our monthly hardware meetup for March will be on Wednesday 6th March in the MakerSpace at the top of Hull Central Library. We start around 5:30 pm and then go on until 7:00 pm or so. We theme the meetups, the March one is all about music. I’ll bring along the MIDI CheeseBox, Crackers Controller and Chocolate Synth along with a few more conventional devices. If you’ve got something you want to show off or talk about, feel free to bring it along.

No need to sign in or anything, just turn up and take part. It would be lovely to see you.

Robot Power Adapter

Very useful if you kept buying 12v power adapters instead of 5V power adapters….

One of our students showed me a useful gadget today. You can plug a 12 supply into it and get out 5v, 3.3v and the 12v going in. The two onboard regulators aren’t good for particularly high currents at around 800ma each, but this is a terribly useful controller if you are building a robot and want 12 for the motors and then the other voltages for your onboard devices.

Inky Fingers

Keep the bottles of ink well away from the users…

These things are quite fun. They are little rollers which print out sums when rolled down the page. Each roller is in two halves which can be adjusted so that the sums are different. Great for a little someone who just happens to like doing maths. Search for “Roller Teaching Stamp” if you want some.

Just don’t touch the rollers to check whether or they have ink on. They have.

First Man In at DDD

What Dall-E thinKs I look like. I’ll show the real picture of me at the session…

I’ve got the schedule for DDD North next week. I’m on first thing at 9:30 which will be fun. I’m talking about ChatGPT and my existential crisis.

Apparently they’ve had such a demand for tickets that they’ve had to add a bunch more. I’m really looking forward to it. Now I just have to decide which camera to take along….

Recommended Toothbrush

It comes with a snazzy case as well

It has to be said that I don’t usually put toothbrush recommendations in this blog. But yesterday m dental hygienist insisted that I get a new toothbrush and even wrote down the make and model. It arrived this morning and I must admit it is rather good. It lights up when I press too hard and even tells me how much time to spend on each quadrant of my mouth (before today I didn’t even know that my mouth had quadrants).