If you would like to follow along the code demonstrations, you will either need to (1) create an account with a provider (e.g. OpenAI, Anthropic, Google) or (2) install a local model via Ollama. The latter requires you to have a sufficiently powerful computer, but the benefit is that you can use it offline. The former requires you to have an account with a provider and generally require some small payment.
(1) Create an account with a provider
You only need to create one of the account below. Currently Google Gemini models offer a free tier.
- For OpenAI (known for chatGPT, GPT models): sign up at https://platform.openai.com/signup and load a small amount of credit (e.g. $5) here. If you are already paying for chatGPT subscription, this is a different service so you do need to add credit here.
- For Anthropic (Claude model): sign up at https://console.anthropic.com and add a small amount of credit.
- For Google (Gemini models): log in to https://aistudio.google.com with your Google account (free tier available for now).
(2) Install a local model via Ollama
I will predominantly demonstrate applications using local LLMs via Ollama. This approach requires no payment as well as no internet access after you download/pull the LLM. You do require sufficient RAM to use these models locally (at least 16GB for 13b models), so it is preferable to use a more powerful computer.
Download Ollama at https://ollama.com/download.
In addition, download at least one local LLM. Please note that these local LLMs are large (several GB) and may take some time (>10 minutes) to download. I will mainly use llama3.1:8b which can be downloaded/pulled by using the command below in the terminal (not the R console):
ollama pull llama3.1:8b
If you do not have a large RAM (<8GB), you may try a smaller model such as llama3.2:1b (but its output may not be as accurate):
ollama pull llama3.2:1bTo check that ollama is installed properly, open a terminal and start ollama.
ollama serveCheck the
ollama --versionSoftware installation
To follow the code demonstrations on your own computer, please make sure to install the following software before the start of the workshop.
- Latest R (or at least version 4) https://cran.r-project.org/
- An Integrated Development Environment (IDE) for R such as RStudio
- The following R packages by running the commands below in the R console:
install.packages(c('usethis', 'tidyverse', 'ellmer'))