Skip to content

Interface for Large Language Model APIs in R

3packages dependsuggested by 1
3.8Kdownloads / year
65.3%test coverage
13/13flavors OK

Overview

About

One interface to many large language model providers: a single configuration object and a single calling function serve chat and embedding models alike, so research code does not change when the provider does. The same calls scale to multi-model and multi-condition studies. Small open models can also run on the user's computer through 'llama.cpp', downloaded only on request, with access to next-token probabilities.

Changes in 0.9.0

Local models

  • LLMR can run small open models on the user's computer through llama.cpp. llm_local_install() downloads, on request, the llama.cpp server program for the platform and a model's GGUF file from Hugging Face; it lists each file with its size, source, and license and asks for agreement first, pins every file to an exact version, checks its sha256, and makes no network request when the files are present. llm_local_models() lists the models available by name (Qwen3 0.6B, Qwen3.5 0.8B in 8 and 4 bits and its base model, IBM Granite 4.0 350M and its base model, SmolLM2 135M and 360M, and the multilingual embedding models multilingual-e5-small, Granite Embedding 311M, EmbeddingGemma 2, and bge-m3); llm_local_model() adds any GGUF file on Hugging Face. llm_local_status(), llm_local_start(), llm_local_stop(), llm_local_ready(), llm_local_dir(), and llm_local_uninstall() manage the files and servers.
Show all changes in 0.9.0Hide the rest of the changes in 0.9.0
  • New provider "llamacpp": llm_config("llamacpp", model) runs an installed model, starting its server on first use and stopping it when R exits. Chat, streaming, structured output, tools, log-probabilities, and embeddings work as for hosted providers. thinking = FALSE turns off the reasoning step of models such as Qwen3. For embedding models, task = adds the model's task prefix and dimensions = truncates to a trained size. With api_url, a llama.cpp server the user runs is used instead.
  • Token-level functions for local models: llm_next_token() returns the next-token distribution (the top tokens, or the whole vocabulary) after a chat or a raw prompt; llm_continue() continues a reply whose beginning the user writes, any number of times, sampling from the model's full distribution unless told otherwise; llm_score() gives the log-probability of each token of a text the model did not write; llm_choice_probs() compares the probabilities of several options; llm_tokenize(), llm_detokenize(), and llm_render_template() expose the tokenizer and the exact text the model reads. Each result records the model, the sha256 of its file, the llama.cpp build, the device, and the context.
  • LLMR now imports processx, which supervises the local servers, and requires curl 5.0.0 or later, whose multi_download() resumes interrupted downloads.

Other changes

  • parse_embeddings() returns rows in the order of the response's index fields when the provider reports them.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.4 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.9.0
READMEYes · 932 wordsVignettesYes · 10 · evaluation depends on the environmentNEWSYes · 100% structured · mentions 0.9.0Citation fileYes · software entry onlyWebsiteYes · pkgdown
Help pages
79 (1 internal)includes a package overview page
Examples that run
62%38 run in a plain check (1 of them under a condition) · 23 never run
Exported functions with examples
79%
Documented parameters
96%
Return-value docs
100%
Help pages citing references
1%

Downloads

3.8K
CRAN downloads in the past year
Rank #7,873 · ~10/day · ~318/mo
Daily download trend is not available in this view yet.
43630 days
1.1K90 days
3.8K1 year
Compare downloads with other packages →
Also on127 r2u8 autocran

Repository

8Stars
0Forks
0Open issues
0Open PRs
0Releases
179Commits
1Commit identities
179 commits · Last activity 2026-10-19
Responsiveness
How these are sampled
PRs merged (all time)
not measured
Median days to close, 50 most recently updated closed issues
121
Median days to close, 50 most recently updated closed PRs
not measured

Stars over time

2025-07-03 · 82026-07-07 · 8
PracticesBeta

9 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/asanaei/llmr on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Contributing guide
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-08-05 · The repository has a site deploy workflow

pkgdown site last built 2026-05-01, before release 0.9.0 (2026-10-20)

CRAN release process (1)
cran-comments.md
Show all practicesHide 2 practices
Research and citation (1)
CITATION.cff
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
29 external dependencies (excludes base and recommended)

Installing LLMR adds 39 packages (25 with compiled code, 23 MB of source tarballs). Heaviest: stringi 11 MB, openssl 1.1 MB, jsonlite 1.0 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
3direct
0indirect
Imports 3
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (1)
Author, Maintainer since 0.1.1 (2024)
Releases (15)

Pick two releases to compare their code metrics.

  • 0.9.0Latest
    record
    2026-10-20 · current release · diff ↗ ·
    removed 1 export
    llm_methods_text
    added 16 exports
    llm_choice_probs, llm_continue, llm_detokenize, llm_local_dir, llm_local_install, llm_local_model, llm_local_models, llm_local_ready, llm_local_start, llm_local_status, llm_local_stop, llm_local_uninstall, llm_next_token, llm_render_template, llm_score, llm_tokenize
    ·
    listed once in CRAN's queue
    Seen in one reading of CRAN's incoming queue, at 2026-10-20 01:24 UTC, so it stayed less than the time between readings.
  • 0.8.11
    record
    2026-07-24 · diff ↗ ·
    removed 10 exports
    bind_tools, cache_llm_call, expand_llm_config, llm_add_request_hash, llm_cross_design, llm_log_merge, llm_parse_rowpack_tags, llm_persona_dictionary, llm_uuid, log_llm_error
  • 0.8.10
    record
    2026-07-10 · diff ↗ ·
    added 12 exports
    ensure_alternating_messages, llm_add_request_hash, llm_log_active, llm_log_merge, llm_persona_demographic_fields, llm_persona_dictionary, llm_persona_overview, llm_persona_split, llm_tool_signature, llm_uuid, llm_validate_persona_frame, transcript_as_messages
  • 0.8.6
    record
    2026-06-17 · diff ↗ ·
    added 35 exports
    call_llm_par_tags, call_llm_stream, call_llm_tools, diagnostics, expand_llm_config, llm_agreement, llm_api_key_env, llm_batch_cancel, llm_batch_fetch, llm_batch_status, llm_batch_submit, llm_cross_design, llm_failures, llm_fn_tags, llm_hash, llm_judge, llm_log_disable, llm_log_enable, llm_log_read, llm_log_status, llm_logprobs, llm_methods_text, llm_par_resume, llm_parse_rowpack_tags, llm_preview, llm_render_messages, llm_replicate, llm_request_from_log, llm_request_hash, llm_response_record and 5 more
  • 0.6.4
    record
    2026-05-21 · diff ↗ ·
    added 3 exports
    llm_mutate_tags, llm_parse_tags, llm_parse_tags_col
  • R
    R 4.6.0 released · 2026-04-24
  • 0.6.3
    record
    2025-10-11 · diff ↗ ·
    removed 1 export
    llm_api_key_env
  • 0.6.0
    record
    2025-08-26 · diff ↗ ·
    added 13 exports
    bind_tools, call_llm_par_structured, disable_structured_output, enable_structured_output, finish_reason, is_truncated, llm_api_key_env, llm_fn_structured, llm_mutate_structured, llm_parse_structured, llm_parse_structured_col, llm_validate_structured_col, tokens
  • 0.5.0
    record
    2025-07-17 · diff ↗ ·
    removed 3 exports
    Agent, AgentAction, LLMConversation
    added 1 export
    chat_session
  • 0.4.2
    record
    2025-06-26 · diff ↗ ·
    added 3 exports
    build_factorial_experiments, llm_fn, llm_mutate
  • 0.3.0
    record
    2025-05-28 · diff ↗ ·
    added 7 exports
    call_llm_broadcast, call_llm_compare, call_llm_par, call_llm_sweep, get_batched_embeddings, reset_llm_parallel, setup_llm_parallel
  • R
    R 4.5.0 released · 2025-04-11
  • 0.2.5
    record
    2025-03-18 · diff ↗ ·
    added 3 exports
    cache_llm_call, call_llm_robust, log_llm_error
  • 0.2.3
    record
    2025-03-13 · diff ↗
  • 0.2.1
    record
    2025-02-11 · diff ↗ ·
    added 3 exports
    Agent, AgentAction, LLMConversation
  • 0.1.2
    record
    2025-01-17 · diff ↗ ·
    added 1 export
    parse_embeddings
Show 2 earlier eventsHide 2 earlier events
  • 0.1.1
    record
    2024-10-21
  • R
    R 4.4.0 released · 2024-04-24
Across CRAN, the median accepted release of the past year spent 23 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2024-10-21
Total releases
15 / 2 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Bundled data
17 KB / 1 file
Download size
741 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("LLMR")

The package provides a citation file, so citation() returns the authors' own entry.

The repository also keeps a CITATION.cff.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for LLMR version 0.9.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy