Get started
Install
The whole family installs from GitHub in one step with pak. This is the recommended path today — you get the latest version of every package, and you never have to track which capability lives in which package.
# install.packages("pak")
pak::pak(c(
"YuLab-SMU/aisdk", # core
"YuLab-SMU/aisdk.providers", # extra provider adapters
"YuLab-SMU/aisdk.slm", # local model inference
"YuLab-SMU/aisdk.orchestration", # multi-agent Flow / Team / Mission
"YuLab-SMU/aisdk.mcp", # Model Context Protocol
"YuLab-SMU/aisdk.skills", # skill ecosystem
"YuLab-SMU/aisdk.channels", # messaging integrations
"YuLab-SMU/aisdk.datatools", # charts & reports
"YuLab-SMU/aisdk.shiny" # Shiny web UI
))Just the core
pak::pak("YuLab-SMU/aisdk") # or, from CRAN: install.packages("aisdk")Only what you need
Each companion declares the core as a dependency, so installing any one of them pulls in aisdk automatically — no need to install the core first:
pak::pak("YuLab-SMU/aisdk.orchestration")The core aisdk is on CRAN. The companion packages are being submitted to CRAN one at a time, so install.packages() does not cover them all yet. Until they have all landed, install the family from GitHub as above — the commands stay the same regardless of how far the CRAN rollout has progressed.
Configure a provider
Most providers read their API key from an environment variable. For the core OpenAI/Anthropic/Gemini providers:
Sys.setenv(OPENAI_API_KEY = "sk-...")A first conversation
library(aisdk)
chat <- create_chat_session("openai:gpt-4o")
generate_text(chat, "Give me three ideas for a talk on R and LLMs.")Add providers without changing your code
Companion packages register themselves with the core registry on load, so the provider:model syntax just works once the package is installed:
library(aisdk.providers) # registers deepseek, kimi, xai, ... on load
generate_text(create_chat_session("deepseek:deepseek-chat"), "Hello!")If you ask for a provider that lives in a companion package you have not installed yet, the core will tell you exactly which package to install (and, in an interactive session, offer to install it for you).
Where to next
- Browse each package from the Packages menu above.
- Start with the aisdk core for the unified interface, agents, tools, and skills.