Paritok CLI
Paritok is a proxy between a coding agent and the model API that compresses requests and cuts the input-token bill.
- 1,445 ★ on the repository
- Last commit
Broad access
Why this level
- The proxy sees all traffic between the agent and the model, including code and command output, and rewrites requests.
- In hosted mode, request content goes to a third-party GPU server.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/paritokDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The proxy sees all traffic between the agent and the model, including code and command output, and rewrites requests.
- In hosted mode, request content goes to a third-party GPU server.
This is third-party code. Review the repository files before installing.
What it does
Paritok runs as a local server and sits between the agent and the Anthropic or OpenAI API. The agent connects to it through `ANTHROPIC_BASE_URL` or `OPENAI_BASE_URL`, and the proxy rewrites the request before forwarding. It keeps only the needed tool schemas, compresses command output and file reads and folds stale history. Compression is non-destructive: original chunks can be expanded on request through `read_original`. The compressing model is Paritok-4B built on Qwen3-4B, run locally through Ollama or vLLM or used as a paid hosted service. Model responses return unchanged and your real provider keys stay with you. It works with Claude Code, Cursor, Codex, OpenHands and any agent on an OpenAI-compatible API.
Who it is for. People who spend long sessions in Claude Code, Cursor or Codex and want to cut token spend without changing the agent.
Good fit when
- Long Claude Code sessions inflate the bill through history and tool results.
- Dozens of MCP servers are attached and tool schemas fill half of the context.
- You want a compression model on your own hardware without sending data to an outside service.
- The agent works through an OpenAI-compatible API such as Groq or OpenRouter and you want uniform savings.
Not a fit when
- Requests are short and no history builds up: gains will be small.
- There is no room for the model: the local version pulls about 2.5 GB through Ollama.
- Policy forbids routing code through an intermediate proxy, even a local one.
Example request
Start Paritok locally, set `ANTHROPIC_BASE_URL=http://127.0.0.1:8080` and open `/stats` to see how many tokens were saved.Limitations
The server must stay up for the whole session. Local mode needs Ollama and about 2.5 GB for the quantized model, the full version takes about 8 GB. The first request with the tool filter warms up for 10 to 15 seconds. The hosted GPU service paritok.com is billed per million processed tokens, and in that mode the proxy sends request content to it. Codex does not read `OPENAI_BASE_URL`, so `paritok up` edits `~/.codex/config.toml` and keeps a backup. The last commit dates from November 2026.
How to disable. Stop the proxy, remove `ANTHROPIC_BASE_URL` and `OPENAI_BASE_URL` from the agent environment and uninstall the package: `pip uninstall paritok`. If you enabled Codex, restore `~/.codex/config.toml` from the backup.
FAQ
How do I connect Paritok to Claude Code?
Run `paritok up`, then in the agent shell run `export ANTHROPIC_BASE_URL=http://127.0.0.1:8080` and start Claude Code.
How do I check that compression works?
Open `http://127.0.0.1:8080/stats`: the counter shows original and compressed tokens for the session. `/health` reports server state.
How much does it cost?
Self-hosting is free under Apache 2.0. The hosted service at paritok.com costs 0.30 dollars per million processed tokens.
How do I enable the tool-schema filter?
Install the extra `pip install "paritok[toolselect]"`, which adds sentence-transformers for semantic tool selection.
Does it work with Codex?
Yes. Codex reads its endpoint from `~/.codex/config.toml`, and `paritok up` writes it, keeping the old file.
Discussion
No questions or reviews yet.
Related
CLI toolsA proxy between an agent and a local model: old tool outputs go to a disk archive the model reads back with a recall tool
An MCP server that hands bounded tasks to a local model or a cheap cloud API, while Claude stays the architect and saves tokens
Local proxy between agent and model API: compresses diffs and logs, keeps the request prefix stable for prompt caching.
A local OpenAI-compatible proxy that caches repeated agent requests and replays stored answers without calling the model.
An open coding agent for the terminal, browser and desktop that works with models from OpenAI and Claude to Ollama
Local context compression for agents: tool outputs, logs, files and RAG chunks shrink before reaching the LLM. Proxy, CLI, library and MCP
README in short
The paritok Python package runs a proxy on port 8080 and pulls the model through Ollama. Settings live in `paritok.yaml` and the `use_gpu_server` switch picks the local or hosted model.