Skip to content

edujbarrios/llm7R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llm7R

Use powerful Large Language Models (LLMs) directly in your R workflows for data analysis, visualization, and exploratory research.

llm7R is a lightweight and extensible R wrapper for the LLM7.io API, designed to make it easy to work with text generation, dataframe analysis, and vision-based understanding of plots and images — all from within R.


Installation

Install it directly in R

# Install devtools if not already installed
install.packages("devtools")

# Install llm7R
devtools::install_github("edujbarrios/llm7R")

Cloning it

git clone https://github.com/edujbarrios/llm7R.git
cd llm7R
Rscript -e 'source("llm7.R")'

Quick Start

source("llm7.R")
client <- create_llm7_client()

Usage Examples

Text completion

client$simple_completion(
  "Explain gradient descent in simple terms"
)

Dataframe analysis

data(iris)

client$analyze_dataframe(
  iris,
  "What are the key differences between species?"
)

Plot / vision analysis

png("plot.png")
plot(iris$Sepal.Length, iris$Petal.Length)
dev.off()

client$analyze_plot(
  "plot.png",
  "Describe the relationship shown in this plot"
)

Recommended Environment

For the best experience while working with dataframes, plots, and long responses, it is recommended to use Jupyter Notebook with the R kernel (IRkernel). This setup provides improved output rendering and interactive workflows.


Authentication

By default, the client uses a limited-access API key:

api_key = "unused"

To unlock full functionality, generate an API token at:

https://token.llm7.io/

Then initialize the client with your token:

client <- create_llm7_client(
  api_key = "your-token"
)

Acknowledgements

Special thanks to Chigwell for creating and maintaining the LLM7.io API.


Author

Eduardo J. Barrios
https://edujbarrios.com

About

Use powerful Large Language Models (LLMs) directly in your R workflows for data analysis, visualization, and exploratory research.

Topics

Resources

License

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages