---
title: "Caveman models"
description: "Every agent turn pays three times: for what it reads, what it remembers and who does the thinking. Each Caveman model cuts one of them, behind one Caveman Cloud key."
canonical: https://caveman.so/models
last-updated: 2026-10-28
---

# Caveman models

Every agent turn pays three times: for what it reads, what it remembers and
who does the thinking. Each Caveman model cuts one of them, behind one
Caveman Cloud key.

- [trim-1](https://caveman.so/models/trim-1), what your agent reads:
  `POST /v1/trim`. Keeps only the lines of a payload the question needs, byte
  for byte. 88.9% fewer tokens on long documents with 96% of answers still
  right; 7.2 ms for 5,000 tokens on one CPU core. Open source, Apache-2.0.
- [compact-1](https://caveman.so/models/compact-1), what your agent
  remembers: `POST /v1/compact`. Fits a whole agent history inside a token
  budget with no summary call: 3.8 ms p50, 99% as good as the full history,
  24% less per task at the same score on long-horizon runs.
- [router-1](https://caveman.so/models/router-1), who does the thinking:
  `POST /v1/route`. Picks the model and effort for every call from the list
  you send. On 85 agentic coding tasks: 0.46x the cost of always-Opus, 2.2x
  faster, the same solve rate within the noise. Interim, list prices.

Free each month: 50M trim tokens, 10M compact tokens, 25,000 route decisions.
Free while the preview runs.

## In your agent

One wrapper around the call you already make. Your framework, provider, keys
and saved history stay as they are.

```sh
npm install @caveman-ai/middleware @caveman-ai/sdk
pip install 'caveman-middleware[langchain]' caveman-sdk
```

The client packages talk to a local runtime that you start separately:

```sh
npm i -g @caveman-ai/cli && CAVEMAN_MODE=compress caveman start
```

Version 1.0 (TypeScript 1.0.1, Python 1.0.0), with 8 TypeScript and 13 Python
adapters. Certified with the Vercel AI SDK, OpenAI, Anthropic, LangChain and
LiteLLM; the others (Google GenAI, Strands, Mastra, MCP, CrewAI, Pydantic AI,
LlamaIndex, Agno, AutoGen, ASGI) are experimental. Outside strict mode, any
failure sends your original request unchanged. Savings inside apps are not
measured yet.

Docs: https://docs.caveman.so/caveman/middleware
