Sign in

James Wade

@jameshwade.bsky.social
2.1K followers 1.4K following 37 posts

Analytical chemist in industry working on materials characterization and data science. Interested in #rstats, modeling, & sustainability. Owner of many pets.

PostsRepliesMedia
Reposted by James Wade
Jon Harmon (he/him/his) @jonthegeek.com · 10/08/2026
When @jameshwade.bsky.social mentioned hex stickers at our last #PositConf2026 speaker training, I realized I didn't have any for stbl.wrangle.zone, the #RStats 📦 I'm speaking about! Thankfully I had time to order a small batch. The url is unreadable, I'll have to fix that if I order another batch.
Hex logo stickers for the R package stbl, featuring the letters stbl seemingly engraved in stone.
061
James Wade @jameshwade.bsky.social · 15/02/2026
And the python version using DSPy: 🔗 jameshwade.github.io/dspy-explorer/ 📖 github.com/JamesHWade/d... (You can run your own traces if you clone the app locally.)
jameshwade.github.io
Shiny App
031
James Wade @jameshwade.bsky.social · 15/02/2026
Try it and run your own RLM modules. Interactive app: jameshwade-rlm.share.connect.posit.cloud How RLMs work: jameshwade.github.io/dsprrr/artic... Hands-on tutorial: jameshwade.github.io/dsprrr/artic...
jameshwade-rlm.share.connect.posit.cloud
How RLMs Work - dsprrr Interactive Demo
120
James Wade @jameshwade.bsky.social · 15/02/2026
By the way, this is a shiny app. Built with as a React frontend via posit/shiny-react, deployed on Posit Connect Cloud. shinyreact lets you use React components as Shiny UI, great for this kind of step-through visualization.
120
James Wade @jameshwade.bsky.social · 15/02/2026
The app replays RLM traces step by step. Watch the model search 4M characters of R package source code, execute R in an isolated process, and narrow in on a theming bug in bslib (issue #1123) across bslib, shiny, and brand.yml. A sidebar shows how little data actually enters the context window.
110
James Wade @jameshwade.bsky.social · 15/02/2026
Because an RLM is a dsprrr (or DSPy) module, you can optimize it. Run a teleprompter over it. Bootstrap few-shot examples. Grid search parameters. Compose it with other modules in a larger program.
100
James Wade @jameshwade.bsky.social · 15/02/2026
"How is this different from a coding agent?" Three things: 1. Context is externalized as a variable, not verbalized as tokens 2. Sub-LLM calls are launched from code (symbolic recursion), not generated token-by-token 3. Sub-calls scale linearly with context size, because each prompt stays short
100
James Wade @jameshwade.bsky.social · 15/02/2026
LLMs get worse as context gets longer. Context rot. RLMs fix it by externalizing context as a variable instead of pasting it into the prompt. The model writes code to explore the data via a REPL: peek at slices, search with regex, launch sub-LLMs. Each iteration feeds results back into the next.
110
James Wade @jameshwade.bsky.social · 15/02/2026
Coding agents can explore codebases. But you can't optimize them, compose them, or put them in a pipeline. RLMs can do all of that. They're DSPy modules, not agents. I built a shiny app to understand how they work.
161
James Wade @jameshwade.bsky.social · 08/02/2026
There are several limitations compared to a fully shiny app, but I'd love to hear ideas where you this might be useful for you. jameshwade.github.io/shinymcp/
000
James Wade @jameshwade.bsky.social · 08/02/2026
shinymcp includes a pipeline that can scaffold an MCP App from an existing Shiny app. It does this by parsing and analyzing your Shiny app code to generate the shinymcp app automatically.
100
James Wade @jameshwade.bsky.social · 08/02/2026
The core idea is to flatten your reactive graph into tool functions. Each connected group of inputs + reactives + outputs becomes a single tool that takes input values as arguments and returns a named list of outputs.
100
James Wade @jameshwade.bsky.social · 08/02/2026
shinymcp swaps Shiny's JS runtime for a tiny bridge that talks to Claude Desktop. Your R functions run server-side, and results flow back to interactive widgets right in the chat window. The same protocol is supported in ChatGPT and GitHub Copilot chat.
100
James Wade @jameshwade.bsky.social · 08/02/2026
An MCP App has two parts: UI components that render in the chat interface and tools that run R code when inputs change. When the tool is invoked, an interactive UI appears inline in the conversation. Changing the inputs calls the tool and updates the output.
100
James Wade @jameshwade.bsky.social · 08/02/2026
I built an R package that turns Shiny apps into UIs that render directly inside Claude Desktop or ChatGPT. It's called shinymcp. Drop-downs, plots, tables all inline in the chat. github.com/jameshwade/shinymcp
36411
James Wade @jameshwade.bsky.social · 07/02/2026
The electronic lab notebook vendors (Benchling, BIOVIA, PerkinElmer Signals) have essentially formalized the traditional workflow. Their docs/demos are a surprisingly good guide to what pen-and-paper notebooks can look like in practice. (very curious what's driving this question)
020
James Wade @jameshwade.bsky.social · 07/01/2026
Lots of docs here: jameshwade.github.io/dsprrr/
jameshwade.github.io
dsprrr: Programming—not prompting—LLMs in R
dsprrr brings the power of DSPy to R. Instead of wrestling with prompt strings, declare what you want, compose modules into pipelines, and let optimization find the best prompts automatically.
010
James Wade @jameshwade.bsky.social · 07/01/2026
It's still early, but enough pieces are there to play around: >10 module types and optimization strategies (teleprompters). Built in bridges to vitals for evals. Install with pak::pak("jameshwade/dsprrr") Github: github.com/jameshwade/d...
github.com
GitHub - JamesHWade/dsprrr: Declarative Self-Improving Language Programs for R
Declarative Self-Improving Language Programs for R - JamesHWade/dsprrr
110
James Wade @jameshwade.bsky.social · 07/01/2026
Optimization means things like searching over prompt templates, adding few-shot examples automatically, trying different instruction phrasings, all driven by actual metrics.
100
James Wade @jameshwade.bsky.social · 07/01/2026
Basic workflow starts by defining a typed signature (inputs → outputs), wrap it in a module, run it against a dataset, measure with a metric, optimize until it works. signature("question -> answer") |> module() |> evaluate(test_set, metric_exact_match())
100
James Wade @jameshwade.bsky.social · 07/01/2026
It builds on the existing R ecosystem: - ellmer for LLM calls - vitals for evaluation - tidymodels patterns for optimization dsprrr is the glue that ties them into a coherent programming model.
120
James Wade @jameshwade.bsky.social · 07/01/2026
My holiday project was building dsprrr, a package for declarative LLM programming in R, inspired by DSPy. The core idea is to treat LLM workflows as programs you can systematically optimize, not prompt strings you tweak by hand.
dsprrr
Programming—not prompting—LLMs in R
dsprrr brings the power of DSPy to R. Instead of wrestling with prompt strings, declare what you want, compose modules into pipelines, and let optimization find the best prompts automatically.

# Install
pak::pak("JamesHWade/dsprrr")

# That's it. Start using LLMs.
library(dsprrr)
dsp("question -> answer", question = "What is the capital of France?")
#> "Paris"
Getting Started: Configure Your LLM
OpenAI
Anthropic
Gemini
Ollama
Auto-detect
141
James Wade @jameshwade.bsky.social · 20/09/2025
Thank you!!!
000
Reposted by James Wade
Simon P. Couch @simonpcouch.com · 09/12/2024
Introducing ensure, a new #rstats package for LLM-assisted unit testing in RStudio! Select some code, press a shortcut, and then the helper will stream testing code into the corresponding test file that incorporates context from your project. github.com/simonpcouch/...
312526
James Wade @jameshwade.bsky.social · 26/11/2024
I’d like to learn how the boundaries of the tidyverse have changed over time. Would you consider removing a package from the tidyverse - maybe you already have? This overlaps with @ivelasq3.bsky.social’s question I think.
210
James Wade @jameshwade.bsky.social · 20/11/2024
Great 📦 name! Will be giving this a try for sure.
010
James Wade @jameshwade.bsky.social · 18/11/2024
Jumping on the #rstats "we're so back" train 🚂 Here's two fun (unrelated) things I scrolled upon tonight: 📊 tinyplot - base R plotting system with grouping, legends, facets, and more 👀 github.com/grantmcdermo... 🔎 openalexR - Clean API access to search OpenAlex docs.ropensci.org/openalexR/ar...
github.com
GitHub - grantmcdermott/tinyplot: Lightweight extension of the base R graphics system
Lightweight extension of the base R graphics system - grantmcdermott/tinyplot
1295
James Wade @jameshwade.bsky.social · 08/11/2024
Would love to be included ✨
110
James Wade @jameshwade.bsky.social · 08/11/2024
😍
000
James Wade @jameshwade.bsky.social · 06/11/2024
Update... I just pranked myself with this 🙈 Protip: restart your session when you open a new file
160
James Wade @jameshwade.bsky.social · 06/11/2024
Worst prank *ever*
read_csv <- function(file) { readr::read_csv(file) |> messy::messy()}
2193
James Wade @jameshwade.bsky.social · 06/11/2024
And in vctrs no less. I used that a few months back for a side project and felt so fancy
000
James Wade @jameshwade.bsky.social · 06/11/2024
Do you use mirai directly or via something like crew?
100
James Wade @jameshwade.bsky.social · 05/11/2024
That’s a new one for me. Trying that out tomorrow
030
James Wade @jameshwade.bsky.social · 05/11/2024
Having a hard time focusing on code today. Instead of refreshing news sites, tell me about an R package or function that made your life easier recently? I finally figured out how group_modify() works, and it's been a game-changer for some nested data madness. #rstats #dataBS
7183
James Wade @jameshwade.bsky.social · 29/10/2024
If you’ve been waiting try out LLMs with code, now is the time to do it.
130
Reposted by James Wade
Rachael Dempsey @rachaeldempsey.bsky.social · 29/10/2024
The last Wednesday of each month I host a Workflow Demo with various Posit folks 💛 Tomorrow Oct 30th @ 11am ET Ryan Johnson will share how to use #Quarto & #Shiny to create #Typst PDFs dynamically 🎉 add to 🗓️: pos.it/team-demo I know it's during R/Pharma 😬 so please know it's recorded too!
0165
James Wade @jameshwade.bsky.social · 29/10/2024
elmer: github.com/hadley/elmer shinychat: github.com/jcheng5/shin...
github.com
GitHub - hadley/elmer: Call LLM APIs from R
Call LLM APIs from R. Contribute to hadley/elmer development by creating an account on GitHub.
040
James Wade @jameshwade.bsky.social · 29/10/2024
You can now build a chatbot in shiny in less than 20 lines of code. shinychat and elmer make this much easier than it was even a month ago. elmer nails LLM abstractions. Go check them out if you haven't already!
library(shiny)

ui <- bslib::page_fluid(
  shinychat::chat_ui("chat")
)

server <- function(input, output, session) {
  chat <- elmer::chat_openai(
    model = "gpt-4o-mini",
    system_prompt = "You are a pithy, but helpful assistant."
  )
  observeEvent(input$chat_user_input, {
    stream <- chat$stream_async(input$chat_user_input)
    shinychat::chat_append("chat", stream)
  })
}

shinyApp(ui, server)
180
James Wade @jameshwade.bsky.social · 29/10/2024
I had fun giving a talk at #rpharma about how to integrate AI into your shiny apps. You can check out my talk here: jameshwade.github.io/r-pharma-talk/
Integrating AI Assistants into Shiny Apps: Simply Development and Enhance User Experience
171