ellmer  by tidyverse

R package for LLM API access

created 11 months ago
508 stars

Top 62.2% on sourcepulse

GitHubView on GitHub
Project Summary

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 from CRAN: install.packages("ellmer")
  • Requires R.
  • API keys or cloud provider credentials may be needed for specific LLM services.
  • Vignettes for detailed learning: vignette("ellmer"), vignette("prompt-design"), vignette("tool-calling"), vignette("structured-data"), vignette("streaming-async").

Highlighted Details

  • Supports over 15 LLM providers, including major cloud platforms and local deployments.
  • Features robust support for multi-modal inputs (images) via URLs or local files.
  • Enables tool/function calling and structured data extraction for programmatic AI integration.
  • Offers flexible interaction modes: interactive console, streamed method calls, and programmatic returns.

Maintenance & Community

  • Developed by the tidyverse team, indicating strong backing and adherence to R best practices.
  • Active development and support are implied by the breadth of provider integrations.

Licensing & Compatibility

  • Licensed under the MIT license, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

  • Performance and capabilities are dependent on the chosen LLM provider and model.
  • Authentication mechanisms vary by provider, requiring careful credential management.
Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
47
Issues (30d)
52
Star History
80 stars in the last 90 days

Explore Similar Projects

Starred by Peter Norvig Peter Norvig(Author of Artificial Intelligence: A Modern Approach; Research Director at Google), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

aisuite by andrewyng

0.2%
12k
Unified interface for multiple generative AI providers
created 1 year ago
updated 3 days ago
Feedback? Help us improve.