Inspiration

Code agents either miss context or burn tokens on fat file reads. We wanted a policy that says retrieve generously — and let Paritok pay for it — instead of trimming early and hoping the answer is still right.

What it does

Ragmod is a CLI codebase agent. Point it at a local git checkout, ask a question, get an answer with file:line citations.

It is an agentic loop (search_repo, read_file, list_dir, run_tests), not one-shot RAG. Default retrieval is GENEROUS (200 search hits, ±40 line context) so recall stays high. Every chunk arrives as an OpenAI tool_result — the shape Paritok’s 4B compressor is trained on.

How we used Paritok

Paritok is a mandatory proxy between Ragmod and the upstream LLM (use_gpu_server: true). We never call the provider SDK directly.

  1. paritok.yaml with hosted GPU
  2. Local proxy on :8080
  3. Every chat completion → Paritok → Gemini/Groq

What we own vs Paritok: compression is Paritok’s. Over-retrieval policy + forcing compressible role=tool messages is Ragmod’s. Ablation: stuffing search into a user message → ~0 savings; signed tool bootstrap → tens of thousands saved.

Measured savings

Receipts: https://github.com/shreshth006/Ragmod/blob/main/docs/PROOF.md

Proof Result
Live ask /stats ~31k tokens_saved, ratio 0.33
A/B bench (3 tasks) 23,611 proxy_saved; provider tokens 26,143 → 20,996 (ratio 0.80)
Wave 0 smoke ~1.6k saved; fails if tokens_saved ≤ 0

We report our numbers, not Paritok’s published 74%.

How we built it

Python CLI · OpenAI-compatible tool calling · ripgrep · Paritok hosted GPU · Gemini/Groq upstream · ragmod ask / stats / bench

Judges can reproduce in ~10 minutes — see the repo README.

Challenges

  • Groq free-tier TPM vs generous retrieval → retries + stronger upstream
  • Gemini rejects synthetic tool_calls (thought_signature) — wrong workaround killed savings until we forced real signed tool calls
  • Honest A/B: over-retrieval can still exceed a tiny baseline on some metrics; we document both /stats and provider tokens

What we learned

Paritok is most compelling when compression is load-bearing: the product retrieves more than a normal agent would dare, and the proxy makes that affordable. Message shape (role=tool) matters as much as turning the proxy on.

Feedback

Links

Built With

Share this project:

Updates

Submission history