vinkius-labs/synapse-toon
Synapse Toon converts PHP arrays, Eloquent models, and JSON payloads into TOON, a compact token-efficient format for LLM prompts. Cut prompt size and API costs while keeping structured data readable, with simple Laravel helpers and configurable encoding.
SynapseToonPayloadAnalyzer plus SynapseToonMetrics (Log/Prometheus/Datadog drivers) give you a before/after measurement path, which is what turns "compression sounds good" into a defensible business case.SynapseToonLLMRouter, SynapseToonRagService, and SynapseToonGraphQLAdapter as separate roadmap bets with their own evaluation, since they overlap with tooling most teams already run.SynapseToonProcessLLMBatchJob, up to 100 prompts/dispatch), GraphQL-to-LLM gateways, and RAG snippet delivery are the workloads where structured payloads dominate token counts — and therefore where the 25–45% claim has the most leverage.Critical qualifier for every decision above: token savings only become cost savings if the consumer can read TOON. If the payload terminates at a third-party API that expects JSON or plain text, you have moved the decode work — and the fidelity risk — into the model rather than eliminating spend. This package is a strong fit for internal service-to-service paths and self-hosted inference; it is a much weaker fit for direct calls to hosted provider endpoints.
Adopt when:
Look elsewhere or defer when:
SynapseToonLLMRouter and SynapseToonRagService will overlap and create two sources of truth.For executives — the one-liner: "A drop-in Laravel package that shrinks the token weight of our structured LLM payloads by roughly a quarter to a third, with built-in instrumentation so we can prove the saving rather than assume it. We propose a two-week, two-workload pilot before any broader commitment."
Frame it as a cost-of-goods reduction with a measurement plan, not a technology migration. The vendor's own table (44.7% on a 500-item catalog feed, ~40% on chat context, ~35% on a nested GraphQL query) maps onto workloads most product orgs already run, so the sizing conversation is concrete. Pair the savings claim with the caveat up front — savings are real only where we own the decode path — because a number that gets walked back in month two is worse than a smaller number that holds.
For engineering — the ask: integrate the codec behind a feature flag on two internal, self-decoding workloads; wire SynapseToonPayloadAnalyzer and one metrics driver; and run an A/B against the current JSON path measuring both token spend and task accuracy. Set acceptance criteria in advance, e.g. ≥20% token reduction with no more than a 2-point accuracy regression. Defer the router, RAG, and GraphQL components until the codec earns its place — they carry integration cost and duplicate systems we already operate.
Positioning line for the wider team: "Cheap to try, cheap to remove, measurable in a sprint. The only expensive outcome is adopting the whole stack on faith."
How can I help you explore Laravel packages today?