Skip to content

Repository files navigation

{ jtml }

JSON Token-Minimized Language — a schema-first serialization format that reduces JSON token usage by up to 60% for LLM prompts, without changing your data structure.

🔗 Live demo → jtml.dev


What it does

Instead of repeating keys on every row like JSON does, JTML sends the schema once and encodes the data as compact pipe-delimited rows. The model reads less, you pay less.

// JSON — keys repeated on every object
[
  { "id": 1, "name": "Alice", "role": "engineer", "active": true },
  { "id": 2, "name": "Bob",   "role": "designer", "active": false }
]
// JTML — schema once, data only
jtml/1.0 id:n name:s role:s active:b
1|Alice|engineer|true
2|Bob|designer|false

Install the library

npm install @jtml/core
import { encode, decode } from '@jtml/core';

const data = [
  { id: 1, name: 'Alice', role: 'engineer', active: true },
  { id: 2, name: 'Bob',   role: 'designer', active: false },
];

const jtml = encode(data);   // compact JTML string
const back = decode(jtml);   // original data, exactly

Run the web app locally

git clone https://github.com/thushanthbengre22-dev/jtml-web
cd jtml-web
npm install
npm run dev

Open http://localhost:3000.

LLM Analysis feature

The site includes a live analysis panel that runs any JSON/JTML pair through a model of your choice simultaneously, showing that the model interprets both formats identically.

To use it, you'll need an API key from one of the supported providers:

Provider Get a key
Anthropic console.anthropic.com
OpenAI platform.openai.com
Google aistudio.google.com

Keys are stored locally in your browser and never sent to any server other than the provider's own API.


Stack


License

MIT © Thushanth Devananda Bengre

About

Interactive demo dashboard for JTML - see real LLM token savings in action. Live API comparison, cost calculator, and quality verification. Built with Next.js. Test with your own data or use sample datasets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages