vedic-bpe
Lossless LLM token reducer for repetitive structured JSON. Zero dependencies. Bit-exact round-trip (types preserved). 0% token-inflation guarantee.
Named after classical Indian mathematics (branding); the transforms are standard
and measured against real tiktoken (o200k_base) — not claimed.
| transform | classical name | what it does |
|---|---|---|
| key-folding + row inheritance | Anuvritti (Panini, Ashtadhyayi) | repeated object keys → one header; a cell equal to the one above → . |
| base-anchor delta coding | Nikhilam / Brahmagupta (finite differences) | string ID columns SUP-101, SUP-102 → base SUP-100 + delta 1, 2 |
Measured results (real tiktoken o200k_base, lossless verified)
| input | before | after | saved |
|---|---|---|---|
| 20 highly-repetitive sensor rows | 782 tok | 138 tok | 82% |
| 20 varied rows | 742 tok | 269 tok | 64% |
| 4-row support tickets | 138 tok | 48 tok | 65% |
Savings scale with redundancy (Shannon limit: a token holds ≤ log₂(V) ≈ 17.6 bits, so arbitrary text can't be squeezed — only redundant structured data can).
Usage
from vedic_bpe import pack, unpack
packed = pack(json_text) # send `packed` to the LLM (still human/LLM-readable)
original = unpack(packed) # bit-exact recovery
Honest scope — what this is NOT
- Not a compressor for arbitrary prose (information theory forbids it).
- Works on arrays of flat JSON objects with shared keys and scalar values
(support tickets, RAG metadata rows, API/sensor logs). Values must not contain
|or newline. - Output stays readable so the model can still reason over it — unlike bit-packing into opaque glyphs (which saves tokens but the model can't understand).
pack()never inflates: if it can't shrink the real token count, it returns the input untouched.
MIT © Aman Bhawsar
Metadata
Release files for vedic-bpe 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vedic_bpe-0.1.0.tar.gz | 4.9 kB | Without provenance | Details for vedic_bpe-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vedic_bpe-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vedic_bpe-0.1.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / vedic_bpe-0.1.0.tar.gz
| Download URL | vedic_bpe-0.1.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
149424ec490c965048ae28bed27d033b61ffea1a5cc1ac6df4bab0af73b3ea42
|
|
BLAKE2b-256 checksum How to use checksums |
19da5b70a46c1268a943297d79f1c3c465f783c14e7c339d24236bf978ce972a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / vedic_bpe-0.1.0-py3-none-any.whl
| Download URL | vedic_bpe-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2aaafbe513bafee544ae31e55d741709976d696b9a1321a8f1f040b47d84e188
|
|
BLAKE2b-256 checksum How to use checksums |
da996f8b63e7cff0e0ea9c73390024cd0405c32615535d791ab407ee682bef95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for vedic-bpe 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.