# Set Up LLM Gateway

Routes LLM requests through the Caveman gateway to measure spend, behavior unchanged.

- Repository: https://github.com/JuliusBrussee/caveman (116680 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add JuliusBrussee/caveman --skill caveman-setup -g -a claude-code -y`
Codex: `npx skills add JuliusBrussee/caveman --skill caveman-setup -g -a codex -y`
Cursor: `npx skills add JuliusBrussee/caveman --skill caveman-setup -g -a cursor -y`
Gemini CLI: `npx skills add JuliusBrussee/caveman --skill caveman-setup -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add JuliusBrussee/caveman`

## Description

Wire a repository through the Caveman Cloud gateway so every LLM request is measured, with no behavior change. Use for "set up caveman" or adding LLM spend observability.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

You are wiring this repository through the Caveman gateway. Caveman is a
byte-preserving LLM proxy: in record mode it measures what your app sends and
what it costs, and changes nothing else. Your job is a minimal, verified
integration, not a refactor.

The prompt that sent you here provides four values. Refer to them as:

- `GATEWAY`, the gateway base URL (e.g. `https://gateway.caveman.so` or `http://127.0.0.1:8787`)
- `CAVE_API_KEY`, the gateway auth secret (treat like any API key: env var only, never committed, never printed in full)
- `PROVIDER_KEYS`, `stored` (provider keys live encrypted in Caveman Cloud) or `byok` (this app sends its own provider key per request)
- `DASHBOARD`, the dashboard base URL (e.g. `https://app.caveman.so`)

If any value is missing, stop and ask for it. Do not guess a URL or mint a key.

## Rules (non-negotiable)

1. **Coherent integration.** Wire every live LLM callsite through existing
   configuration and responsible seams. Touch each layer correctness requires.
   No drive-by refactors or formatting sweeps; add an abstraction only when it
   clarifies ownership or lowers lifecycle cost.
2. **Secrets stay in env vars.** `CAVE_API_KEY` goes into the env file the repo
   already uses (`.env`, `.env.local`, …). If that file isn't gitignored, add it
   to `.gitignore` and say so. Never hardcode the key in source.
3. **Report only what you observed.** The final report states the HTTP status
   and usage numbers from the real verification response, never assumed
   success. If verification fails, report the failure template instead.
4. **Record mode only.** You are adding measurement. You do not enable any
   optimization, and you do not claim any savings, verified savings are $0
   until an optimizer is explicitly turned on and passes its eval gate.
5. **Provider keys are not your business.** With `PROVIDER_KEYS: stored` you
   never see one. With `byok`, the app's existing provider key stays exactly
   where it already is.

The rest: https://github.com/JuliusBrussee/caveman/blob/HEAD/skills/caveman-setup/SKILL.md
