list<struct> values with homogeneous schemas. It encodes column headers once, then streams rows. Perfect for embeddings, search results, metrics, and dataset streaming.
Token Savings
Tabular mode provides dramatic token savings for homogeneous lists:| Data Type | JSON Tokens | GLYPH Tabular | Savings |
|---|---|---|---|
| 10 search results | 320 | 145 | 55% |
| 100 embeddings | 15,600 | 4,200 | 73% |
| 50 user records | 1,200 | 480 | 60% |
| 25 metrics | 580 | 210 | 64% |
Savings increase with row count. Tabular becomes beneficial at ~3+ rows.
Basic Tabular Format
A simple example:JSON (Traditional)
GLYPH Tabular
JSON
58 tokens for 3 results
GLYPH Tabular
34 tokens for 3 results (41% savings)
Creating Tabular Data
From Python Lists
Output
RAG with Search Results
Build RAG context with tabular search results:Tabular format uses 45-55% fewer tokens than JSON for search results, leaving more room for retrieved content.
Embeddings
Stream embeddings efficiently:Output
Streaming Rows
Stream rows incrementally as they’re generated:Parsing Tabular Output
Parse tables from LLM output:Metrics and Logs
Stream metrics efficiently:Wire Key Compression
Use short wire keys for maximum compression:Best Practices
When to Use Tabular Mode
When to Use Tabular Mode
Use tabular when:
- List has 3+ homogeneous items
- Items are structs with same schema
- Token efficiency matters
- Streaming results incrementally
- Search results
- Embeddings
- Metrics/logs
- Dataset rows
- Batch inference results
- Heterogeneous data
- < 3 items (overhead not worth it)
- Need nested structures (use struct mode)
Column Ordering
Column Ordering
Order columns by:
- Identifiers first (
id,doc_id) - Important fields (scores, status)
- Less important fields (metadata)
- Large fields last (content, vectors)
Handling Large Vectors
Handling Large Vectors
For large embeddings (1536+ dimensions):
Complete Example: Document Search
Put it all together:Next Steps
JSON Interop
Migrate from JSON or use both formats
State Management
Efficient state tracking with patches