Laravel TOON is a package that reduces LLM token usage by 40-60% through intelligent data serialization. It flattens nested JSON objects into a compact YAML-like format using dot notation, eliminating repeated keys, braces, and quotes. Real-world benchmarks show savings of ~2,200 tokens per 50-record response. The package includes configuration options for omitting null values, truncating strings, aliasing keys, and controlling nesting depth. It's particularly useful for MCP servers and LLM context optimization, with full round-trip fidelity for decoding back to original structures.
Table of contents
# What It Does# Real-World Benchmarks# Configuration Options# Use Cases# Works Great with Laravel MCP# Installation3 Comments
Sort: