Token-efficient chat export processing for LLM and RAG pipelines.
Website |
Chatpack parses chat exports from Telegram, WhatsApp, Instagram, and Discord, converting them into token-efficient formats for LLM analysis and RAG ingestion.
Raw chat exports waste 80%+ of tokens on JSON structure, metadata, and formatting. Chatpack removes this noise, achieving 13x compression (92% token reduction) with CSV output.
┌─────────────────┐ ┌─────────────────┐
│ Telegram JSON │ │ Clean CSV │
│ WhatsApp TXT │ ──▶ chatpack ──▶ │ 13x compression │
│ Instagram JSON │ │ LLM-ready │
│ Discord Export │ │ RAG-optimized │
└─────────────────┘ └─────────────────┘
| Format | Input | Output | Compression |
|---|---|---|---|
| CSV | 11.2M tokens | 850K tokens | 13x (92%) |
| JSONL | 11.2M tokens | 1.0M tokens | 11x (91%) |
| JSON | 11.2M tokens | 1.3M tokens | 8x (88%) |
Command-line interface for chatpack. Separate repository: chatpack-cli
From crates.io:
cargo install chatpack-cliPre-built binaries: Download from GitHub Releases
| Platform | Architecture | Download |
|---|---|---|
| Linux | x86_64 | chatpack-linux-x86_64.tar.gz |
| Linux | ARM64 | chatpack-linux-aarch64.tar.gz |
| macOS | Intel | chatpack-macos-x86_64.tar.gz |
| macOS | Apple Silicon | chatpack-macos-aarch64.tar.gz |
| Windows | x86_64 | chatpack-windows-x86_64.zip |
chatpack tg result.json # Telegram
chatpack wa chat.txt # WhatsApp
chatpack ig message_1.json # Instagram
chatpack dc export.json # DiscordOutput: optimized_chat.csv — ready for LLM analysis.
chatpack tg chat.json -f json # Output format: csv, json, jsonl
chatpack tg chat.json -t # Include timestamps
chatpack tg chat.json --after 2024-01-01 # Filter by date
chatpack tg chat.json --from "Alice" # Filter by sender
chatpack tg chat.json --no-merge # Disable message mergingFull documentation: chatpack-cli README
Browser-based interface — no installation required. Separate repository: chatpack-web
- 100% Private — All processing happens locally via WebAssembly
- Files never leave your device — No server uploads
- Fast — Rust-powered WASM, 100K+ messages/sec
- Drag & drop your export file
- Select source platform and output format
- Click Convert
- Download the result
Python library for integration into your own projects.
pip install chatpackfrom chatpack import TelegramParser
parser = TelegramParser()
messages = parser.parse("export.json")
# Merge consecutive messages from same sender
merged = merge_consecutive(messages)
# Write as CSV (13x compression)
write_csv(merged, "output.csv")
print(f"Processed {len(merged)} messages")| Feature | Description | Default |
|---|---|---|
full |
All parsers + outputs + streaming | Yes |
telegram |
Telegram JSON parser | Yes |
whatsapp |
WhatsApp TXT parser | Yes |
instagram |
Instagram JSON parser | Yes |
discord |
Discord multi-format parser | Yes |
csv-output |
CSV output writer | Yes |
json-output |
JSON/JSONL output writers | Yes |
streaming |
O(1) memory streaming parsers | Yes |
Contributions welcome! Please:
- Check existing issues
- Open an issue before large changes
- Run
pytestbefore submitting PRs
MIT License. See LICENSE for details.
| Repository | Description |
|---|---|
| chatpack | Core library (this repo) |
| chatpack-cli | Command-line tool |
| chatpack-web | Web interface (WASM) |
| chatpack-python | Python wrapper |