---
title: "Laravel TOON: Reduce LLM Token Usage by 40-60%"
url: https://daily.dev/posts/laravel-toon-reduce-llm-token-usage-by-40-60--h1gjahhys
source_url: https://laravel-news.com/laravel-toon
type: article
source: "Laravel News"
published: 2025-12-26T14:16:30.018Z
updated: 2025-12-26T14:17:00.901Z
tags: ["llm", "php", "laravel"]
reading_time: 4
upvotes: 44
comments: 3
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel TOON: Reduce LLM Token Usage by 40-60%

**[Laravel News](https://daily.dev/sources/ln)** · 4 min read · 44 upvotes · 3 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/laravel-toon>

## Community discussion

Top comments from developers on daily.dev.

**@niccolomachiavelli** · 0 upvotes

> cant you just use csv?

**@jamesdavis7** · 0 upvotes

> ⚫⚪

**@brennii96** · 0 upvotes

> I've seen this same package with the same readme quite a few times, makes me question it's validity. They haven't even been forked so the devs are clearly cloning and making out as if they wrote it themselves. I have no clue who the original author is so can't trust any of them. Especially when the top result on google looks like it's the original but when you look into it you can tell it's clearly a clone with a few pointless commits.

---

Tags: [#llm](https://daily.dev/tags/llm), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/laravel-toon-reduce-llm-token-usage-by-40-60--h1gjahhys)
