tidyverse/ellmer

Call LLM APIs from R

What it solves

ellmer simplifies the integration of large language models (LLMs) into the R programming language, providing a unified interface to interact with a wide variety of AI providers.

How it works

It uses stateful R6 objects to maintain conversation context, allowing users to create chat objects tailored to specific providers (e.g., OpenAI, Anthropic, Google Gemini). Users can interact with these models either through a programmatic method call ($chat()) or an interactive chat console (live_console()). The package supports streaming outputs to the console, multimodal inputs (images via URLs or files), and advanced features like tool/function calling and structured data extraction.

Who it’s for

Data scientists, statisticians, and R users who want to leverage LLMs for data analysis, code generation, or application development without needing to switch to Python.

Highlights

  • Broad Provider Support: Includes official integrations for major cloud providers (Azure, AWS, Google, Snowflake) and community-supported providers (Groq, Mistral, Hugging Face, Ollama).
  • Local Model Execution: Supports Ollama for running models locally to ensure data privacy and zero cost.
  • Flexible Interaction: Offers both a live interactive console and programmatic API calls for integration into functions and packages.
  • Multimodal Capabilities: Ability to send images alongside text prompts for analysis.
  • Enterprise Ready: Automatically detects OAuth or IAM-based credentials for major cloud platforms.

Related

  • Project
  • Project
  • Project
  • Project
  • Project