# remove # from the line below and run if packages are not installed
# !pip install numpy pandas matplotlib openai requestsLarge Language Models for Research
A workshop by: QCIF
Running on Google Colab
We will use Google Colab for the workshop. To access it, please follow these steps:
- Go to https://colab.research.google.com
- Click Sign in (top right)
- Log in using your Google account
- If you donβt have one, click Create account and follow the prompts
- Accept any prompts asking for permissions
- Once signed in, click Open Notebook then Upload, Browse and upload the notebook you want to run.
Setup Guide for Python and JupyterLab
This guide explains how to install Python, essential packages, and JupyterLab for running the LLM workshop notebooks on your computer or HPC environment.
π 1. Install Python (Recommended: Version 3.10 or newer)
Windows
Go to the official Python website: https://www.python.org/downloads/
Download the latest Python 3.x installer.
Run the installer and check the box that says:
- β Add Python to PATH
Choose Install Now and follow the prompts.
To verify installation, open Command Prompt (cmd) and type:
python --versionYou should see something like:
Python 3.11.6
macOS / Linux
Most systems come with Python preinstalled. You can check your version:
python3 --versionIf Python is not installed, install it using your system package manager:
macOS (Homebrew):
brew install pythonUbuntu / Debian:
sudo apt update && sudo apt install python3 python3-pip -yπ¦ 2. Install jupyterlab
Once Python is installed, you can install packages using pip (Pythonβs package manager).
Run this command in your terminal or command prompt:
pip install jupyterlabjupyterlabis used for running notebooks interactively.
π¦ 3. Download notebooks
Download notebooks.zip from the left menu of workshop website and extract to your desired folder.
π§ 4. Launch JupyterLab
Open terminal or command prompt and navigate to the folder containing your workshop notebooks (or navigate then open a terminal), then run:
python -m jupyter labThis will open a new tab in your default web browser with the JupyterLab interface.
You can then click on any notebook to open it.
βοΈ 5. Running on HPC
If youβre using a hosted JupyterLab instance on HPC infrastructure, Python and most dependencies are already installed. You typically only need to:
- Open the web-based JupyterLab interface.
- Load the correct Python environment (via module or dropdown).
- download and extract notebooks.zip from the left menu of the website.
- Upload notebooks to the HPCβs jupyter lab.
- Run 00_setup_guide.ipynb (this notebook).
π¦ 6. Install Required Python Packages
If the packages below are not installed uncomment (remove #) and run the cell below to install packages:
Note if you are running this in a terminal you need to remove β!β from teh start of the command. This will install:
numpyβ for handling arrays.pandasβ for handling data.matplotlibβ for plotting.openaiβ to connect to Groq or OpenAI-compatible APIs.requestsβ for fetching data from APIs.
To verify installation, run the code below:
import importlib.metadata
packages = ["numpy", "pandas", "matplotlib", "openai", "requests"]
for pkg in packages:
try:
print(f"{pkg}: {importlib.metadata.version(pkg)}")
except importlib.metadata.PackageNotFoundError:
print(f"{pkg}: not installed")numpy: 2.3.3
pandas: 2.3.3
matplotlib: 3.10.7
openai: 2.6.0
requests: 2.32.5
βοΈ 7: Get a Groq API key to access a llm online
- Sign In to Your Groq Account. Go to https://console.groq.com/login.
- If you already have an account, sign in.
- If not, create a new account and complete the verification process.
Generate Your Groq API Key: 1. Navigate to the API Keys section from the left menu.
2. Click Create API Key. 3. In the pop-up window, enter a descriptive name for your key (e.g., AI Content Labs) in the Display name for the key field.
- This helps you easily identify the key later.
4. Click Submit.
5. Copy the displayed API key β it will only be shown once.
- Save it securely for future use.
β Summary
- Install Python β₯ 3.10
- Use
pipto install required packages - Run
jupyter lab - Verify everything by opening the example notebooks
- Get a Groq API key