Getting Started with ElicitationWizard

Overview

ElicitationWizard is an R package that provides an interactive Shiny application for eliciting Bayesian prior distributions using large language models (LLMs). It queries multiple LLM “experts” in parallel, parses their responses into named probability distributions, and aggregates them via opinion pooling or the Delphi method.


Installation

Install the package from CRAN:

install.packages("ElicitationWizard")

Or install the development version from GitHub:

# install.packages("pak")
pak::pak("JefferyAyiti/Automated_Elicitation")

Dependencies

The following R packages are required and will be installed automatically:

Package Purpose
shiny Web application framework
bslib Bootstrap theming (flatly theme)
shinyjs Button enable/disable during async calls
ellmer LLM API client (chat_openai_compatible())
future Parallel async execution
promises Non-blocking promise handling
commonmark Markdown rendering

API Requirements

ElicitationWizard connects to any OpenAI-compatible API endpoint. You need:

We recommend SAIA (Scalable AI Accelerator), which provides OpenAI-compatible access to a range of open models including those used by this package. Other compatible providers include:

These can be provided in two ways:

Option 1 — Environment variables (recommended):

Sys.setenv(BASE_URL = "https://your-endpoint/v1")
Sys.setenv(API_KEY  = "sk-...")

Or add them to your .Renviron file for persistence across sessions:

BASE_URL=https://your-endpoint/v1
API_KEY=sk-...

Option 2 — Enter directly in the app via the “API Connection” panel in the sidebar.


Launching the App

library(ElicitationWizard)
run_elicitation()

Interface Overview

The app has a sidebar for configuration and a main panel with four tabs.

Main Panel Tabs

Tab Description
Expert Responses Full markdown-rendered responses from each expert, with LaTeX support
Prior Summary Parsed distributions in a table + density overlay plots
Opinion Pooling Linear pooled distribution across all valid experts
Delphi Method Multi-round iterative elicitation with peer feedback

Available Models

Elicitation Models

These models act as the LLM “experts”:

Label Model ID
MedGemma-27b-it medgemma-27b-it
Gemma-3-27b-it gemma-3-27b-it
Deepseek-R1-L-70b deepseek-r1-distill-llama-70b
Llama-3.3-70b llama-3.3-70b-instruct
Qwen-3-I-30b qwen3-30b-a3b-instruct-2507
Mistral-3-675B mistral-large-3-675b-instruct-2512

Stan Code Generation Models

Used by the “Generate Stan Code” buttons:

Label Model ID
Qwen-Coder (default) qwen3-coder-30b-a3b-instruct

Supported Distribution Families

The parser recognises the following families in expert responses:

Normal, Log-Normal, Beta, Gamma, Exponential, Half-Normal, Cauchy, Half-Cauchy, Uniform, Weibull, Poisson, Student-t, Inverse-Gamma, Log-Logistic, Pareto

Note: Dirichlet and Binomial are recognised but not supported by the density pipeline and will be marked as invalid.


Next Steps

See vignette("tutorial", package = "ElicitationWizard") for a step-by-step walkthrough of a complete prior elicitation session using the default Poisson-Gamma clinical trial example.