vitals

Large language model evaluation for R

https://github.com/tidyverse/vitals

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Large language model evaluation for R

Basic Info
  • Host: GitHub
  • Owner: tidyverse
  • License: other
  • Language: JavaScript
  • Default Branch: main
  • Homepage: https://vitals.tidyverse.org
  • Size: 99.8 MB
Statistics
  • Stars: 32
  • Watchers: 1
  • Forks: 4
  • Open Issues: 9
  • Releases: 1
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Code of conduct

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# vitals vitals website


[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/vitals)](https://CRAN.R-project.org/package=vitals)
[![R-CMD-check](https://github.com/tidyverse/vitals/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/vitals/actions/workflows/R-CMD-check.yaml)


vitals is a framework for large language model evaluation in R. It's specifically aimed at [ellmer](https://ellmer.tidyverse.org/) users who want to measure the effectiveness of their LLM products like [custom chat apps](https://posit.co/blog/custom-chat-app/) and [querychat](https://github.com/posit-dev/querychat) apps. You can use it to:

* Measure whether changes in your prompts or additions of new tools improve performance in your LLM product
* Compare how different models affect performance, cost, and/or latency of your LLM product
* Surface problematic behaviors in your LLM product

The package is an R port of the widely adopted Python framework [Inspect](https://inspect.ai-safety-institute.org.uk/). While the package doesn't integrate with Inspect directly, it allows users to interface with the [Inspect log viewer](https://inspect.ai-safety-institute.org.uk/log-viewer.html) and provides an on-ramp to transition to Inspect if need be by writing evaluation logs to the same file format.

## Installation

Install the vitals package from CRAN with:

```r
install.packages("vitals")
```

You can install the developmental version of vitals using:

```r
pak::pak("tidyverse/vitals")
```

## Example

LLM evaluation with vitals is composed of two main steps.

```{r}
library(vitals)
library(ellmer)
library(tibble)
```

1) First, create an evaluation **task** with the `Task$new()` method.

```{r}
#| label: tsk-new
simple_addition <- tibble(
  input = c("What's 2+2?", "What's 2+3?", "What's 2+4?"),
  target = c("4", "5", "6")
)

tsk <- Task$new(
  dataset = simple_addition, 
  solver = generate(chat_anthropic(model = "claude-sonnet-4-20250514")), 
  scorer = model_graded_qa()
)
```

Tasks are composed of three main components:

* **Datasets** are a data frame with, minimally, columns `input` and `target`. `input` represents some question or problem, and `target` gives the target response.
* **Solvers** are functions that take `input` and return some value approximating `target`, likely wrapping ellmer chats. `generate()` is the simplest scorer in vitals, and just passes the `input` to the chat's `$chat()` method, returning its result as-is.
* **Scorers** juxtapose the solvers' output with `target`, evaluating how well the solver solved the `input`.

2) Evaluate the task.

```{r}
#| label: tsk-eval
#| eval: false
tsk$eval()
```

`$eval()` will run the solver, run the scorer, and then situate the results in a persistent log file that can be explored interactively with the Inspect log viewer.

```{r}
#| label: tsk-view
#| echo: false
#| fig-alt: "A screenshot of the Inspect log viewer, an interactive app displaying information on the 3 samples evaluated in this eval."
knitr::include_graphics("man/figures/log_viewer.png")
```

Any arguments to the solver or scorer can be passed to `$eval()`, allowing for straightforward parameterization of tasks. For example, if I wanted to evaluate `chat_openai()` on this task rather than `chat_anthropic()`, I could write:

```{r}
#| label: tsk-openai
#| eval: false
tsk_openai <- tsk$clone()
tsk_openai$eval(solver_chat = chat_openai(model = "gpt-4.1"))
```

For an applied example, see the "Getting started with vitals" vignette at `vignette("vitals", package = "vitals")`.

Owner

  • Name: tidyverse
  • Login: tidyverse
  • Kind: organization

The tidyverse is a collection of R packages that share common principles and are designed to work together seamlessly

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 74
  • Watch event: 16
  • Delete event: 5
  • Issue comment event: 25
  • Push event: 111
  • Pull request review comment event: 6
  • Pull request review event: 4
  • Pull request event: 9
  • Fork event: 2
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 74
  • Watch event: 16
  • Delete event: 5
  • Issue comment event: 25
  • Push event: 111
  • Pull request review comment event: 6
  • Pull request review event: 4
  • Pull request event: 9
  • Fork event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 52
  • Total pull requests: 18
  • Average time to close issues: 10 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 0.71
  • Average comments per pull request: 0.06
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 52
  • Pull requests: 18
  • Average time to close issues: 10 days
  • Average time to close pull requests: 1 day
  • Issue authors: 4
  • Pull request authors: 4
  • Average comments per issue: 0.71
  • Average comments per pull request: 0.06
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • simonpcouch (46)
  • mattwarkentin (4)
  • JBX028 (1)
  • HuanqingWang0409 (1)
Pull Request Authors
  • simonpcouch (13)
  • hadley (2)
  • mattwarkentin (2)
  • mine-cetinkaya-rundel (1)
Top Labels
Issue Labels
pydantic (4) upkeep (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 217 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: vitals

Large Language Model Evaluation

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 217 Last month
Rankings
Dependent packages count: 26.2%
Dependent repos count: 32.2%
Average: 48.3%
Downloads: 86.5%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/live-api.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • cli * imports
  • ellmer * imports
  • httpuv * imports
  • jsonlite * imports
  • rlang * imports
  • tibble * imports
  • withr * imports
  • testthat >= 3.0.0 suggests
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v5 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite