Large Language Models for Research

A workshop by: QCIF

https://www.qcif.edu.au/




Running on Google Colab

We will use Google Colab for the workshop. To access it, please follow these steps:

  1. Go to https://colab.research.google.com
  2. Click Sign in (top right)
  3. Log in using your Google account
  4. If you don’t have one, click Create account and follow the prompts
  5. Accept any prompts asking for permissions
  6. 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.


πŸ“¦ 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 jupyterlab
  • jupyterlab is 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 lab

This 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:

  1. Open the web-based JupyterLab interface.
  2. Load the correct Python environment (via module or dropdown).
  3. download and extract notebooks.zip from the left menu of the website.
  4. Upload notebooks to the HPC’s jupyter lab.
  5. 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:

# remove # from the line below and run if packages are not installed 
# !pip install numpy pandas matplotlib openai requests

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 pip to install required packages
  • Run jupyter lab
  • Verify everything by opening the example notebooks
  • Get a Groq API key