Introduction to gpttools
The gpttools
project is designed as an extension for R package developers, enabling them to easily integrate the use of large language models (LLMs) into their project workflows. These models represent significant advancements in how we use textual data for a wide range of knowledge-related tasks. However, when employing these models, it's important to consider ethical issues, as the ethics surrounding LLMs is an actively discussed topic.
Installation
The gpttools
package can be installed in a couple of ways:
Install from GitHub
You can install gpttools
from GitHub using the {pak}
package manager. Here's how:
# First install the pak package if you haven't already
install.packages("pak")
# Then use pak to install gpttools
pak::pak("JamesHWade/gpttools")
Install from R-Universe
Alternatively, gpttools
can be downloaded and installed from R-Universe:
# Enable the repository for jameshwade
options(repos = c(
jameshwade = "https://jameshwade.r-universe.dev",
CRAN = "https://cloud.r-project.org"
))
# Install the gpttools package
install.packages("gpttools")
# Access the gpttools manual pages
help(package = "gpttools")
Available AI Services and Models
gpttools
supports various AI services and models, offering flexibility in configuration and usage. Here are some of the prominent services and their models:
- OpenAI: Models such as gpt-4-turbo, gpt-4, and gpt-3.5-turbo.
- HuggingFace: A wide array of models from their platform.
- Anthropic: Models like claude-2.1 and claude-instant-1.2.
- Ollama: Includes models like mistral, llama2, and others.
- Perplexity: Offers models such as pplx-7b-chat and various others.
- Google AI Studio: Utilizes models like Gemini.
- Azure OpenAI: Supports models like gpt-4.
Default AI Service: OpenAI
The package defaults to using OpenAI services, and to get started, it’s necessary to:
- Create an OpenAI account.
- Generate an OpenAI API key.
- Configure this API key in RStudio.
To set up the API key, make sure to store it in your .Renviron file, ensuring it remains secure and persistent across R sessions. This setup is crucial for enabling interaction with OpenAI services.
Privacy Notice
Using gpttools
involves interaction with external AI service providers, which means data sharing. The data you select to send to these services—such as text or code—is subject to the privacy policies of the respective providers. It is vital to read and understand these terms, as well as to avoid sharing sensitive data unintentionally.
Code of Conduct
The gpttools
project has a Contributor Code of Conduct. By contributing, users agree to adhere to these standards, promoting a positive and productive community environment.
In summary, gpttools
aims to streamline the integration of AI models into R projects, providing a versatile toolkit for developers while emphasizing the importance of ethical and secure data usage practices.