lopace 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lopace/__init__.py +5 -1
- lopace/_version.py +34 -0
- {lopace-0.1.3.dist-info → lopace-0.1.5.dist-info}/METADATA +37 -12
- lopace-0.1.5.dist-info/RECORD +14 -0
- {lopace-0.1.3.dist-info → lopace-0.1.5.dist-info}/WHEEL +1 -1
- scripts/README.md +81 -0
- scripts/requirements.txt +5 -0
- lopace-0.1.3.dist-info/RECORD +0 -11
- {lopace-0.1.3.dist-info → lopace-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {lopace-0.1.3.dist-info → lopace-0.1.5.dist-info}/top_level.txt +0 -0
lopace/__init__.py
CHANGED
|
@@ -7,5 +7,9 @@ using multiple techniques: Zstd, Token-based (BPE), and Hybrid methods.
|
|
|
7
7
|
|
|
8
8
|
from .compressor import PromptCompressor, CompressionMethod
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
try:
|
|
11
|
+
from ._version import version as __version__
|
|
12
|
+
except ImportError:
|
|
13
|
+
__version__ = "0.0.0.dev0+unknown"
|
|
14
|
+
|
|
11
15
|
__all__ = ["PromptCompressor", "CompressionMethod"]
|
lopace/_version.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '0.1.5'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 5)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lopace
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: Lossless Optimized Prompt Accurate Compression Engine
|
|
5
5
|
Home-page: https://github.com/connectaman/LoPace
|
|
6
6
|
Author: Aman Ulla
|
|
@@ -34,7 +34,7 @@ Dynamic: requires-python
|
|
|
34
34
|
# LoPace
|
|
35
35
|
|
|
36
36
|
<div align="center">
|
|
37
|
-
<img src="screenshots/logo-text.png" alt="LoPace Logo" width="600"/>
|
|
37
|
+
<img src="https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/logo-text.png" alt="LoPace Logo" width="600"/>
|
|
38
38
|
</div>
|
|
39
39
|
|
|
40
40
|
**Lossless Optimized Prompt Accurate Compression Engine**
|
|
@@ -45,6 +45,14 @@ A professional, open-source Python package for compressing and decompressing pro
|
|
|
45
45
|
[](https://www.python.org/downloads/)
|
|
46
46
|
[](https://pypi.org/project/lopace/)
|
|
47
47
|
[](https://huggingface.co/spaces/codewithaman/LoPace)
|
|
48
|
+
[](https://raw.githubusercontent.com/connectaman/LoPace/main/paper/lopace-preprint-arxiv.pdf)
|
|
49
|
+
|
|
50
|
+
<div align="center">
|
|
51
|
+
<a href="https://raw.githubusercontent.com/connectaman/LoPace/main/paper/lopace-preprint-arxiv.pdf">
|
|
52
|
+
<img src="https://raw.githubusercontent.com/connectaman/LoPace/main/paper/lopace-preprint-arxiv-01.png" alt="LoPace Research Paper - First Page" width="250" style="cursor: pointer; border: 1px solid #ddd; border-radius: 4px;">
|
|
53
|
+
</a>
|
|
54
|
+
<p><em>Click the image above to view the full research paper (PDF)</em></p>
|
|
55
|
+
</div>
|
|
48
56
|
|
|
49
57
|
## The Problem: Storage Challenges with Large Prompts
|
|
50
58
|
|
|
@@ -263,7 +271,7 @@ Enumeration of available compression methods:
|
|
|
263
271
|
|
|
264
272
|
### Compression Pipeline (Hybrid Method)
|
|
265
273
|
|
|
266
|
-

|
|
274
|
+

|
|
267
275
|
|
|
268
276
|
### Why Hybrid is Best for Databases
|
|
269
277
|
|
|
@@ -287,7 +295,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
287
295
|
|
|
288
296
|
### Compression Ratio Analysis
|
|
289
297
|
|
|
290
|
-

|
|
298
|
+

|
|
291
299
|
|
|
292
300
|
**Key Insights:**
|
|
293
301
|
- **Hybrid method consistently achieves the highest compression ratios** across all prompt sizes
|
|
@@ -297,7 +305,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
297
305
|
|
|
298
306
|
### Space Savings Performance
|
|
299
307
|
|
|
300
|
-

|
|
308
|
+

|
|
301
309
|
|
|
302
310
|
**Key Insights:**
|
|
303
311
|
- **Hybrid method achieves 70-80% space savings** on average across all prompt categories
|
|
@@ -307,7 +315,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
307
315
|
|
|
308
316
|
### Disk Size Comparison
|
|
309
317
|
|
|
310
|
-

|
|
318
|
+

|
|
311
319
|
|
|
312
320
|
**Key Insights:**
|
|
313
321
|
- **Dramatic reduction in storage requirements** - compressed data is 3-6x smaller than original
|
|
@@ -317,8 +325,8 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
317
325
|
|
|
318
326
|
### Speed & Throughput Metrics
|
|
319
327
|
|
|
320
|
-

|
|
321
|
-

|
|
328
|
+

|
|
329
|
+

|
|
322
330
|
|
|
323
331
|
**Key Insights:**
|
|
324
332
|
- **Compression speeds range from 50-200 MB/s** depending on method and prompt size
|
|
@@ -328,7 +336,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
328
336
|
|
|
329
337
|
### Memory Usage Analysis
|
|
330
338
|
|
|
331
|
-

|
|
339
|
+

|
|
332
340
|
|
|
333
341
|
**Key Insights:**
|
|
334
342
|
- **Memory footprint is minimal** - typically under 10 MB even for large prompts
|
|
@@ -338,7 +346,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
338
346
|
|
|
339
347
|
### Comprehensive Method Comparison
|
|
340
348
|
|
|
341
|
-

|
|
349
|
+

|
|
342
350
|
|
|
343
351
|
**Key Insights:**
|
|
344
352
|
- **Heatmaps provide at-a-glance comparison** of all metrics across methods and prompt sizes
|
|
@@ -348,7 +356,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
|
|
|
348
356
|
|
|
349
357
|
### Scalability Analysis
|
|
350
358
|
|
|
351
|
-

|
|
359
|
+

|
|
352
360
|
|
|
353
361
|
**Key Insights:**
|
|
354
362
|
- **Performance scales efficiently** with prompt size across all metrics
|
|
@@ -418,6 +426,23 @@ cd lopace
|
|
|
418
426
|
pip install -r requirements-dev.txt
|
|
419
427
|
```
|
|
420
428
|
|
|
429
|
+
### Versioning & Releasing
|
|
430
|
+
|
|
431
|
+
LoPace uses [setuptools-scm](https://github.com/pypa/setuptools_scm) so the package version is **derived from Git tags** — no manual edits to `setup.py` or `pyproject.toml` are needed.
|
|
432
|
+
|
|
433
|
+
**To release a new version:**
|
|
434
|
+
|
|
435
|
+
1. Bump the version by creating and pushing a tag (e.g. `v0.1.5`):
|
|
436
|
+
```bash
|
|
437
|
+
git tag v0.1.5
|
|
438
|
+
git push origin v0.1.5
|
|
439
|
+
```
|
|
440
|
+
2. CI builds the package with that version and publishes to PyPI.
|
|
441
|
+
|
|
442
|
+
The version in `lopace.__version__` (and the built distribution) comes from the latest tag. Without a tag, you get a dev version like `0.1.5.dev3+gabc1234`.
|
|
443
|
+
|
|
444
|
+
**Will the next push to `main` build 0.1.4?** No. If the latest tag is `v0.1.4` and you push new commits to `main` without a new tag, setuptools-scm produces a **development version** (e.g. `0.1.5.dev3`), not `0.1.4`. To release `0.1.5`, create and push the tag `v0.1.5`; CI will then build and publish that version to PyPI.
|
|
445
|
+
|
|
421
446
|
### Running Tests
|
|
422
447
|
|
|
423
448
|
```bash
|
|
@@ -441,7 +466,7 @@ See [.github/workflows/README.md](.github/workflows/README.md) for detailed setu
|
|
|
441
466
|
|
|
442
467
|
LoPace uses the following compression techniques:
|
|
443
468
|
|
|
444
|
-

|
|
469
|
+

|
|
445
470
|
|
|
446
471
|
1. **LZ77 (Sliding Window)**: Used **indirectly** through Zstandard
|
|
447
472
|
- Zstandard internally uses LZ77-style algorithms to find repeated patterns
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
lopace/__init__.py,sha256=1X75FQdnzJaDueL_xRGTBn3vvIAXR1T_siSA_mW391E,443
|
|
2
|
+
lopace/_version.py,sha256=rdxBMYpwzYxiWk08QbPLHSAxHoDfeKWwyaJIAM0lSic,704
|
|
3
|
+
lopace/compressor.py,sha256=nUTWDcAPYvQaeSFKx_lne-D2xIQ02IMVGE4yLODo8qE,19060
|
|
4
|
+
lopace-0.1.5.dist-info/licenses/LICENSE,sha256=uFUrlsfsOwx_8Nzhq2pUgNaJghcJxXBMML3l7T39Tm0,1067
|
|
5
|
+
scripts/README.md,sha256=UEsrHKKfiEixTMtWV8trYBKnzgkImJxxEnXTyDI4r9g,2226
|
|
6
|
+
scripts/__init__.py,sha256=XLq0VmLoEBfnWjzYmxb_JRzAIqwZDv-2s10TO692TLc,59
|
|
7
|
+
scripts/generate_visualizations.py,sha256=AJm2DNs-tiwdTHLivEQL9QkztmCclgGT1u4ds5QY4BQ,41812
|
|
8
|
+
scripts/requirements.txt,sha256=EvUUoksfGtvbA45zkCG8to1EaPzWv1eurCONAp8Pdx4,112
|
|
9
|
+
tests/__init__.py,sha256=yXNVJE20E2iHo0qbit5SgRE35eXWq89F1kkhNHy7VJA,31
|
|
10
|
+
tests/test_compressor.py,sha256=-vMztSzY89n5dpShcACrFboEQOlfJ6FxF7eQOEU3swM,8273
|
|
11
|
+
lopace-0.1.5.dist-info/METADATA,sha256=EdbjSZ4ACBxpJ7fLhWjHcAwl1Zf0brjsVtKCs5DtwaI,20780
|
|
12
|
+
lopace-0.1.5.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
13
|
+
lopace-0.1.5.dist-info/top_level.txt,sha256=k-gL-51ulMq50vhNS91c1eyGRNse0vs_PzS9VdAiYlw,21
|
|
14
|
+
lopace-0.1.5.dist-info/RECORD,,
|
scripts/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Visualization Scripts
|
|
2
|
+
|
|
3
|
+
This directory contains scripts for generating publication-quality visualizations of LoPace compression metrics.
|
|
4
|
+
|
|
5
|
+
## generate_visualizations.py
|
|
6
|
+
|
|
7
|
+
Generates comprehensive SVG visualizations suitable for research papers.
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- Tests all compression methods (Zstd, Token, Hybrid) on 10 prompts
|
|
12
|
+
- Prompts include small, medium, and very large sizes
|
|
13
|
+
- Measures comprehensive metrics:
|
|
14
|
+
- Compression ratio
|
|
15
|
+
- Space savings
|
|
16
|
+
- Disk size (original vs compressed)
|
|
17
|
+
- Compression/decompression speed
|
|
18
|
+
- Memory usage
|
|
19
|
+
- Throughput
|
|
20
|
+
|
|
21
|
+
### Generated Visualizations
|
|
22
|
+
|
|
23
|
+
1. **compression_ratio.svg** - Compression ratio distribution and by prompt size
|
|
24
|
+
2. **space_savings.svg** - Space savings percentages with error bars
|
|
25
|
+
3. **disk_size_comparison.svg** - Original vs compressed disk sizes
|
|
26
|
+
4. **speed_metrics.svg** - Compression/decompression time and throughput
|
|
27
|
+
5. **memory_usage.svg** - Memory usage during compression/decompression
|
|
28
|
+
6. **comprehensive_comparison.svg** - Heatmaps comparing all metrics
|
|
29
|
+
7. **scalability_analysis.svg** - How metrics scale with prompt size
|
|
30
|
+
|
|
31
|
+
### Usage
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Install dependencies
|
|
35
|
+
pip install -r requirements-dev.txt
|
|
36
|
+
|
|
37
|
+
# Run the script
|
|
38
|
+
python scripts/generate_visualizations.py
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Output
|
|
42
|
+
|
|
43
|
+
All visualizations are saved as high-resolution SVG files in the `screenshots/` directory:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
screenshots/
|
|
47
|
+
├── benchmark_data.csv # Raw benchmark data
|
|
48
|
+
├── compression_ratio.svg
|
|
49
|
+
├── space_savings.svg
|
|
50
|
+
├── disk_size_comparison.svg
|
|
51
|
+
├── speed_metrics.svg
|
|
52
|
+
├── memory_usage.svg
|
|
53
|
+
├── comprehensive_comparison.svg
|
|
54
|
+
└── scalability_analysis.svg
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Plot Specifications
|
|
58
|
+
|
|
59
|
+
- **Format**: SVG (vector graphics, scalable)
|
|
60
|
+
- **Resolution**: 300 DPI equivalent
|
|
61
|
+
- **Fonts**: Serif fonts (Times New Roman) for publication quality
|
|
62
|
+
- **Style**: Clean, professional design with legends and labels
|
|
63
|
+
- **Size**: Optimized for paper inclusion (adjustable)
|
|
64
|
+
|
|
65
|
+
### Customization
|
|
66
|
+
|
|
67
|
+
Edit `scripts/generate_visualizations.py` to customize:
|
|
68
|
+
- Number of test prompts
|
|
69
|
+
- Prompt sizes and content
|
|
70
|
+
- Plot colors and styles
|
|
71
|
+
- Output directory
|
|
72
|
+
- Additional metrics
|
|
73
|
+
|
|
74
|
+
### Requirements
|
|
75
|
+
|
|
76
|
+
- Python 3.8+
|
|
77
|
+
- pandas
|
|
78
|
+
- matplotlib
|
|
79
|
+
- seaborn
|
|
80
|
+
- numpy
|
|
81
|
+
- lopace (installed)
|
scripts/requirements.txt
ADDED
lopace-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
lopace/__init__.py,sha256=PYjZWZHhSITNgag9sF0qZ_yXgZaMa3R8_3FuasiH0Nc,351
|
|
2
|
-
lopace/compressor.py,sha256=nUTWDcAPYvQaeSFKx_lne-D2xIQ02IMVGE4yLODo8qE,19060
|
|
3
|
-
lopace-0.1.3.dist-info/licenses/LICENSE,sha256=uFUrlsfsOwx_8Nzhq2pUgNaJghcJxXBMML3l7T39Tm0,1067
|
|
4
|
-
scripts/__init__.py,sha256=XLq0VmLoEBfnWjzYmxb_JRzAIqwZDv-2s10TO692TLc,59
|
|
5
|
-
scripts/generate_visualizations.py,sha256=AJm2DNs-tiwdTHLivEQL9QkztmCclgGT1u4ds5QY4BQ,41812
|
|
6
|
-
tests/__init__.py,sha256=yXNVJE20E2iHo0qbit5SgRE35eXWq89F1kkhNHy7VJA,31
|
|
7
|
-
tests/test_compressor.py,sha256=-vMztSzY89n5dpShcACrFboEQOlfJ6FxF7eQOEU3swM,8273
|
|
8
|
-
lopace-0.1.3.dist-info/METADATA,sha256=YhcHwNH6kR9exmyoITfc3LldbhaSxIdtDKeVZIVON88,18612
|
|
9
|
-
lopace-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
lopace-0.1.3.dist-info/top_level.txt,sha256=k-gL-51ulMq50vhNS91c1eyGRNse0vs_PzS9VdAiYlw,21
|
|
11
|
-
lopace-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|