chattr_use {chattr} | R Documentation |
Sets the LLM model to use in your session
Description
Sets the LLM model to use in your session
Usage
chattr_use(x = NULL, ...)
Arguments
x |
A pre-determined provider/model name, an |
... |
Default values to modify. |
Details
The valid pre-determined provider/models values are: 'databricks-dbrx', 'databricks-meta-llama31-70b', 'databricks-mixtral8x7b', 'gpt41-mini', 'gpt41-nano', 'gpt41', 'gpt4o', and 'ollama'.
If you need a provider, or model, not available as a pre-determined value,
create an ellmer
chat object and pass that to chattr_use()
. The list of
valid models are found here: https://ellmer.tidyverse.org/index.html#providers
Set a default
You can setup an R option
to designate a default provider/model connection.
To do this, pass an ellmer
connection command you wish to use
in the .chattr_chat
option, for example: options(.chattr_chat = ellmer::chat_anthropic())
.
If you add that code to your .Rprofile, chattr
will use that as the default
model and settings to use every time you start an R session. Use the
usethis::edit_r_profile()
command to easily edit your .Rprofile.
Value
It returns console messages to allow the user select the model to use.
Examples
## Not run:
# Use a valid provider/model label
chattr_use("gpt41-mini")
# Pass an `ellmer` object
my_chat <- ellmer::chat_anthropic()
chattr_use(my_chat)
## End(Not run)