Drop-in SDK for Anthropic & OpenAI — compresses prompts transparently. CLI + REST API + Claude Code MCP.
Project description
Promptolian
AI agents burn tokens repeating themselves. Promptolian stops that — transparently, with one line of code.
A local proxy that sits between your code and the Anthropic / OpenAI API. No SDK changes. No new abstractions. Just cheaper, more reliable agents.
promptolian.com · Docs · Pricing
What it does
- Deduplicates tool outputs — when an agent reads the same file twice, the second read costs ~5 tokens instead of thousands
- Prevents context wall failures — resets the session automatically before the model hits its context limit, preserving what matters
- Caches tool schemas — Anthropic charges 10% for cached tokens; the proxy handles this for you
All free. No API key needed to start.
Install
pip install "promptolian[proxy]"
Quick Start
python -m promptolian.proxy
Then change one line in your code:
# Before
client = anthropic.Anthropic()
# After
client = anthropic.Anthropic(base_url="http://localhost:3002")
That's it. Every API call now goes through the proxy.
Features
Tool Result Compression (free)
In agentic workflows, the same files get read repeatedly, bash outputs recur, search results repeat. The proxy deduplicates automatically:
- Exact repeat →
[TOOL_CACHE_REF: same as call #N]— ~5 tokens instead of thousands - Similar content → compact diff showing only what changed
Benchmark: 34.6% token savings on tool outputs, 99% fact retention across 9 agentic sessions.
Works for both Anthropic (tool_result) and OpenAI (role=tool) formats. No configuration needed.
Tool Schema Caching (free)
The proxy automatically adds cache_control to tool definitions. Anthropic charges 10% for cached tokens.
500 calls/day × 5 tools × 120 tokens × 30 days = 9M tokens/mo → $27
With caching: 900K tokens/mo → $2.70
Session Reset (requires API key)
The proxy tracks token usage per session. When it approaches the model's context window limit, it compresses the conversation history and starts a fresh session — injecting the compressed context as a system prompt.
PROMPTOLIAN_API_KEY=your_key python -m promptolian.proxy --reset-at 0.70
Without a key, session reset is disabled and the proxy still runs with free features.
Compression quality benchmark (25 sessions, Factory.ai scoring):
| Promptolian | Anthropic built-in | OpenAI built-in | |
|---|---|---|---|
| Quality score | 4.26 / 5 | 3.44 / 5 | 3.35 / 5 |
| Tokens kept | 21.8% | 1.3% | 0.7% |
Free vs Paid
| Free | Paid | |
|---|---|---|
| Tool result deduplication | Yes | Yes |
| Tool schema caching | Yes | Yes |
| Session reset + context compression | — | Yes |
| Compression quality score | — | 4.26 / 5 |
Get a key at promptolian.com/pricing — Solo $9/mo · Team $49/mo.
Claude Code — MCP
pip install "promptolian[mcp]"
Add to ~/.claude/settings.json:
{
"mcpServers": {
"promptolian": {
"command": "promptolian-mcp"
}
}
}
Restart Claude Code. Adds compress_prompt, compress_tools_schema, and compression_stats tools.
Health check
curl http://localhost:3002/proxy/health
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptolian-2.3.5.tar.gz.
File metadata
- Download URL: promptolian-2.3.5.tar.gz
- Upload date:
- Size: 40.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
811224ce2918741b20795d0d6d6d991edda0fe6c980b390f58236fe5915e3401
|
|
| MD5 |
420d77b043750a883d5f09c4aad8495a
|
|
| BLAKE2b-256 |
ca484af60fe636fb6bce2c1ea3c86c45a5e24a46ecff3c92f006a26ed80a3bbf
|
File details
Details for the file promptolian-2.3.5-py3-none-any.whl.
File metadata
- Download URL: promptolian-2.3.5-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20eb51360d595247c6eb178c79f2ffb41685179a9a658da01025091b37468bc8
|
|
| MD5 |
93981dd71b6e9aeec19dc21cf7f2ce4b
|
|
| BLAKE2b-256 |
aa166fc412fb5af076a9211178a15aae6810b310125f59ffef7653499f60bb40
|