This is the material for the LLMs for Pi workshop run for the Sutton Trust Summer School in the Computer Lab at the University of Cambridge.
Table of Contents
This project requires only a Raspberry Pi and the ability to follow instructions.
To get going with this project first clone the repo:
git clone https://github.com/acceleratescience/llms-for-pi.git
cd llms-for-piNow run the setup script
./setup.shTo see what the script does, look in the setup.sh file. But in short, it will install all the necessary packages, download the Qwen/Qwen2.5-0.5B model, and install Ollama.
The only thing that you need to do is activate the virtual environment that was installed:
source venv/bin/activateIn the notebook intro-to-qwen.ipynb you will find a walkthrough in how to get models from Hugging Face. To run this notebook, run in the terminal:
jupyter labThis will open Jupyter Lab, and you can find the notebook (among other things), in the file explorer on the left. If you're running this in VSCode, you can access the notebook directly, without running Jupyter Lab. The main reason for not using VSCode, or some other IDE, is due to the memory constraints of the Pi (assuming you're using the 4GB model).
In this part, we will run our model in the command line. To chat with the model, run in the command line
ollama run qwen2.5:0.5bThe model parameters were already downloaded during the setup stage, but to run other models, you can
You might also be able to get away with running the 1.5B parameter model:
ollama run qwen2.5:1.5bTo browse other models, head over to Hugging Face.
The also have a fantastic selection of training courses.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the Apache 2.0 License. See LICENSE for more information.