Welcome!

Getting Started with LLM APIs in R

R/Pharma 2025

2025-11-03

Welcome to Getting Started with LLM APIs in R!

Workshop repo: https://bit.ly/r-pharma-llm


☁️ Set up Posit Cloud:

  1. Sign up for a free Posit Cloud account: https://posit.cloud/plans.
  2. Join our workspace on Posit Cloud: https://bit.ly/llm-cloud.
  3. Go to Content, then select the r-pharma-llm project.

👋

Sara Altman

Senior Developer Advocate, AI Core

Posit

About this workshop

🏡 skaltman.github.io/r-pharma-llm

All slides and info lives here!

Workshop format

📊 Slides

💻 Demos

✏️ Exercises on Posit Cloud

Ask questions at any point in the chat

Schedule

Time Activity
01:00 - 01:15 👋 Intro
01:15 - 01:55 💬 Anatomy of a conversation
01:55 - 02:25 💻 Programming with LLMs
02:25 - 02:40 ✍️ Prompt engineering
02:40 - 03:00 🛠️ Tool calling

File organization

_exercises/ Files for Your Turn exercises
_solutions/ Solutions to those exercises
_demos/ Files for demos

Let’s Dive In!

To use an AI API…

…you need an API key!

How to get an API key, beyond this workshop

  1. 🆙 Sign up for an account with OpenAI, Anthropic, etc.

  2. 💳 Add a payment method

  3. 🔑 Get an API key

  4. 💾 Store it in .Renviron file
    as OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.

But we’ll give you API keys to use today!

  1. Use these keys for all of our activities today – they are already set up in Posit Cloud!

  2. Play and explore! But please be considerate :)

  3. We’ll turn them off at the end of the workshop

Your Turn

☁️ Set up Posit Cloud:

  1. Sign up for a free Posit Cloud account: https://posit.cloud/plans.

  2. Join our workspace on Posit Cloud: https://bit.ly/llm-cloud.

  3. Go to Content, then select the r-pharma-llm project.

🤖 Check that everything’s working:

  • Run the code in _exercises/01_hello-llm
06:00