toon-format 0.1.0

Token-Oriented Object Notation (TOON) - A compact, human-readable format for LLM input
Documentation

TOON Format for Rust

Crates.io Documentation License: MIT

Token-Oriented Object Notation is a compact, human-readable format designed for passing structured data to Large Language Models with significantly reduced token usage.

Status

🚧 This crate is currently a namespace reservation. Full implementation coming soon!

What is TOON?

TOON achieves 30-60% token reduction compared to JSON by:

  • Eliminating repetitive keys in arrays of objects
  • Using indentation instead of braces
  • Declaring structure upfront with explicit lengths and field names
  • Minimal quoting for string values

Example

JSON (verbose):

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob", "role": "user" }
  ]
}

TOON (compact):

users[2]{id,name,role}:
  1,Alice,admin
  2,Bob,user

Resources

Future Usage

Once implemented, the crate will provide:

use toon_format::{encode, decode};

let data = // your data structure
let toon_string = encode(data)?;
let decoded = decode(&toon_string)?;

Contributing

Interested in implementing TOON for Rust? Check out the specification and feel free to contribute!

License

MIT License © 2025-PRESENT Johann Schopplich