labcatalog runs without R and without a language model. R adds factor models and lets every analysis run in R; a language model drafts instruments and scoring scripts. Both are settings of your computer, made on the Settings page, and labcatalog never installs either for you.
R and the packages it needs¶
With R, labcatalog runs the analyses on the Analysis and Methods pages and the factor models in R, and in Python only when R is not set or fails. Confirmatory factor analysis and ω also have a Python version, but measurement invariance (across waves, reporters or groups) needs R.
Install R from CRAN.
In R, install the packages labcatalog uses:
install.packages(c("lavaan", "semTools", "psych", "effectsize", "MBESS", "lme4", "lmerTest", "performance"))On the Settings page, under R, give the path to
Rscript, which is in R’sbinfolder, for exampleC:\Program Files\R\R-4.5.2\bin\Rscript.exeon Windows or/usr/local/bin/Rscripton macOS and Linux.Press Save and check. labcatalog runs R once and reports its version and any packages that are missing, with the command to install them.
Every analysis shows whether it was computed in R or in Python, and its Code section has both versions.
Language models¶
A language model can:
draft an instrument file, scores included, from the instrument’s PDF or Word file, with a Word file’s pictures for a model that reads images (the editor in the Codebook step of the Set up page);
draft the description for the Measures paragraph and write scoring scripts from the reference PDF (an instrument’s page);
find items by what they ask about (the Instruments page);
draft a cleaning script from a raw export, and a fix to a cleaning script for a reported problem (the Set up and Problems pages; see Register Prepare Steps).
What it writes is always a draft for you to check, and the references, license and tags are always filled in by hand. These features need the ai extra (see Installation).
On the Settings page, under This project, choose the provider and the model, and press Save. They are saved in the project, so the whole lab uses the same model. What each person needs is set on their own computer:
Anthropic, OpenAI or Gemini: labcatalog reads the API key from an environment variable,
ANTHROPIC_API_KEY,OPENAI_API_KEYorGEMINI_API_KEY, and never stores it. Set it yourself and restart labcatalog. On Windows:setx ANTHROPIC_API_KEY your-keyin a terminal. On macOS or Linux, addexport ANTHROPIC_API_KEY=your-keyto your shell profile. The page says whether the variable is set.Local (OpenAI-compatible server): a model running on your own computer or server, for example with Ollama or LM Studio. Give the server’s address, for example
http://127.0.0.1:11434/v1; on Windows,localhostin the address makes every request wait about two seconds. Nothing leaves your network. A local model writes at most 16,000 tokens per answer, so one that starts repeating itself stops with a message instead of running on.
With a cloud provider, the text you send (a PDF’s or Word file’s text, item wording) and the pictures you send go to that provider. Do not send anything your data agreements do not allow.