Cut AI coding-agent token cost up to 95%
Paritok is an open-source 4B code-semantic compression model. It shrinks the context your agent sends to Claude / GPT up to 95% — keeping function signatures, imports, paths and errors intact — at GPT-4.1-mini / GPT-5 level task accuracy.
free for self-host or $0 / token during the limited-time launch use our hosted GPU endpoint.
[SEG kind=file_read] src/payments/refund.py
def process_refund(order_id, amount, reason=None):
"""Full 120-line implementation with docstrings,
imports, helper functions, inline comments, type
hints, logging calls, and error handling ..."""
import logging
logger = logging.getLogger(__name__)
order = Order.objects.get(id=order_id)
if order.status != 'paid':
logger.warning('refund on unpaid order %s', order_id)
raise InvalidRefund(order_id)
... (and 6 more files, full bash logs, stack traces)[SEG kind=file_read] src/payments/refund.py process_refund(order_id, amount, reason=None) -> guards order.status=='paid' else InvalidRefund -> logs warning on unpaid; uses Order.objects.get signatures + imports + paths preserved. 6 files compressed, stack traces kept verbatim. # semantics intact → agent still solves the task
A middle-layer proxy
Drop it between your agent and the API
No retraining, no prompt surgery. Point your agent at the Paritok proxy and it compresses every turn on the way up.
Your agent sends raw context
Claude Code, Cursor, Copilot, OpenHands or your own SDK emits its usual multi-file, multi-turn trajectory — often 8–30K tokens per turn.
Paritok compresses each turn
The 4B model rewrites each segment, dropping boilerplate while preserving signatures, imports, file paths, line numbers and error messages.
Upstream LLM is billed on less
Compressed prompts flow to Anthropic / OpenAI; original responses flow back unchanged. You pay for a fraction of the input tokens.
Honest, OOD-holdout benchmark
2× tighter than GPT prompt compression.
Same accuracy, $0 per token.
GPT-based prompt compression bills you per token, every turn. Paritok is an open 4B model you self-host — free.
| Paritok-4B-v1 | LLMLingua-2 | gpt-4.1-mini(prompt) | |
|---|---|---|---|
| Trained on real coding-agent trajectories | ✓ | ✕ | ✕ |
| Preserves function names / imports / paths | ✓ | ◑ | ◑ |
| Compression rate(lower = harder) | 25.7%⭐ | ~40% | 50.2% |
| SWE-bench quality retained | 86.5%⭐ | — | 85.6% |
| Open weights | Apache-2.0 | MIT | ✕ |
| Per-token fee | ✓ Free | ✓ Free | $ Paid |
Compression ratio(compressed ÷ original · lower is better)
Note: In production, a middleware monitors compression quality in real time and repairs any loss on the fly. Your coding agent gets effectively lossless results.
Cost impact
Cut your input token bill typical 74% saving
| Turn input size | Uncompressed | With Paritok |
|---|---|---|
| Short (8K) | $0.024 | $0.006 |
| Typical (15K) | $0.045 | $0.012 |
| Long session (30K) | $0.090 | $0.023 |
Estimate your own project
Drag the sliders to model your team's input spend before vs. after compression.
Illustrative estimate. Real savings depend on how much of your context is compressible history vs. fresh instructions.
Everything in the box
Built for real agent workloads
Code-semantic aware
Preserves function signatures, imports, class names, file paths, line numbers and error messages — the tokens agents actually reason over.
Fully open weights
Apache-2.0 LoRA adapter on Qwen3-4B. Reproducible data pipeline, raw eval numbers checked in. No black box.
Small & self-hostable
4B, runs on a single 8GB GPU. A smaller, cheaper prompt goes upstream on every turn.
Provider-agnostic proxy
Sits between your agent and Anthropic, OpenAI, or any OpenAI-compatible endpoint. Works with Claude Code, Cursor, Copilot, OpenHands.
Production safeguards
Format checks, target-identifier presence checks, and a per-session toggle to fall back to raw context when you can't tolerate any loss.
Usage dashboard
Track tokens in, tokens saved, average ratio and estimated agent-cost saved per API key — all in one place.
Hosted GPU endpoint
Don't want to run a GPU? Use our managed endpoint for zero-setup compression. $0 / token during the limited-time launch.
Self-host in minutes
From Hugging Face to running proxy
The model is fully open and ships on PyPI — no git clone. Install, run paritok up, and point your agent at it. No data leaves your infrastructure.
# The middleware + CLI. No git clone needed — it all ships on PyPI.
# (Install Ollama first from https://ollama.com/download — it's a separate binary.)
pip install "paritok[proxy]"# Pulls the model if missing (~2.5GB, first run), then starts the proxy.
# LEAVE THIS TERMINAL RUNNING — it must stay up for the whole session.
paritok up
# Want full precision (~8GB) instead of q4?
# paritok up --registry-model paritok/paritok-4b-v1:f16
# Already pulled a variant yourself? 'up' auto-detects and uses it.# In a SEPARATE terminal, point your agent at the proxy, then launch it.
# macOS / Linux:
export ANTHROPIC_BASE_URL=http://127.0.0.1:8080 # Claude Code
export OPENAI_BASE_URL=http://127.0.0.1:8080 # Codex / OpenAI agents
# Windows PowerShell:
# $env:ANTHROPIC_BASE_URL = "http://127.0.0.1:8080"# Optional — only to change settings (backend, ports, thresholds).
# Defaults work with no file; this drops a starter paritok.yaml you can edit.
paritok initDon't want to run a GPU?
Use our hosted endpoint on the Paritok GPU server — zero setup, faster compression, still just needs an API key. $0 / token, limited-time free.
Pricing
Free to start. Free to self-host.
Pricing is $0 / token during launch. An API key is still required so your usage — tokens compressed, cost saved — shows up on your dashboard.
Self-host
Run the open weights on your own GPU. Full control, nothing leaves your infra.
- ✓Open LoRA adapter on Hugging Face
- ✓Reference proxy server included
- ✓Runs on a single 8GB GPU
- ✓Community support on GitHub
Hosted GPU
Zero-setup compression on our GPU server. Just create an API key and point your agent at it.
- ✓Managed, always-on endpoint
- ✓Faster compression than a laptop GPU
- ✓Usage dashboard: tokens & cost saved
- ✓No credit card required
Start your Paritok journey
Get a free API key in seconds, or download the open model and run it yourself today.