---
title: "Caveman switching"
description: "Move an optimization workflow to Caveman, or add it beside your current tools. Each guide covers setup, validation, and rollback."
canonical: https://caveman.so/switch
last-updated: 2026-09-16
---

# Caveman switching

Move an optimization workflow to Caveman, or add it beside your current tools. Each guide covers setup, validation, and rollback.

- [Add Caveman to AgentOps: compress a CrewAI crew](https://caveman.so/switch/agentops): Keep AgentOps recording your crew. Wrap one CrewAI agent with Caveman Middleware, compare two tagged AgentOps sessions, and roll back by removing one wrapper.
- [Add Caveman to Arize Phoenix: trace and grade compression](https://caveman.so/switch/arize-phoenix): Keep Arize Phoenix tracing your agent. Wrap it with Caveman Middleware, run one Phoenix experiment per mode, and check that quality held before you roll it out.
- [How to add Caveman to Bifrost: step by step setup](https://caveman.so/switch/bifrost): Keep Bifrost as your AI gateway and wrap one agent's client with Caveman Middleware to send fewer tool-result tokens. Setup, checks, and a one-line rollback.
- [Add Caveman to Braintrust: run it as an Eval](https://caveman.so/switch/braintrust): Add Caveman Middleware to a Vercel AI SDK agent logged to Braintrust, then run one Braintrust Eval in record and compress mode to check quality before shipping.
- [Add Caveman to Cloudflare AI Gateway](https://caveman.so/switch/cloudflare-ai-gateway): Wrap your OpenAI client with Caveman Middleware, keep the Cloudflare AI Gateway compat URL, and compare token counts in gateway analytics. Rollback included.
- [Switch from Headroom to Caveman: step by step guide](https://caveman.so/switch/headroom): Move a coding agent or a Vercel AI SDK app from Headroom to Caveman: free port 8787, swap the wrapper or adapter, check recovery, compare, and roll back.
- [Add Caveman to Helicone: compress tool output](https://caveman.so/switch/helicone): Keep your Helicone AI gateway and session logs. Wrap the OpenAI client with Caveman Middleware, compare two tagged sessions, and roll back in one line.
- [Add Caveman to Langfuse: setup and quality check](https://caveman.so/switch/langfuse): Keep Langfuse tracing and add Caveman Middleware to a Python agent, then run one Langfuse dataset experiment in record and compress mode to confirm quality.
- [How to add Caveman Middleware to a LangGraph agent](https://caveman.so/switch/langgraph): Add token compression to a LangGraph agent through LangChain middleware: install caveman-middleware, start the runtime, wrap create_agent, scope by thread_id.
- [Add Caveman to LangSmith: setup and eval check](https://caveman.so/switch/langsmith): Add Caveman Middleware to a LangChain or LangGraph agent traced in LangSmith, then compare a record and a compress experiment to confirm answers held up.
- [How to add Caveman to LiteLLM: SDK, Router and proxy](https://caveman.so/switch/litellm): Add the Caveman callback to LiteLLM step by step: start the runtime, wrap one agent's calls, confirm tool results shrink, and turn it off with one setting.
- [Switch from LLMLingua to Caveman for tool output](https://caveman.so/switch/llmlingua): Move agent tool-result compression from LLMLingua to Caveman Middleware in a LangChain app, keep LLMLingua on RAG passages, check recovery, and roll back fast.
- [Use Caveman with Martian Gateway: compress tool output](https://caveman.so/switch/martian): Keep your Martian Gateway key and base URL, wrap the OpenAI client with Caveman Middleware, and send fewer input tokens from tool output. Setup and rollback.
- [How to add token compression to a Mastra agent](https://caveman.so/switch/mastra): Add Caveman Middleware to an existing Mastra agent with withCavemanMastra: install, start the local runtime, wrap the agent, check the reports and roll back.
- [Use Caveman with Not Diamond: add token compression](https://caveman.so/switch/not-diamond): Keep Not Diamond choosing the model and wrap the provider call with Caveman Middleware so tool output costs fewer input tokens. Setup, checks and rollback.
- [Add Caveman to OpenRouter: wrap the OpenAI client](https://caveman.so/switch/openrouter): Keep your OpenRouter key, models and headers. Wrap the OpenAI client with Caveman Middleware, pin one model to measure fairly, then compare usage or roll back.
- [How to add Caveman to Portkey without changing configs](https://caveman.so/switch/portkey): Keep Portkey as your gateway and wrap one agent's OpenAI client with Caveman Middleware. Step by step setup, how to confirm it in Portkey logs, and rollback.
- [Add Caveman to PromptLayer without touching prompts](https://caveman.so/switch/promptlayer): Keep PromptLayer's registry, labels and logs. Call through a Caveman-wrapped OpenAI client, log both arms with tags, and score them in one PromptLayer Table.
- [How to add token compression to Pydantic AI agents](https://caveman.so/switch/pydanticai): Add Caveman Middleware to a Pydantic AI agent as one capability: install the extra, start the local runtime, add CavemanCapability, check reports, roll back.
- [Use Caveman with RouteLLM: route, then compress](https://caveman.so/switch/routellm): Keep RouteLLM choosing between your strong and weak model, and send the routed call through Caveman's LiteLLM adapter so tool output costs fewer tokens.
- [RTK alternative: try Caveman shrink and the proxy](https://caveman.so/switch/rtk): Compare RTK and Caveman on one real command, check exit codes and byte-exact recovery, then swap the shell hook or add the proxy. Includes a one-step rollback.
- [Add Caveman to Vercel AI Gateway with the AI SDK](https://caveman.so/switch/vercel-ai-gateway): Wrap your Vercel AI Gateway model with withCaveman, keep budgets and fallbacks, and compare input tokens in the gateway logs. Covers Functions and rollback.
- [How to add token compression to the Vercel AI SDK](https://caveman.so/switch/vercel-ai-sdk): Add Caveman Middleware to a Vercel AI SDK app in one wrap: install, start the local runtime, wrap streamText with withCaveman, read the reports, roll back.
