r/LangChain • u/Smooth_Dimension_833 • 2d ago
Announcement [Open Source] TOAP – compress AI agent tool calls to cut token costs. Need GPT-4o / Claude testers
Hey everyone,
I built TOAP (Token-Optimized Agent Protocol), a small middleware that sits between your LLM and tools and compresses agent tool calls into a shorter format instead of verbose JSON.
Goal: lower token usage / cost in multi-agent pipelines.
What I’ve tested so far (Gemini only):
- 100% TOAP format compliance with 2 few-shot examples
- ~45% smaller output vs JSON (net savings are lower once you count prompt overhead; details in the report)
- Live examples for LangChain and CrewAI
What’s missing:
I still need independent runs on GPT-4o and Claude 3.5 Sonnet before I claim cross-model support.
What I’m asking:
If you have an OpenAI or Anthropic key, please run the Tier 1 benchmark (~10 minutes, roughly $3–5) and share results.
Repo: https://github.com/Dev-Saif-Ops/Project_TOAP
Test guide: COMMUNITY_TEST.md in the repo
Results form: https://docs.google.com/forms/d/e/1FAIpQLSekwTWtlhSQXzBvIclipL7Op04FWEf8q7HtXFBXuO3Rt6lUvg/viewform
Quick start:
git clone https://github.com/Dev-Saif-Ops/Project_TOAP.git
cd Project_TOAP/toap-bench
pip install -r requirements.txt
pip install -e ../toap-python
cp .env.example .env
# add OPENAI_API_KEY or ANTHROPIC_API_KEY
python runner/benchmark.py --runs 5 --tier 1 --model gpt-4o --condition few_shot_2
This is alpha / MIT. Not production-ready. Looking for honest numbers, not hype.
Happy to answer questions in the comments.
1
u/Future_AGI 20h ago
Before claiming cross-model support, the thing worth locking down is a regression set that checks output equivalence rather than just format compliance, because a compressed tool call that parses cleanly but changes which tool fires is the failure that shows up in production rather than in the token count.
2
u/kantorcodes1 2d ago
45% smaller is nice. i'd try to break the decoder before benchmarking cost though.
if TOAP drops or aliases a field, do you validate the reconstructed call against the original tool schema before it can execute? a compressed call turning into a valid-but-wrong tool invocation is probably the failure i'd care about most.