Products / Developer tools
Tauq
Tauq is a schema-driven, streaming-capable data notation designed to use fewer tokens than JSON. It ships with a CLI, a query language and bindings for several languages.
cargo install tauq- 44-54%
- Fewer tokens than JSON (tiktoken cl100k_base)
Features
Built for production
Token-efficient
Space delimiters tokenize better than commas, reducing the token count compared with equivalent JSON.
True streaming
A StreamingParser iterator API processes records one at a time, with no record count required.
Schema-driven
Define data shapes with !def and switch schemas with !use. Nested types and typed arrays are supported.
Programmable
Tauq Query provides data transformations with a Unix pipe model and polyglot support.
CLI
Build, format, minify, exec and validate commands out of the box.
Multi-language bindings
Bindings are listed for Rust, Python, JavaScript, Go, Java, C# and Swift.
In code
See it work
// JSON (24 tokens)
[{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}]
// Tauq (11 tokens)
!def User id name
1 Alice
2 Bob!def User id name email role
1 Alice "alice@ex.com" admin
2 Bob "bob@ex.com" user
3 Carol "carol@ex.com" user!def Address street city
!def User id name addr:Address
1 Alice { "123 Main" "NYC" }
2 Bob { "456 Oak" "LA" }tauq build data.tqn
tauq format data.json
tauq minify data.tqn
tauq exec pipeline.tqq
tauq validate data.tqn
cat data.tqn | tauq build -Token savings
Counts were produced with tiktoken cl100k_base, the tokenizer used by GPT-4. On a benchmark of 1000 records, JSON measured 24,005 tokens, TOON 12,002 tokens (-50.0%) and Tauq 11,012 tokens (-54.1%).
Savings depend on the shape of your data. Validate against your own payloads before relying on the figures.
CLI commands
- `tauq build`: parse Tauq to JSON - `tauq format`: convert JSON to Tauq - `tauq minify`: compress to a single line - `tauq exec`: run a Tauq Query - `tauq validate`: check syntax
Input can also be piped on stdin.
Installation
Rust: `cargo install tauq`
Python: `pip install tauq`
JavaScript: `npm install tauq`
Go: `go get github.com/epistates/tauq`
Putting Tauq to work?
We help teams design, build and operate production systems on this stack.