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.0.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.0.tar.gz.
File metadata
- Download URL: abbrcompress-0.1.0.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 |
4276d592cfd31b9fb641d4f5b110a3c057b9c3f062ba855bdd4c7519c866675c
|
|
| MD5 |
8ec9dda5216a98c90fbc449e1bfc8b7d
|
|
| BLAKE2b-256 |
ff96eaf50f7f5243b4365219b938caab9897b532c77dd5b883fb4db33449564b
|
File details
Details for the file abbrcompress-0.1.0-py3-none-any.whl.
File metadata
- Download URL: abbrcompress-0.1.0-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 |
363eed5ee428b77c5111c3ce92b86ee3d66e7e987d7a8ac193b9d3f181ea8f06
|
|
| MD5 |
de7fe967d497c905ec8435b18ed1747c
|
|
| BLAKE2b-256 |
1528540de426d2f6b418434217c0d04cb535da43b316e9004dcf15d837b054c8
|