R package for LLM API access
Top 62.2% on sourcepulse
ellmer
provides an R interface for interacting with various Large Language Model (LLM) APIs, enabling R users to leverage advanced AI capabilities directly within their statistical computing environment. It supports a wide array of providers, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, and local Ollama deployments, offering features like streaming outputs, tool/function calling, and structured data extraction.
How It Works
ellmer
utilizes an R6 object-oriented approach to manage LLM interactions. Each supported provider has a dedicated chat_*()
function that initializes a stateful chat object. These objects maintain conversation history, allowing for contextual interactions. Users can interact via a live console, direct method calls that stream responses, or programmatically within functions, with options to control response streaming and return types.
Quick Start & Requirements
install.packages("ellmer")
vignette("ellmer")
, vignette("prompt-design")
, vignette("tool-calling")
, vignette("structured-data")
, vignette("streaming-async")
.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
1 day ago
1 day