I have an interest in all things techie, and AI is obviously a techie area (Indeed not wishing to blow my own trumpet, but I had a paper published on AI at the CADCAM Industry symposium in Chicago in 1992). So I decide to have a play with the AI’s currently out there, see what’s actually feasible.
The first decision was which AI’s, There are a several to choose from, some, such as Chap-GPT purely textual, others, such as DELL-E focused on imagery and art. For the moment, I though Keep It Simple Stupid, and lets stay text based.
As a developer, none of the LLM AIs out there are free. ChatGPT is the closest, but it is not completely free. Then again you can understand why, forgetting the investment in creating the LLM AI in the first place, the energy costs of running the AI are humungous. If a human needed even a measurable fraction of the power that these AIs need to function, the world would be need to be a sun to generate the energy.
Anyway, back to the subject. First thing was to register with OpenAI and obtain unique API-KEY. Then I needed to install their API. I was looking to do this on my RaspberryPi web-server, as eventually I wanted to create a REST service that can accept questions and respond with answers.
On the Pi
sudo npm install openai
And that is where the problems started. I was running Buster V10.24.17 and “openai” needed at least 10.24.18. Only one bug fix version out, but enough to prevent me installing “openai”. (And yes, you are correct, I had not updated my OS since 2020).
Well I thought, as I need to upgrade, lets Upgrade to the latest OS – Bookworm. Except there is no published upgrade distro from Buster to Bookworm. Bookworm no longer uses X11 as its Windowing System, it now uses Wayland, with Wayfire as its Composer. This is a significant move. X11 has been around Unix and Linux for donkey’s years. I can remember programming X11 UI on the Sun workstations in the late 1980s early 1990s, so it probably is time that the old work horse was put out to pasture. (You can switch back to X11 if you wish
However what this meant for me was – no easy ‘apt-get upgrade….’ instead its a whole new install from scratch. Fortunately I documented the upgrade from my Pi3 to Pi4 here , and whilst the process is not identical the steps necessary are pretty much the same.
- Creating a new image using Pi Imager
- Transferring personal data onto the new card
- Installing Apache2, PHP and MySql
- Transferring the Sql databases
- Transferring the Web sites: Quintic, StephenDickinson & Nygma
- Installing the Web Site certificates
- Setting up Certificate renewal
- Installing Fail2Ban and disabling remote login for Pi & Root
One significant difference in the process is that I can have only one system operational at any time, so whilst I will be able to access the data on the Buster SD drive, by mounting it on the Bookworm drive system, any processing that I need to do on the Buster system I will need to do before I switch OSs.
The only step that falls into the above category is the transferring of the sql databases. I do need to dump the d/bs first before switching OSs.
mysqldump -u <user> -p quintic > quintic.sql
mysqldump -u <user> -p stephendickinson > sd.sql
mysqldump -u <user> -p nygma > nygma.sql
All other data and config files that I need I should be able to copy over from a mount of the Buster SD card. So, create a new image on a new SD card, pull the plug and switch cards. However before I start up the new installation, I want to disable ports 80 and 443 from being directed to the new installation until I have installed some protection.
On Rooter.
Disable all Port-forwarding to raspberryPi4