ellmer  by tidyverse

R package for LLM API access

Created 1 year ago
527 stars

Top 60.0% 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

6 days ago

Responsiveness

1 day

Pull Requests (30d)
23
Issues (30d)
25
Star History
14 stars in the last 30 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Anton Troynikov Anton Troynikov(Cofounder of Chroma), and
44 more.

llama_index by run-llama

0.3%
44k
Data framework for building LLM-powered agents
Created 2 years ago
Updated 19 hours ago
Feedback? Help us improve.