Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.8%) to scientific vocabulary
Keywords from Contributors
Repository
Basic Info
- Host: GitHub
- Owner: mlverse
- License: other
- Language: R
- Default Branch: main
- Homepage: https://mlverse.github.io/chattr/
- Size: 12.4 MB
Statistics
- Stars: 234
- Watchers: 6
- Forks: 25
- Open Issues: 24
- Releases: 3
Metadata Files
README.md
chattr
Intro
chattr is an interface to LLMs (Large Language Models). It enables
interaction with the model directly from RStudio and Positron. chattr
allows you to submit a prompt to the LLM from your script, or by using
the provided Shiny Gadget.
This package’s main goal is to aid in exploratory data analysis (EDA) tasks. The additional information appended to your request, provides a sort of “guard rails”, so that the packages and techniques we usually recommend as best practice, are used in the model’s responses.
Install
To install the CRAN version of this package use:
r
install.packages("chattr")
If you wish to use the development version use:
r
pak::pak("mlverse/chattr")
Using
Starting with version 0.3, chattr integrates with LLM’s via the
ellmer package. ellmer has a
growing list of LLM integrations, including
OpenAI,
Gemini,
Deepseek
and others.
There are several ways to let chattr know which LLM to use:
Pre-set an R option - Pass the
ellmerconnection command you wish to use in the.chattr_chatoption, for example:options(.chattr_chat = ellmer::chat_anthropic()). If you add that code to your .Rprofile,chattrwill use that as the default model and settings to use every time you start an R session. Use theusethis::edit_r_profile()command to easily edit your .RprofileUse an
ellmerobject - You can pass anellmerchat object directly tochattr_use():r my_chat <- ellmer::chat_anthropic() chattr_use(my_chat)Named model - You pass one of several pre-defined provider/model setups. These setups are represented by labels set by
chattr. At this time, the combinations cover 3 providers: OpenAI, Databricks, and Ollama. To use, simply pass the label tochattr_use. To see a full list of the available pre-defined combinations and their argument values see Available models. For example, if you wish to use OpenAI’s GPT 4.1 Nano model, you simply pass the corresponding label:r chattr_use("gpt41-nano")Select one from a menu (legacy) - If nothing is passed to
chattr_use(), and no option is set,chattrwill try to create theellmerchat for you. It will try to figure if you have authentication tokens for OpenAI, Databricks, and checks if Ollama is running on your machine.chattrthen returns a menu based on the providers it was able to find:``` r chattr_use()
── chattr - Available models Select the number of the model you would like to use:
1: Databricks - databricks-dbrx-instruct (databricks-dbrx) 2: Databricks - databricks-meta-llama-3-3-70b-instruct (databricks-meta-llama31-70b) 3: Databricks - databricks-mixtral-8x7b-instruct (databricks-mixtral8x7b) 4: OpenAI - Chat Completions - gpt-4.1-mini (gpt41-mini) 5: OpenAI - Chat Completions - gpt-4.1-nano (gpt41-nano) 6: OpenAI - Chat Completions - gpt-4.1 (gpt41) 7: OpenAI - Chat Completions - gpt-4o (gpt4o) 8: Ollama - llama3.2 (ollama)
Selection: ```
Available models
For convenience, chattr contains some provider/model combinations that
you can use by passing what is under Use value to chattr_use():
| Model & Provider | Use value |
|---|---|
| DBRX (Databricks) | databricks-dbrx |
| Meta Llama 3.3 70B (Databricks) | databricks-meta-llama31-70b |
| Mixtral 8x7b (Datbricks) | databricks-mixtral8x7b |
| GPT 4.1 Mini (OpenAI) | gpt41-mini |
| GPT 4.1 Nano (OpenAI) | gpt41-nano |
| GPT 4.1 (OpenAI) | gpt41 |
| GPT 4 Omni (OpenAI) | gpt4o |
| Llama 3.2 (Ollama) | ollama |
If the provider and/or model you wish to use is not listed in the table
above, you can create an ellmer chat connection directly. And then
pass that chat object to chattr_use(). Here is a list of the providers
that are currently available in that package:
- Anthropic’s Claude:
ellmer::chat_anthropic() - AWS Bedrock:
ellmer::chat_aws_bedrock() - Azure OpenAI:
ellmer::chat_azure_openai() - Cloudflare:
ellmer::chat_cloudflare() - Databricks:
ellmer::chat_databricks() - DeepSeek:
ellmer::chat_deepseek() - GitHub model marketplace:
ellmer::chat_github() - Google Gemini/Vertex AI:
ellmer::chat_google_gemini() - Groq:
ellmer::chat_google_vertex() - Hugging Face:
ellmer::chat_groq() - Mistral:
ellmer::chat_huggingface() - Ollama:
ellmer::chat_mistral() - OpenAI:
ellmer::chat_ollama() - OpenRouter:
ellmer::chat_openai() - perplexity.ai:
ellmer::chat_openrouter() - Snowflake Cortex:
ellmer::chat_perplexity() - VLLM:
ellmer::chat_snowflake()<!-- providers: end -->
The App
The main way to use chattr is through the Shiny Gadget app. By
default, in RStudio the app will run inside the Viewer pane.
r
chattr_use("ollama")
chattr_app()
After the LLM finishes its response, the chattr app processes all
markdown code chunks. It will place three convenience buttons:
Copy to clipboard - It will write the code inside the chunk to your clipboard.
Copy to document - It will copy-paste the code directly to where the app was called from. If the app is started while working on a script,
chattrwill copy the code to that same script.Copy to new script - It creates a new R script in the RStudio IDE, and copies the content of the chunk directly to it. Very useful when the LLM writes a Shiny app for you
A lot of effort was put in to make the app’s appearance as close as possible to the IDE. This way it feels more integrated with your work space. This includes switching the color scheme based on the current RStudio theme being light, or dark.
The settings screen can be accessed by clicking on the “gear” button. The screen that opens will contain the following:
Save and Open chats - This is an early experiment to allow us to save and retrieve past chats.
chattrwill save the file in an RDS format. The main objective of this feature, is to be able to see past chats, not to continue previous conversations with the LLM.Prompt settings - In this section you can change the additional information attached to your prompt. Including the number of max data files, and data frames sent to the LLM.
Additional ways to interact
Apart from the Shiny app, chattr provides two more ways to interact
with the LLM. For details, see: Other
interfaces
How it works
chattr enriches your request with additional instructions, name and
structure of data frames currently in your environment, the path for the
data files in your working directory. If supported by the model,
chattr will include the current chat history.
To see what chattr will send to the model, set the preview argument
to TRUE:
``` r library(chattr)
data(mtcars) data(iris)
chattr_use("gpt4o")
>
> ── chattr
> • Provider: OpenAI - Chat Completions
> • Model: gpt-4o
> • Label: GPT 4 Omni (OpenAI)
chattr(preview = TRUE)
>
> ── chattr ──────────────────────────────────────────────────────────────────────
>
> ── Preview for: Console
> • Provider: OpenAI - Chat Completions
> • Model: gpt-4o
> • Label: GPT 4 Omni (OpenAI)
> • temperature: 0.01
> • max_tokens: 1000
> • stream: TRUE
>
> ── Prompt:
```
Keyboard Shortcut
The best way to access chattr’s app is by setting up a keyboard
shortcut for it. This package includes an RStudio Addin that gives us
direct access to the app, which in turn, allows a keyboard shortcut
to be assigned to the addin. The name of the addin is: “Open Chat”. If
you are not familiar with how to assign a keyboard shortcut see the next
section.
How to setup the keyboard shortcut
Select Tools in the top menu, and then select Modify Keyboard Shortcuts
Search for the
chattradding by writing “open chat”, in the search box
To select a key combination for your shortcut, click on the Shortcut box and then type press the key combination in your keyboard. In my case, I chose Ctrl+Shift+C
Owner
- Name: mlverse
- Login: mlverse
- Kind: organization
- Repositories: 27
- Profile: https://github.com/mlverse
Open source libraries to scale Data Science
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 23
- Watch event: 42
- Issue comment event: 38
- Push event: 63
- Pull request event: 9
- Fork event: 5
Last Year
- Create event: 1
- Release event: 1
- Issues event: 23
- Watch event: 42
- Issue comment event: 38
- Push event: 63
- Pull request event: 9
- Fork event: 5
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Edgar Ruiz | e****z@g****m | 518 |
| Romain Francois | r****n@p****t | 11 |
| Zac Davies | z****c@d****m | 6 |
| Yanhua Zheng | 3****r | 3 |
| pawelqs | k****0@g****m | 2 |
| Julien Cornebise | j****n@c****m | 2 |
| Hadley Wickham | h****m@g****m | 1 |
| Gustavo Velásquez | g****b@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 69
- Total pull requests: 76
- Average time to close issues: 4 months
- Average time to close pull requests: about 21 hours
- Total issue authors: 61
- Total pull request authors: 9
- Average comments per issue: 2.7
- Average comments per pull request: 0.21
- Merged pull requests: 71
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 15
- Pull requests: 13
- Average time to close issues: 2 months
- Average time to close pull requests: about 1 hour
- Issue authors: 15
- Pull request authors: 5
- Average comments per issue: 2.2
- Average comments per pull request: 0.08
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- edgararuiz (4)
- jthomasmock (3)
- michaelgrund (2)
- jameson-c (2)
- JavOrraca (1)
- BatoolMM (1)
- glemley (1)
- YBIAN-BCS (1)
- mrudulmohan007 (1)
- joaomaroco (1)
- apsteinmetz (1)
- romainfrancois (1)
- scschwa (1)
- youngwoos (1)
- maxlvhao (1)
Pull Request Authors
- edgararuiz (75)
- romainfrancois (6)
- zacdav-db (4)
- rainoffallingstar (3)
- pawelqs (2)
- jucor (1)
- hadley (1)
- JimmyJHickey (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 1,833 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: chattr
Interact with Large Language Models in 'RStudio'
- Homepage: https://github.com/mlverse/chattr
- Documentation: http://cran.r-project.org/web/packages/chattr/chattr.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.1
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- R >= 2.10 depends
- bslib * imports
- callr * imports
- cli * imports
- clipr * imports
- config * imports
- fs * imports
- glue * imports
- httr2 * imports
- jsonlite * imports
- lifecycle * imports
- purrr * imports
- rlang * imports
- rstudioapi * imports
- shiny * imports
- yaml * imports
- covr * suggests
- testthat >= 3.0.0 suggests
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite