PHP Classes

File: SUMMARY.md

Recommend this page to a friend!
  Packages of Jacobo Cantorna Cigarrán   Laravel Toon   SUMMARY.md   Download  
File: SUMMARY.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Laravel Toon
Encode and decode values in the TOON format
Author: By
Last change:
Date: 5 months ago
Size: 2,432 bytes
 

Contents

Class file image Download

LaravelToon - Executive Summary

What is LaravelToon?

LaravelToon is a production-ready Laravel package that integrates TOON (Token-Oriented Object Notation) for compressing and optimizing AI prompts and LLM contexts.

Key Benefits

  • Save 60-70% on LLM API costs
  • Reduce tokens by 60-70% compared to JSON
  • Multi-LLM support: OpenAI, Claude, Gemini, Mistral
  • Deep analysis: Token counting, cost calculation, compression metrics
  • ? Native Laravel: Service providers, facades, Artisan commands
  • Fully documented: 8 comprehensive guides

Quick Installation

composer require squareetlabs/laravel-toon
php artisan toon:dashboard

Technology Stack

  • PHP: 8.1+
  • Laravel: 9.0-12.x
  • License: MIT
  • Dependencies: Minimal (Illuminate only)

Package Statistics

| Metric | Value | |--------|-------| | Files | 40+ | | Classes | 26 | | Helpers | 22 | | Commands | 4 | | LLM Adapters | 5 | | Lines of Code | ~3,500 | | Type Safety | 100% | | PHPStan Level | 9 |

What You Get

Core Services

  • `ToonService` - Compression and conversion
  • `TokenAnalyzer` - Token estimation
  • `CompressionMetrics` - Performance benchmarking
  • `CostCalculator` - LLM cost estimation

LLM Adapters

  • OpenAI (GPT-4o, GPT-4, GPT-3.5-turbo)
  • Anthropic (Claude 3 series)
  • Google Gemini (Gemini Pro)
  • Mistral (Mistral Large/Medium/Small)

Developer Tools

  • 22 global helper functions
  • Artisan commands (convert, analyze, benchmark, dashboard)
  • Eloquent model trait
  • Validation rules
  • Middleware for auto-compression

Documentation

  • README (English & Spanish)
  • Installation guide
  • Quick start guide
  • 10+ code examples
  • Architecture documentation
  • Comprehensive API docs

Use Cases

1. Prompt Optimization

Compress large datasets before sending to ChatGPT/Claude, saving 60-70% tokens.

2. RAG Systems

Optimize context for Retrieval-Augmented Generation pipelines.

3. Cost Monitoring

Track and control API expenses with budget analysis tools.

4. Multi-LLM Strategy

Compare costs across OpenAI, Claude, Gemini, and Mistral.

5. Log Analysis

Send large logs to AI for analysis with minimal token usage.

Contact & Support

  • Email: labs@squareet.com
  • Website: https://squareet.com
  • Issues: GitHub Issues
  • Docs: README.md and guides

LaravelToon v1.0.0 - November 14, 2025