Skip to content

ellmer

0.5.0Package record

Chat with Large Language Models

27packages dependsuggested by 35
153.8Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

Chat with large language models from a range of providers including 'Claude' https://claude.ai, 'OpenAI' https://chatgpt.com, and more. Supports streaming, asynchronous calls, tool calling, and structured data extraction.

Changes in 0.5.0

Lifecycle changes

  • chat_github() and models_github() are now defunct because GitHub Models has been retired (@thisisnic, #1069).
  • tool() functions that return complex objects like data frames or lists now produce a deprecation warning. Tool functions should return a character vector, an atomic vector, a JSON string (from jsonlite::toJSON()), or a Content object. Use jsonlite::toJSON() to convert complex objects before returning (@thisisnic, #858).

New features

  • When running on Posit Connect, ellmer now forwards the viewer's session token to Connect's LLM gateway so gateway usage can be attributed to the viewer. This happens automatically for Shiny content and only affects requests to the gateway (@karawoo, #1105).
  • chat_aws_bedrock() gains an api argument to select between the Converse API on the bedrock-runtime endpoint and the Anthropic Messages or OpenAI Responses APIs on the bedrock-mantle endpoint. This makes models that Converse can't serve, like Claude Mythos and the GPT-5 family, available on Bedrock. The API is picked from model by default, so you only need to set api for models ellmer doesn't recognize (#1064).
  • Chat gains experimental $file_upload(), $file_list(), $file_get(), $file_download(), and $file_delete() methods for managing provider-hosted files with chat_openai(), chat_anthropic(), and chat_google_gemini(): upload a file once, then pass the returned reference to $chat() instead of re-sending the file's contents every turn. Uploads expire after 48 hours by default; use expires_in_h to change this. claude_file_upload() and friends and google_upload() are deprecated in favor of these (@thisisnic, #1091).
  • Chat gains $get_rounds() and $last_round() methods for retrieving the conversation history grouped into Rounds. The new Round class groups a Chat's flat turn history into rounds, each containing a user turn and the assistant/tool-result turns that follow it (#507).
  • Chat gains $on_request_start() and $on_request_end() callbacks that fire before and after each model request, including each round of the tool loop. $on_request_start() receives the turns about to be sent, so you can inspect the request or compact the conversation with $set_turns(). $on_request_end() receives the assistant turn just returned, so you can track latency or cost per request (@kaipingyang, #1051).
  • Chat$stream() and Chat$stream_async() gain a type argument for streaming structured output from providers with native support (@cpsievert, #1102).
  • Chat gains a $token_count() method that estimates the number of tokens in new input using the provider's token counting endpoint (@thisisnic, #814).
  • claude_tool_web_search(), claude_tool_web_fetch(citations = TRUE), google_tool_web_search(), and openai_tool_web_search() now return citations, which are preserved in chat history and streamed content and shown as cited sources in console output (@cpsievert, #775).
Show all changes in 0.5.0Hide the rest of the changes in 0.5.0
  • New content_document_file() and content_document_url() send text-based documents like CSV, markdown, and code files to the model, and content_pdf_url() now lets providers that can fetch URLs do so themselves (@thisisnic, #1090).
  • New Model class separates model configuration (name, parameters, extra arguments) from the Provider class, which now only captures API endpoint details. Chat gains a new $get_model_object() method to retrieve the Model object. provider@model, provider@params, and provider@extra_args are deprecated and will be removed in a future release; use the Model object instead (@thisisnic, #1098).
  • New models_update_prices() downloads the latest model pricing data from GitHub and saves it to a local cache. Subsequent calls to token_usage() and related functions will use the updated prices (#968).
  • tool_context() lets a tool access its calling context, including the ContentToolRequest and the conversation history, during a tool call. with_tool_context() and local_tool_context() support testing tools that use it (#871).

Minor improvements and bug fixes

  • Default models have been updated for a number of providers (@thisisnic, #1040, #1066, #1125):
  • chat_anthropic() now uses claude-sonnet-5.
  • chat_aws_bedrock() now uses us.anthropic.claude-sonnet-5.
  • chat_databricks() now uses databricks-claude-sonnet-5.
  • chat_google_gemini() and chat_google_vertex() now use gemini-3.7-flash.
  • chat_huggingface() now uses Qwen/Qwen3-235B-A22B-Instruct-2507.
  • chat_openai() now uses gpt-5.6-terra.
  • chat_openrouter() now uses gpt-5.6-terra.
  • chat_posit() now uses claude-sonnet-5.
  • chat_snowflake() now uses claude-sonnet-5.
  • chat_anthropic() and chat_aws_bedrock() now handle empty responses from the model (@thisisnic, #1070).
  • chat_anthropic() now defaults base_url to the ANTHROPIC_BASE_URL environment variable, and chat_aws_bedrock() to AWS_ENDPOINT_URL_BEDROCK_RUNTIME or AWS_ENDPOINT_URL_BEDROCK_MANTLE depending on api, matching the official SDKs (@karawoo, #1103).
  • chat_anthropic() now handles the fallback content block returned when a model's server-side refusal fallback (server-side-fallback-2026-06-01) is triggered (@simonpcouch, #1057).
  • chat_aws_bedrock() now handles thinking blocks with no text (@thisisnic, #1085).
  • chat_aws_bedrock() now supports bearer token authentication for enterprise API gateways (@thisisnic, #1002).
  • chat_databricks() now supports models that return content as an array of typed objects (e.g. databricks-gpt-oss-120b), capturing reasoning parts as thinking content (@thisisnic, #1078).
  • chat_databricks() now works with tools that have no arguments (@thisisnic, #1084).
  • Chat gains a conversation_id active binding. When set, it is recorded on the OpenTelemetry spans emitted for each model call so that tracing backends can group spans belonging to the same conversation (@cpsievert, #1106).
  • chat_google_gemini() now supports mixing regular tools with built-in tools like google_tool_web_search() (@thisisnic, #1054).
  • chat_openrouter() now preserves provider error messages (@xmarquez, #1059).
  • params(top_k = ) is now sent as top_k rather than top_logprobs for OpenAI-based providers (@thisisnic, #1113).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 7.7 min · r-devel-linux-x86_64-debian-clang
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-19
  • ERROR10 OK, 3 ERROR2026-07-07
  • OK13 OK2026-06-11
Show 6 earlier changesHide 6 earlier changes
  • ERROR12 OK, 1 ERROR2026-06-09
  • OK13 OK2026-06-08
  • ERROR12 OK, 1 ERROR2026-06-07
  • OK13 OK2026-06-01
  • ERROR12 OK, 1 ERROR2026-05-29
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.5.0
READMEYes · 956 wordsVignettesYes · 6 · dynamicNEWSYes · 100% structured · mentions 0.5.0Citation fileNoWebsiteYes · pkgdown
Help pages
61 (3 internal)includes a package overview page
Examples that run
44%22 run in a plain check (3 of them under a condition) · 28 never run
Exported functions with examples
83%
Documented parameters
93%
Return-value docs
78%
Help pages citing references
0%

Downloads

153.8K
CRAN downloads in the past year
Rank #1,047 · ~421/day · ~12.8K/mo
Daily download trend is not available in this view yet.
12.7K30 days
36.7K90 days
153.8K1 year
Compare downloads with other packages →
Also on2.5K r2u4 autocran2.5K conda_forge

Repository

620Stars
144Forks
52Open issues
25Open PRs
11Releases
747Commits
62Commit identities
747 commits · Last activity 2026-10-21 · +1.3% stars, 30d · Default branch at 0.5.0.9000, ahead of CRAN 0.5.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
90%
Median days to close, 50 most recently updated closed issues
24
Median days to close, 50 most recently updated closed PRs
13

Stars over time

2025-10-21 · 5352026-10-21 · 620
PracticesBeta

15 development-tooling and community-health practices detected across 7 families in the upstream repository

Checks run against github.com/tidyverse/ellmer 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

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-18 · The repository has a site deploy workflow

pkgdown site last built 2026-10-15

Coverage (1)
Coverage reporting (Codecov)
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 3 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (4)
Lint workflowAirVS CodeRStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-07-19
    Seen in the repository: .claude, .claude/skills
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 5 crediting it in the message
From outside contributors
  • Claude Code
    Pull requests: 6 from outside contributors, first on 2026-02-14, 6 from forks
Models named in its commits
  • Claude Opus 4.62 commits · May to Jun 2026
  • Claude Fable 5.11 commit · Oct 2026
  • Claude Opus 4.71 commit · Jun 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
30 external dependencies (excludes base and recommended)

Installing ellmer adds 25 packages (16 with compiled code, 13 MB of source tarballs). Heaviest: promises 3.1 MB, Rcpp 1.8 MB, openssl 1.1 MB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none

People & History

People (6)
Author, Maintainer since 0.1.0 (2025)
Author · added in 0.2.0
Author
Author · added in 0.1.1
Author · added in 0.3.0
Copyright holder, Funder
Releases (11)

Pick two releases to compare their code metrics.

  • 0.5.0Latest
    record
    2026-09-04 · current release · diff ↗ ·
    added 19 exports
    Chat, ContentCitation, ContentDocument, ContentToolRequestFetch, ContentToolRequestSearch, ContentToolResponseFetch, ContentToolResponseSearch, ContentUploaded, Model, Round, Source, ToolDef, WebSource, content_document_file, content_document_url, local_tool_context, models_update_prices, tool_context, with_tool_context
  • 0.4.2
    record
    2026-07-13 · diff ↗ ·
    added 4 exports
    chat_posit, models_deepseek, models_groq, models_posit
  • 0.4.1
    record
    2026-05-07 · diff ↗ ·
    added 4 exports
    AssistantPartialTurn, chat_lmstudio, models_lmstudio, stream_controller
  • R
    R 4.6.0 released · 2026-04-24
  • 0.4.0
    record
    2025-11-15 · diff ↗ ·
    removed 4 exports
    chat_azure, chat_bedrock, chat_cortex, chat_gemini
    added 19 exports
    AssistantTurn, SystemTurn, TypeIgnore, UserTurn, chat_openai_compatible, claude_file_delete, claude_file_download, claude_file_get, claude_file_list, claude_file_upload, claude_tool_web_fetch, claude_tool_web_search, df_schema, google_tool_web_fetch, google_tool_web_search, models_claude, models_mistral, openai_tool_web_search, type_ignore
  • 0.3.2
    record
    2025-09-04 · diff ↗
  • 0.3.1
    record
    2025-08-24 · diff ↗
  • 0.3.0
    record
    2025-07-25 · diff ↗ ·
    removed 1 export
    chat_cortex_analyst
    added 6 exports
    batch_chat_text, chat, contents_record, contents_replay, models_github, parallel_chat_text
  • 0.2.1
    record
    2025-06-03 · diff ↗ ·
    added 2 exports
    TypeJsonSchema, type_from_schema
  • 0.2.0
    record
    2025-05-18 · diff ↗ ·
    added 28 exports
    ContentThinking, batch_chat, batch_chat_completed, batch_chat_structured, chat_anthropic, chat_aws_bedrock, chat_azure_openai, chat_cloudflare, chat_google_gemini, chat_google_vertex, chat_huggingface, chat_mistral, chat_portkey, google_upload, interpolate_package, models_anthropic, models_aws_bedrock, models_google_gemini, models_google_vertex, models_ollama, models_openai, models_portkey, models_vllm, parallel_chat, parallel_chat_structured, params, tool_annotations, tool_reject
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.1
    record
    2025-02-07 · diff ↗ ·
    added 7 exports
    ContentPDF, chat_cortex_analyst, chat_deepseek, chat_openrouter, chat_snowflake, content_pdf_file, content_pdf_url
  • 0.1.0
    record
    2025-01-09
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2025-01-09
Total releases
11 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1
Download size
3.0 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("ellmer")
Wickham, H., Posit Software, PBC, Aden-Buie, G., Cheng, J., Jacobs, A., & Schloerke, B. (2026). ellmer: Chat with Large Language Models (Version 0.5.0) [Computer software]. https://doi.org/10.32614/CRAN.package.ellmer

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

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 ellmer version 0.5.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, 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