# Relm – local LLMs as base-R objects, with interpretability

> Source: <https://github.com/Vadale/R-ebirth>
> Published: 2026-07-09 09:58:28+00:00

**R-ebirth** aims to make R a first-class environment for scientific research on
data and AI — mechanistic interpretability ("AI neuroscience"), machine learning
including topic modelling, and the life sciences — while staying simple for
researchers.

It is delivered as ** relm**: an R package with a Rust native core that
embeds a patched

`llama.cpp`

, exposing local LLMs (loading, generation,
embeddings, activation tracing, steering, and ablation) as base-R-idiom functions
returning plain `data.frame`

s and `matrix`

es.*Topic modelling with no Python: llm_embed() → UMAP → HDBSCAN → the model names
each cluster. One of two runnable demos — see the package README.*

Using the package?Start with the[package README](quickstart, examples, the two demos) and[docs/getting-started.md](install options — binaries or from source — a first run, and troubleshooting). This page is the repository/developer overview.

The first public release is here. `relm`

loads local GGUF models and exposes,
as base-R objects:

model loading,`llm()`

tokenization;`llm_tokens()`

text generation,`llm_generate()`

next-token distributions;`llm_logits()`

text embeddings;`llm_embed()`

activation tracing,`llm_trace()`

steering,`llm_steer()`

ablation — the mechanistic-interpretability core;`llm_ablate()`

checksum-verified fetch of pinned models.`llm_download()`

Every numerical feature is validated value-for-value against an independent
reference (harness B). Vision (image inputs) is the next release (v0.2.0); v0.1.0
is text-only. The full plan is in `ROADMAP.md`

.

```
rebirth/            the R package (R/, src/ + src/rust/ extendr crate, tests/, vignettes/)
rust/               Cargo workspace: rebirth-ffi (R <-> Rust boundary), rebirth-llm (engine)
rebirth/src/llama.cpp/   pinned, patched llama.cpp (vendored; see its VENDORING.md)
tests/llm-golden/   Harness B numerical goldens
tests/demos/        the two reference demos (anatomy lab; topics without Python)
```

`CLAUDE.md`

, `SOLO-PHASE-PLAN.md`

, `ROADMAP.md`

, `API-GRAMMAR.md`

,
`ARCHITECTURE.md`

, `DECISIONS.md`

, and `THESIS-PLAN.md`

. If anything else
disagrees with these files, the files win.

End users install prebuilt binaries from r-universe (no toolchain required).
Building from source requires R (>= 4.5), a C toolchain, a Rust toolchain
(`rustup`

; the pinned channel is in `rust-toolchain.toml`

), and CMake (>= 3.28)
for the vendored engine.

```
# native workspace
cd rust && cargo test && cargo clippy --all-targets -- -D warnings

# R package
R CMD build rebirth && R CMD check relm_0.1.0.tar.gz
```

Dual-licensed **MIT OR Apache-2.0** — see [LICENSE.md](/Vadale/R-ebirth/blob/main/LICENSE.md). The vendored
`llama.cpp`

is MIT (see `NOTICE`

). The name is protected: modified redistributions
must rename (see [TRADEMARK.md](/Vadale/R-ebirth/blob/main/TRADEMARK.md)).
