Skip to main content

Drop-in SDK for Anthropic & OpenAI — compresses prompts transparently. CLI + REST API + Claude Code MCP.

Project description

Promptolian — Context Reliability Proxy for AI Agents

Proxy layer for AI agents — keeps context intact across long conversations and eliminates redundant token costs. One line to add, zero changes to your agent logic.

promptolian.com · Pricing · Dashboard · Docs


Install

pip install promptolian            # core (rule-based, no deps)
pip install "promptolian[proxy]"   # + transparent API proxy
pip install "promptolian[nlp]"     # + NLP compression (spacy)
pip install "promptolian[mcp]"     # + Claude Code MCP tool
pip install "promptolian[full]"    # everything

Quick Start

# Transparent proxy at http://localhost:3002
python -m promptolian.proxy

# With context compression
python -m promptolian.proxy --compress

# With automatic session reset at 70% of context window
python -m promptolian.proxy --reset-at 0.70

Point your Anthropic or OpenAI client at http://localhost:3002 — no other changes needed.


Context Engine

KV-sandwich architecture — preserves what matters, compresses what doesn't:

  • HEAD (first 2 turns): verbatim — session framing preserved
  • MIDDLE: entity-encoded + compressed — redundant tokens removed
  • TAIL (last 4 turns): verbatim — recent facts + task state intact

Benchmark results (25 sessions, Factory.ai 6-dimension scoring):

Promptolian Anthropic built-in OpenAI built-in
Quality score 4.26 / 5 3.44 / 5 3.35 / 5
Compression 21.8% 98.7% 99.3%

Session Reset

The proxy tracks cumulative token usage per session. When it approaches the model's context window limit, it automatically compresses the conversation history via the context engine and starts a fresh session — injecting the compressed context as a system prompt. The provider never sees a context long enough to trigger their own native compression.

Works for both Anthropic and OpenAI/Codex. A X-Promptolian-Reset: true header is returned when a reset occurs.


Tool Schema Caching

The proxy adds cache_control to tool schemas and re-injects them on subsequent calls. Anthropic bills cached tokens at 10%.

Without proxy: 500 calls/day × 5 tools × 120 tok × 30 days = 9M tok/mo → $27.00
With proxy:    9M tok × 10% cache rate                       = 900K tok/mo → $2.70

Plans

Plan Price Sessions Keys
Free $0 SQLite · self-hosted
Solo $9/mo PostgreSQL · always-on 1
Team $49/mo PostgreSQL · always-on Up to 10

promptolian.com/pricing.html

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

promptolian-2.3.3.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promptolian-2.3.3-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file promptolian-2.3.3.tar.gz.

File metadata

  • Download URL: promptolian-2.3.3.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for promptolian-2.3.3.tar.gz
Algorithm Hash digest
SHA256 e16d0120b9515b6412641b88fadc2625808479022033bf23ed30f4ac2b0becc2
MD5 be6beb626577ec1dbeb9d4d1cb01055e
BLAKE2b-256 8de67ece55627542fd9e68e37f8194564d6265b4b39e5f9a1ff3b1982eba0e19

See more details on using hashes here.

File details

Details for the file promptolian-2.3.3-py3-none-any.whl.

File metadata

  • Download URL: promptolian-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for promptolian-2.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 76000ee220db71a644196802de1852f333510927c15ea2b13835c010f8a55624
MD5 73c1a4734146a521dcb544273881d917
BLAKE2b-256 8fa4a5a608bcf122d8e580254036cf598bf6c14adc9a909022900801a1f440d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page