Skip to content

Provider Setup

Providers connect your agents to large language models. Each provider plugin handles API authentication, streaming, tool calling format differences, and thinking/reasoning support so your agent config stays clean.

RivetOS ships with six provider plugins:

ProviderModelsThinking SupportNotes
AnthropicClaude Opus, Sonnet, HaikuAdaptive thinking, prompt caching
xAIGrok 3, Grok 4Responses API, conversation caching, live search
GoogleGemini 2.5 Pro, FlashThought signatures for function calling
OllamaAny local modelLocal inference, no API key needed
OpenAI-compatvLLM / TGI / llama.cpp llama-server / Groq / Together / Fireworks / LocalAI✅ (when --reasoning-parser set)Folds mid-conversation system messages, consumes native reasoning_content
Claude CLIAnything claude supportsDrives the local claude binary using your subscription OAuth — no API key

  1. Go to the Anthropic Console
  2. Sign up or log in
  3. Go to API KeysCreate Key
  4. Copy the key (starts with sk-ant-)

Prefer subscription/OAuth auth over an API key? Use the claude-cli provider instead — it drives the local claude binary (Claude Code CLI), which owns the OAuth flow. Run claude login once via the CLI itself; RivetOS does not handle the OAuth handshake. See the claude-cli provider in the Configuration Reference.

Add your key to .env:

Terminal window
ANTHROPIC_API_KEY=sk-ant-...your-key-here

Add to config.yaml:

providers:
anthropic:
model: claude-opus-4-7
max_tokens: 8192
agents:
myagent:
provider: anthropic
default_thinking: medium
KeyTypeDefaultDescription
modelstringclaude-opus-4-7Model identifier
max_tokensnumber8192Maximum output tokens
api_keystring${ANTHROPIC_API_KEY}API key. Use env var
context_windownumberOverride the model’s context-window size (advanced)
max_output_tokensnumberHard cap on output tokens

For subscription/OAuth auth instead of an API key, use the claude-cli provider (it drives the local claude binary and owns the OAuth flow).

When default_thinking is set on the agent, the provider requests extended thinking with a token budget:

LevelBudgetBest For
offSimple questions, fast responses
low2,000 tokensLight reasoning
medium10,000 tokensCode review, planning
high50,000 tokensComplex architecture, deep analysis
ModelSpeedIntelligenceContext
claude-opus-4-7SlowHighest200K
claude-sonnet-4-6FastHigh200K
claude-haiku-4-5-20251001FastestGood200K

Docs: Anthropic API Reference


  1. Go to console.x.ai
  2. Sign up or log in
  3. Create an API key
  4. Copy the key (starts with xai-)

Add your key to .env:

Terminal window
XAI_API_KEY=xai-...your-key-here

Add to config.yaml:

providers:
xai:
model: grok-4-1-fast-reasoning
agents:
grok:
provider: xai
KeyTypeDefaultDescription
modelstringgrok-4.20-reasoningModel identifier
api_keystring${XAI_API_KEY}API key
base_urlstringhttps://api.x.ai/v1API endpoint
temperaturenumberSampling temperature (not used with reasoning models)
storebooleantrueServer-side conversation storage. When enabled, only new messages are sent each turn
timeout_msnumber3600000Request timeout in milliseconds (default: 1 hour for reasoning)

When store: true (default), xAI stores the conversation server-side. Each turn only sends new messages, reducing token usage and latency. The provider manages previous_response_id automatically.

ModelTypeNotes
grok-4.20-reasoningFlagship2M context, fast + agentic, $2.00/$6.00 per M tokens
grok-4-1-fast-reasoningFast10x cheaper ($0.20/$0.50), good for compaction and cheap throughput

Docs: xAI API Documentation


  1. Go to Google AI Studio
  2. Click Create API Key
  3. Select or create a Google Cloud project
  4. Copy the key

Add your key to .env:

Terminal window
GOOGLE_API_KEY=AIza...your-key-here

Add to config.yaml:

providers:
google:
model: gemini-2.5-pro
agents:
gemini:
provider: google
default_thinking: medium
KeyTypeDefaultDescription
modelstringgemini-2.5-proModel identifier
api_keystring${GOOGLE_API_KEY}API key
max_tokensnumber8192Maximum output tokens
base_urlstringhttps://generativelanguage.googleapis.com/v1betaAPI endpoint
LevelBudget
off0
low1,024 tokens
medium8,192 tokens
high32,768 tokens
ModelSpeedContextNotes
gemini-2.5-proMedium1MBest reasoning
gemini-2.5-flashFast1MGood balance of speed and quality

Docs: Gemini API Documentation


Ollama runs models locally on your machine. No API key needed, no usage costs — just hardware.

Terminal window
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# macOS
brew install ollama
# Or download from https://ollama.com/download
Terminal window
ollama pull qwen2.5:32b

Browse available models at ollama.com/library.

No .env needed — Ollama runs locally without authentication.

providers:
ollama:
model: qwen2.5:32b
base_url: http://localhost:11434
agents:
local:
provider: ollama
local: true # Extended context (tokens are free)
KeyTypeDefaultDescription
modelstringllama3.1Model name (must be pulled via ollama pull)
base_urlstringhttp://localhost:11434Ollama API endpoint
temperaturenumber0.7Sampling temperature
top_pnumber0.9Nucleus sampling threshold
num_ctxnumbermodel defaultContext window size in tokens
keep_alivestring30mHow long to keep model loaded in memory
  • Set local: true on the agent — this includes extended workspace context (CAPABILITIES.md, daily notes) since tokens are free with local inference.
  • num_ctx is critical for tool-using agents. Most models default to 2048-4096 tokens, which isn’t enough. Set 8192 or higher.
  • keep_alive controls how long the model stays in VRAM after the last request. Set to 0 to unload immediately, or 24h to keep it warm.
  • Remote Ollama: If Ollama runs on a different machine, change base_url to point at it (e.g., http://192.0.2.50:11434).

Docs: Ollama API Documentation


Dedicated provider for a vLLM server. Exposes the full vLLM surface: sampling extensions (top_k, min_p, repetition_penalty, min_tokens), mm_processor_kwargs / chat_template_kwargs, the extra_body escape hatch, video_url content blocks, and reasoning_content parsing.

Start a server: vllm serve <model> --port 8000 [--reasoning-parser ...] [--enable-auto-tool-choice].

providers:
vllm:
base_url: http://localhost:8000 # trailing /v1 optional
model: default # 'default' auto-discovers from /v1/models
top_k: 40
min_p: 0.05
# api_key: ${VLLM_API_KEY} # only if you started vLLM with --api-key
agents:
local:
provider: vllm
local: true # extended context — tokens are free

Leave model: default and the provider auto-selects the served model (and adopts its context window) from /v1/models. For native <think> reasoning, start vLLM with a --reasoning-parser; the AI SDK reasoning surface consumes reasoning_content.

KeyTypeDefaultDescription
base_urlstringrequiredvLLM server URL (/v1 optional).
modelstringdefaultServed model id; default auto-discovers.
api_keystring${VLLM_API_KEY}Bearer token (only if vLLM was started with --api-key).
max_tokensnumber4096Maximum output tokens.
temperature / top_pnumber0.7 / 0.95Standard sampling.
top_k / min_pnumbervLLM sampling extensions.
presence_penalty / frequency_penalty / seed / stopStandard OpenAI knobs.
repetition_penalty / min_tokensnumbervLLM extensions.
mm_processor_kwargs / chat_template_kwargs / extra_bodyobjectvLLM passthroughs.
default_tool_choicestringautoauto, none, or required.
verify_model_on_initbooleanfalseProbe /v1/models at boot.
context_window / max_output_tokensnumberRuntime budgeting overrides.

Dedicated provider for llama.cpp’s llama-server. Deliberately lean: the standard OpenAI sampling knobs plus llama.cpp’s top_k / min_p and a generic extra_body escape hatch (grammar, n_probs, …). It carries none of the vLLM-only machinery — use the vllm provider for that.

Start a server: llama-server -m <model.gguf> --port 8080 [--reasoning-format deepseek].

providers:
llama-server:
base_url: http://localhost:8080
model: default
top_k: 40
min_p: 0.05
agents:
local:
provider: llama-server
local: true

For native <think> reasoning, start llama-server with --reasoning-format deepseek so it emits reasoning_content. Set LLAMA_SERVER_API_KEY only if you started the server with --api-key.

KeyTypeDefaultDescription
base_urlstringrequiredllama-server URL (/v1 optional).
modelstringdefaultServed model id; default auto-discovers.
api_keystring${LLAMA_SERVER_API_KEY}Bearer token (only if started with --api-key).
max_tokensnumber4096Maximum output tokens.
temperature / top_pnumber0.7 / 0.95Standard sampling.
top_k / min_pnumberllama.cpp sampling extensions.
presence_penalty / frequency_penalty / seed / stopStandard OpenAI knobs.
extra_bodyobjectEscape hatch (grammar, n_probs, …).
default_tool_choicestringautoauto, none, or required.
verify_model_on_initbooleanfalseProbe /v1/models at boot.
context_window / max_output_tokensnumberRuntime budgeting overrides.

Terminal window
# Run provider connectivity checks
npx rivetos doctor
# Smoke test — send a test message to each provider
npx rivetos test
# Check which providers are loaded
npx rivetos status