Local Large Language Model Inference Engine
Overview
Enables R users to run large language models locally using 'GGUF' model files and the 'llama.cpp' inference engine. Provides a complete R interface for loading models, generating text completions, extracting vector representations, and streaming responses in real-time. Includes grammar-constrained generation for structured output, text classification, and retrieval-augmented generation (RAG) pipelines. Supports local inference without requiring cloud APIs or internet connectivity, ensuring complete data privacy and control. Based on the 'llama.cpp' project by Georgi Gerganov (2023) https://github.com/ggml-org/llama.cpp.
Bug fixes
- **Each completion now starts from an empty context.** The KV cache was never cleared between calls, so every prompt was appended after the previous prompt and answer. Answers depended on earlier calls, and after a few calls the context filled up and every later call failed with "Failed to process prompt". This affected
edge_completion(),edge_stream_completion(),edge_grammar_completion()and the functions built on them. - **Generation can be interrupted.** Esc/Ctrl-C now stops a long generation, and
timeout_secondsinedge_completion()works: it used to have no effect until the call finished. A timeout raises a "timed out" error. The sampler is freed on every exit path.
Show all changes in 0.4.5Hide the rest of the changes in 0.4.5
- **
edge_index_documents()no longer hangs.** Splitting any document longer thanchunk_sizelooped forever.chunk_overlapmust now be smaller thanchunk_size. - **
edge_download_model()checks checksums for model names.** With a name fromedge_list_models(),expected_sha256,verify_checksumandtrust_first_usewere silently ignored. - **
trust_first_use = TRUEno longer fails after a download by URL.** Storing the hash raised an error once the file had been downloaded. - **
edge_install_cuda()no longer times out.** The ~200 MB download used R's default 60 second timeout. - **
edge_clean_cache()keeps the CUDA backend and checksum store.** Both were deleted once they were older thanmax_age_days. The size limit now removes the oldest files until the cache is under the limit; before, some caches could never get under it. - **Prompts longer than the batch size crashed the session.** The prompt was passed to the model in a single call, which llama.cpp only accepts up to
n_batchtokens (512 with the defaultn_ctx = 2048), so any prompt between that and the context size hit an internal assertion, for example a longedge_ask()context. The prompt is now fed inn_batch-sized chunks in completion, streaming and grammar-constrained generation. - **Internal llama.cpp assertions no longer kill the R session.** No ggml abort callback was ever installed, so any
GGML_ASSERT/GGML_ABORThit on R's thread ended inraise(SIGABRT). These now surface as an ordinary R error ("llama.cpp internal error: ...") and the session keeps working. Assertions on ggml worker threads still abort, because R cannot be signalled from another thread.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-14
- WARNING12 OK, 1 WARNING2026-09-09
- ERROR11 OK, 1 ERROR2026-04-25
- NOTE11 OK, 3 NOTE2026-04-22
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
Show 1 earlier changeHide 1 earlier change
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 50 (10 internal)includes a package overview page
- Examples that run
- 11%4 run in a plain check · 30 never run · 2 hold no code
- Exported functions with examples
- 90%
- Documented parameters
- 100%
- Return-value docs
- 97%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 85%
- Median days to close, 50 most recently updated closed issues
- 3
- Median days to close, 50 most recently updated closed PRs
- 1
PRs over time
Commits over time
7 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/pawanramamali/edgemodelr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
The repository owner accepts GitHub Sponsors
Show all practicesHide 1 practice
This repository shows signs of AI coding tools.
- Codexfirst seen 2025-08-30Pull request it wrote: opened by a project member
- Claude Codefirst seen 2025-09-02Named in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.4.5Latest2026-10-12 · current release · diff ↗ ·
3 hours in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-11 22:36 to 2026-10-12 01:57 UTC, in 2 readings. - 0.4.32026-09-08 · diff ↗
- 0.4.12026-05-26 · diff ↗ ·
added 19 exports
edge_install_cuda, edge_install_cuda_toolkit, edge_reload_cuda, edge_cuda_info, edge_grammar_completion, edge_json_grammar, edge_extract, edge_classify, edge_embeddings, edge_similarity, edge_model_n_embd, edge_similarity_matrix, edge_map, edge_extract_batch, edge_index_documents, edge_search, edge_ask, edge_chat_completion, edge_serve - RR 4.6.0 released · 2026-04-24
- 0.2.0
- 0.1.62026-02-07 · diff ↗
- 0.1.52026-01-29 · diff ↗
- unarchivedReturned to CRAN2026-01-22
- 0.1.42026-01-22 · diff ↗ ·
added 6 exports
edge_download_url, edge_benchmark, edge_find_gguf_models, edge_find_ollama_models, edge_load_ollama_model, edge_small_model_config - archivedRemoved from CRAN2025-10-02repeated policy violation Misrepresentation of authorship Repeated submissions with platform-dependent code, incorrectly documented Repeated submissions whilst one is under consideration,
- 0.1.02025-09-22
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-09-22
- Total releases
- 8 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.0
- Download size
- 1.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("edgemodelr")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.