Repeated keys waste tokens. Auto-tabular mode compresses arrays of objects by 50-70%.
The Problem
Homogeneous arrays repeat keys for every element:JSON - Keys repeated 3 times
id, score, and title appear 3 times each
The Solution
Tabular mode lists keys once, then rows:GLYPH tabular - Keys listed once
62% reduction - Savings scale linearly with row count
How It Works
Auto-Detection
GLYPH automatically detects when a list qualifies for tabular emission:Check eligibility
- Contains ≥ 3 elements (configurable)
- All elements are maps or structs
- Total column count ≤ 20 (configurable)
- All rows have identical keys (or
AllowMissing=true)
Syntax
Format Details
- Header
- Rows
@tab: Directive marker_: Null placeholder (for future schema refs)[...]: Sorted column names
Token Savings
By Row Count
From the Codec Benchmark Report:| Rows | JSON Tokens | GLYPH Loose | GLYPH Tabular | Savings vs JSON |
|---|---|---|---|---|
| 3 | 120 | 85 | 45 | 62% |
| 5 | 200 | 140 | 70 | 65% |
| 10 | 400 | 270 | 130 | 68% |
| 25 | 1,000 | 670 | 310 | 69% |
| 50 | 2,000 | 1,340 | 620 | 69% |
Savings scale linearly: More rows = more savings
Calculation
Formula: Token savings = (repeated_keys × rows) - header_overheadUsage
Enabling Tabular Mode
Parsing Tables
Column Handling
Column Ordering
Columns are sorted by UTF-8 byte order (same as map keys):Consistent ordering ensures deterministic output for fingerprinting.
Missing Values
WhenAllowMissing=true, rows with missing keys use _ (null):
- Sparse Data
- Tabular Output
Nested Values
Complex values are emitted inline:- Input
- Tabular Output
Configuration Options
From the LOOSE_MODE_SPEC:| Option | Type | Default | Description |
|---|---|---|---|
AutoTabular | bool | varies | Enable auto-tabular detection |
MinRows | int | 3 | Minimum rows to trigger tabular |
MaxCols | int | 20 | Maximum columns allowed |
AllowMissing | bool | true | Allow rows with missing keys |
NullStyle | enum | underscore | symbol for ∅, underscore for _ |
SchemaRef | string | "" | Schema hash/id for @schema header |
KeyDict | []string | nil | Key dictionary for compact keys |
UseCompactKeys | bool | false | Emit #N instead of field names |
Examples
Use Cases
RAG Search Results
- Scenario
- JSON (456 tokens)
- GLYPH Tabular (220 tokens)
Retrieve 25 documents from vector database with scores and metadata.
Database Query Results
- Scenario
- JSON (~2,000 tokens)
- GLYPH Tabular (~800 tokens)
Export 100 user records for agent processing.
Log Aggregation
- Scenario
- JSON (~1,500 tokens)
- GLYPH Tabular (~600 tokens)
Send 50 log entries to LLM for analysis.
Metadata for Streaming
Optional row/column counts enable verification:Benefits
Truncation Detection
Verify all rows received: count rows and compare to metadata
Progress Tracking
Show progress: “Received 50/120 rows…”
Stream Resync
Resume after interruption by skipping to known row count
Validation
Ensure complete transmission before processing
When to Use Tabular Mode
✅ Ideal For:
Search Results
Search Results
- Vector database results
- Web search results
- Document retrieval
Database Exports
Database Exports
- Query results
- Batch data exports
- CSV-like data
Log Analysis
Log Analysis
- Application logs
- Access logs
- Audit trails
Batch API Responses
Batch API Responses
- List operations
- Bulk status checks
- Multi-item fetches
⚠️ Not Ideal For:
Heterogeneous Data
Objects with different structures don’t benefit from shared schema.
Single Items
One-element arrays have overhead, no savings.
Deeply Nested
Complex nesting in cells reduces readability.
Wide Schemas
20 columns make tables hard to read.
Performance
From benchmarks:| Format | Size (bytes) | Tokens | Compression |
|---|---|---|---|
| JSON-min | 5,109 | 1,000 | 100% (baseline) |
| GLYPH-Loose | 4,224 | 850 | 83% |
| GLYPH-Tabular | ~3,900 | ~720 | 76% |
Tabular mode achieves best token efficiency for homogeneous data
Summary
Token Savings
50-70% reduction for array data
Linear Scaling
More rows = proportionally more savings
Automatic
Auto-detects homogeneous lists
Human-Readable
Tabular format is easier to scan
Next Steps
Format Reference
Learn GLYPH syntax
Token Savings
Understand overall token efficiency
LOOSE MODE Spec
Complete technical specification
Benchmark Report
Full performance data