This tutorial walks you through installing Grob, configuring it with a preset, and using it with Claude Code. By the end, you will have a working LLM routing proxy with automatic provider fallback.
- A Unix-like system (macOS or Linux) or Windows
- At least one LLM provider account (Anthropic, OpenAI, OpenRouter, or a local Ollama install)
- Rust toolchain (if building from source) or
curl(for the install script)
Choose one of three methods:
Option A: Install script (recommended)
curl -fsSL https://raw.githubusercontent.com/azerozero/grob/main/scripts/install.sh | shOption B: Homebrew (macOS / Linux)
brew install azerozero/tap/grobOption C: Build from source
cargo install --git https://github.com/azerozero/grobVerify the installation:
grob --helpYou should see a list of available commands.
Grob reads API keys from environment variables. Set the ones for the providers you plan to use:
# Anthropic (required for most presets)
export ANTHROPIC_API_KEY="sk-ant-..."
# OpenRouter (optional, for fallback providers)
export OPENROUTER_API_KEY="sk-or-..."If you have an Anthropic Pro or Max subscription and want to use OAuth instead of an API key, skip this step -- you will authenticate via browser in Step 4.
Presets are pre-built configurations that set up providers, models, and routing in one command. Pick the one that matches your setup:
| Preset | Primary provider | Fallback | Monthly cost estimate |
|---|---|---|---|
perf |
Anthropic (Opus + Sonnet) | Anthropic | Subscription only |
medium |
Anthropic OAuth | OpenRouter | Subscription + ~$10-100 |
cheap |
DeepSeek R1 (OpenRouter) | GLM-5 (z.ai) | ~$0.15/M tokens |
local |
Anthropic OAuth | Ollama (local) | Subscription + free |
Apply the medium preset:
grob preset apply mediumThis creates ~/.grob/config.toml with Anthropic OAuth as the primary for thinking tasks and OpenRouter models for everything else.
To see what a preset contains before applying:
grob preset info mediumThe simplest way is grob exec, which starts the proxy, sets the right environment variables, launches your tool, and stops the proxy when your tool exits:
grob exec -- claudeThis is equivalent to:
grob start -d
ANTHROPIC_BASE_URL=http://[::1]:13456 claude
grob stop(The default bind address is ::1, IPv6 localhost. Use http://127.0.0.1:13456 if your system does not support IPv6.)
If you applied an OAuth preset, a browser window will open on first start for authentication. Complete the login flow and return to the terminal.
In another terminal, check Grob's status:
grob statusYou should see output like:
Grob is running (PID 12345)
Port: 13456
Preset: medium
Spend: $0.00 / $0.00 (no limit)
Run a diagnostic check:
grob doctorThis verifies your config file, environment variables, and provider connectivity.
After some usage, check what it cost:
grob spendThis shows a breakdown by provider and model for the current month.
When you ran grob exec -- claude:
- Grob loaded
~/.grob/config.toml - It started an HTTP server on
[::1]:13456(IPv6 localhost) - It set
ANTHROPIC_BASE_URL=http://[::1]:13456so Claude Code sends requests to Grob - For each request, Grob classified the task type (thinking, default, web search, background)
- It selected the best model for that task type and tried providers in priority order
- If a provider failed, it automatically tried the next one in the fallback chain
- Responses were streamed back to Claude Code with DLP scanning and spend tracking
- Customize your config: Edit
~/.grob/config.tomldirectly -- see Configuration Reference - Add more providers: See Provider Setup for all 13+ supported backends
- Set a budget: Add
[budget] monthly_limit_usd = 50.0to your config -- see How to Configure - Understand the architecture: Read the Architecture Overview
- Fix problems: Check Troubleshooting