Token-saving abbreviation compressor for OpenAI LLM prompts
Project description
abbrcompress
Token-saving abbreviation compression for OpenAI LLM prompts.
Install
pip install abbrcompress
uv pip install abbrcompress
## Usage
from abbrcompress import AbbrCompressor
compressor = AbbrCompressor()
abbrs, _ = compressor.build_abbreviations(text)
compressed = compressor.compress_prompt(text)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
abbrcompress-0.1.1.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abbrcompress-0.1.1.tar.gz.
File metadata
- Download URL: abbrcompress-0.1.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f099cfc27196f078706598abe54ee9733d987919c6f664fffbafcca8e03b4ddc
|
|
| MD5 |
37adae30bdaddf91f311d08e12841c79
|
|
| BLAKE2b-256 |
2f49bc6b64ea1c5b2df8c59c5cdd6b20181e113b0b93c9bd272d0caa46573dc6
|
File details
Details for the file abbrcompress-0.1.1-py3-none-any.whl.
File metadata
- Download URL: abbrcompress-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12a0be33d1fd29894e4caa801ceb2773cf19b36788ec0fad0037e3b9034695d8
|
|
| MD5 |
ffc8248f0b25b1809e6d44f6bed67188
|
|
| BLAKE2b-256 |
1279d7cfa794215cd1422dfb67be58dafec3aebf2bc8d4e01a8a4319796b7a19
|