LLM-powered Programming and Data Analysis

Lex Nederbragt

January 6, 2026

Lex Nederbragt

  • Associate Teaching professor, Dept. of Biosciences
  • Topics: Programming, Bioinformatics, Pedagogy
  • Teaching
    • BIOS1101 - Introduction to computational models for Biosciences
    • Other bioinformatics courses
  • Instructor for The Carpentries

Possibilities with LLMs

  • Ask for code
  • Run that code
  • Analyze (data)files

But

  • Not with UiO approved tools
  • Subscription

Tools that can do this

  • Cursor
  • Claude Code
  • Open AI Codex
  • Google Gemini CLI

This workshop

  • Something a bit different

About this workshop

Connect an IDE through an API to an LLM to produce and run code

  • IDE: Integrated Development Environment
  • API: Application Programming interface
    • let’s you ‘talk’ to a website/program/service
  • LLM: Large Language Model (e.g. chatbot)

About this workshop

Connect an IDE through an API to an LLM to produce and run code

  • IDE: Visual Studio Code from Microsoft
  • API: UiO’s Azure API to models
  • LLM: OpenAI’s GPT models

About this workshop

The goals

  • Use an LLM connected through Visual Studio Code to write computer code and execute it
  • Know the benefits of efficiently prompting the LLM, and the iterative process to obtain a functioning program
  • Discuss ethical and practical considerations when using LLM-based tools in scientific research

About this workshop

Programming language

  • Instructor will use Python
  • Should be OK to use any other language that is installed on your laptop
  • More common languagues will probaby work better

Caveats

  • Installation may be problematic for some
  • The workshop may run smooth - or not

Installation instructions

  • Python 3.11 works
  • Python 3.14 should work
  • The latest R version should work

Installation instructions

It is highly recommended to use an environment for Python.

Choose between

  • conda
  • python virtual environment

Installation using conda

conda create --name dsdays python=3.11
conda activate dsdays

Installation using python virtual env

python -m venv /path/to/workshop_folder
source /path/to/workshop_folder

Visual Studio Code

Visual Studio Code

Connecting to an LLM

  • We will provide one
  • Feel free to use your own subscription instead
    • Claude, Claude Sonnet 4.5 is recoomended by Roo Code
    • Open AI, GPT-5 Codex should be OK
    • Google, Gemini 3 Pro is best but 3 Flash should be fine too

See docs.roocode.com/providers/ for instructions

Visual Studio Code

Connecting to UiO’s Azure API to models

  • Click on the Roo Code icon (the Kangeroo) in the left sidebar
  • Choose “use another provider”
  • Select Provider: Choose “OpenAI Compatible”
  • Use the Base URL and API Key provided
  • Model: Type dsdays26 in the search box, click on “Use custom: dsdays26”
  • Select “Use Azure”
  • Click “Get Started”

Visual Studio Code

Connecting to UiO’s Azure API to models

  • Test the setup:
    • Under the message box, choose “Ask”
    • Type “Just saying Hi”
    • You should see “Task Completed”

Visual Studio Code

Roo Code will ask for permission to create a new file.

Which model do we use

  • GPT-4.1, because it is fast (and cheap), and more than good enough for this workshop
  • If we have time, we may try a more advanced model

Working directory

  • Choose a folder to work and open VS Code there (or use “File” –> “Open Folder”)

Our first task - Chatbot

Go to gpt.uio.no, select GPT 5 and ask the following question

Write a Python program that casts a die 1000 times and determines the frequency of sixes

Copy the program into VS Code and run it

  • through the terminal (built-in or external)
  • through VS Code
  • remember to activate the environment you set up

Our first task - Roo code

  • Under the message box, choose “Code”

Ask:

Write a Python program that casts a die 1000 times and determines the frequency of sixes

Roo Code will ask for permission to create a new file.

Then ask Roo Code to run it for you.

Our first task - Roo code

Now select “Ask” persona and ask:

What is the expected frequency?

Optional: put the folder under version control

  • Add and commit the script file

Another task

  • Select “Code” persona again and ask:

Change the program so that it casts two dice 1000 times and plots the distribution of the sum of the casts.

  • Give Roo Code the permissions it needs

Let’s get some data

We will be using

Tasks: population

  • Start a new task

Ask: What can you tell me about the file population.csv?

Code: Plot the population size of Norway for all years present in the dataset

Code: Plot the population size of the Nordic countries for all years present in the dataset together in one plot

Tasks: GDP, and combining datasets

Code: Plot the GDP of the Nordic countries together in one plot for all years present in the dataset from https://github.com/datasets/gdp/blob/main/data/gdp.csv

Try on your own data

Why use this setup?

  • Yellow data
  • Latest models, often available earlier than through gpt.uio.no

Ethical considerations

  • Where does the code come from?
  • Who pays for this?
  • Environmental footprint?

How to get access to UiO’s Azure resources

  • https://www-int.uio.no/tjenester/it/ki/gpt-uio/bestill-api/api.html
  • Setup fee: 800 kr
  • Takes a few working days to set up
  • Billing starts when usage > 500 NOK (per month? per year?)

Local models?

  • Often not good enough
  • Recommend using Ollama and the biggest model optimized for coding that your machine can handle
    • ollama.com
    • docs.roocode.com/providers/ollama
  • Soon: API access to local models provided by UiO/NTNU

Evaluation

https://nettskjema.no/a/dsdays2026