AI Integration
Carolina Cloud containers ship with Claude Code pre-installed, and notebook flavors include additional in-app AI surfaces (Marimo’s AI panels, RStudio’s gander). To activate them, pass an Anthropic API key when you create the instance. The key flows into the container as an environment variable, the AI tools auto-configure on first start, and the key is never stored by Carolina Cloud — you provide it again for each new instance.
Bring your own Anthropic API key
Section titled “Bring your own Anthropic API key”When creating an instance, pass an anthropic_api_key. If provided, it is used to:
- Pre-authenticate the Claude Code CLI (
claudecommand) for thecclouduser - Configure Marimo’s AI autocomplete, edit, and chat panels (Marimo flavors)
- Wire up gander, ellmer, and shinychat for in-IDE AI (RStudio flavors)
Supported flavors: base, genomics, datascience, marimo, datasciencemarimo, rstudioserver, rgeospatial
Via the API:
curl -X POST https://console.carolinacloud.io/api/instance/ \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "resource_type": "container", "flavor": "marimo", "n_vcpus": 4, "mem_gib": 16, "disk_size_gib": 100, "anthropic_api_key": "sk-ant-..." }'Via the dashboard:
In the creation modal, paste your key into the Anthropic API Key field. The field is shown for every AI-wired flavor and is always optional — leave it blank to skip AI setup.
What gets wired up
Section titled “What gets wired up”The integration depends on the flavor:
| Flavor | Claude Code CLI | Notebook AI | IDE AI |
|---|---|---|---|
base | ✓ | — | — |
genomics | ✓ | — | — |
datascience | ✓ | — | — |
marimo | ✓ | Marimo autocomplete / edit / chat | — |
datasciencemarimo | ✓ | Marimo autocomplete / edit / chat | — |
rstudioserver | ✓ | — | gander, ellmer, shinychat |
rgeospatial | ✓ | — | gander, ellmer, shinychat |
Default model
Section titled “Default model”Every AI surface we configure is pinned to Claude Sonnet 4.6 (claude-sonnet-4-6):
- Marimo flavors:
~/.marimo.tomlsetsautocomplete_model,edit_model, andchat_modelall toanthropic/claude-sonnet-4-6. - RStudio flavors:
~/.Rprofilesetsoptions(gander.chat = ellmer::chat_claude(model = "claude-sonnet-4-6")). - Claude Code CLI: the
claudebinary uses Claude Code’s own default model (currently Sonnet 4.6 as well). We do not pin it — you can switch at any time with the in-app model selector.
Changing the default model
Section titled “Changing the default model”You can swap to a different Claude model from inside the container.
Claude Code (any flavor): run claude and use the in-app model selector, or pass the model as a flag:
claude --model claude-opus-4-7Marimo flavors (marimo, datasciencemarimo): edit ~/.marimo.toml and change the [ai.models] block:
[ai.models]autocomplete_model = "anthropic/claude-opus-4-7"edit_model = "anthropic/claude-opus-4-7"chat_model = "anthropic/claude-opus-4-7"Save the file and restart the Marimo server (the auto-restart loop picks up the new config within a few seconds, or restart the container to force it immediately).
RStudio flavors (rstudioserver, rgeospatial): the gander addin’s default model lives in ~/.Rprofile:
options(gander.chat = ellmer::chat_claude(model = "claude-sonnet-4-6"))Edit that line to use the model you want, then restart the R session (Session → Restart R, or Ctrl+Shift+F10) so the new option takes effect. For ellmer in your own R code, pass the model directly:
chat <- ellmer::chat_claude(model = "claude-opus-4-7")chat$chat("Summarize this dataset")Without a key
Section titled “Without a key”Skipping the field is fully supported. The Claude Code CLI is still installed on every AI-wired flavor — it’s baked in at build time, not at startup — so the claude command is on PATH and ready to run. The only difference is that no AI configuration is pre-applied, so:
- Claude Code: the first run of
claudewill prompt you to authenticate. - Marimo flavors: the AI panels stay disabled. To enable them later, set
ANTHROPIC_API_KEYin your shell and write a~/.marimo.toml(see the format above), then restart the Marimo server. - RStudio flavors: the
ellmer,gander, andshinychatpackages are installed but the gander addin is not wired to a default chat. SetANTHROPIC_API_KEYin~/.Renviron, then add theoptions(gander.chat = ...)line to~/.Rprofileto activate gander’s Ctrl+Shift+I addin.
Security and persistence
Section titled “Security and persistence”- The key is never stored on Carolina Cloud servers. It is forwarded once to the host running your container, written into that container’s environment, and not retained anywhere else.
- Inside the container, the key lives in
~/.bashrc(asANTHROPIC_API_KEY), in~/.claude.json(Claude Code’s auth file — only the last 20 characters), in~/.Renvironon RStudio flavors, and in~/.marimo.tomlon Marimo flavors. - Stopping and restarting a container preserves the key (the writable layer survives). Recreating the container wipes it, and you’ll need to provide it again at creation time.
- To rotate keys without recreating, edit
~/.bashrcand the relevant config files inside the container.