lopace 0.1.4__py3-none-any.whl → 0.1.6.dev2__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 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
- __version__ = "0.1.0"
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.6.dev2'
32
+ __version_tuple__ = version_tuple = (0, 1, 6, 'dev2')
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.4
3
+ Version: 0.1.6.dev2
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,11 +45,11 @@ A professional, open-source Python package for compressing and decompressing pro
45
45
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
46
46
  [![PyPI version](https://badge.fury.io/py/lopace.svg)](https://pypi.org/project/lopace/)
47
47
  [![🤗 Spaces](https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/codewithaman/LoPace)
48
- [![arXiv](https://img.shields.io/badge/arXiv-Paper-b31b1b.svg)](paper/lopace-preprint-arxiv.pdf)
48
+ [![arXiv](https://img.shields.io/badge/arXiv-Paper-b31b1b.svg)](https://raw.githubusercontent.com/connectaman/LoPace/main/paper/lopace-preprint-arxiv.pdf)
49
49
 
50
50
  <div align="center">
51
- <a href="paper/lopace-preprint-arxiv.pdf">
52
- <img src="paper/lopace-preprint-arxiv-01.png" alt="LoPace Research Paper - First Page" width="600" style="cursor: pointer; border: 1px solid #ddd; border-radius: 4px;">
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
53
  </a>
54
54
  <p><em>Click the image above to view the full research paper (PDF)</em></p>
55
55
  </div>
@@ -271,7 +271,7 @@ Enumeration of available compression methods:
271
271
 
272
272
  ### Compression Pipeline (Hybrid Method)
273
273
 
274
- ![Compression Pipeline](screenshots/compression-pipeline.png)
274
+ ![Compression Pipeline](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/compression-pipeline.png)
275
275
 
276
276
  ### Why Hybrid is Best for Databases
277
277
 
@@ -295,7 +295,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
295
295
 
296
296
  ### Compression Ratio Analysis
297
297
 
298
- ![Compression Ratio](screenshots/compression_ratio.svg)
298
+ ![Compression Ratio](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/compression_ratio.svg)
299
299
 
300
300
  **Key Insights:**
301
301
  - **Hybrid method consistently achieves the highest compression ratios** across all prompt sizes
@@ -305,7 +305,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
305
305
 
306
306
  ### Space Savings Performance
307
307
 
308
- ![Space Savings](screenshots/space_savings.svg)
308
+ ![Space Savings](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/space_savings.svg)
309
309
 
310
310
  **Key Insights:**
311
311
  - **Hybrid method achieves 70-80% space savings** on average across all prompt categories
@@ -315,7 +315,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
315
315
 
316
316
  ### Disk Size Comparison
317
317
 
318
- ![Disk Size Comparison](screenshots/disk_size_comparison.svg)
318
+ ![Disk Size Comparison](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/disk_size_comparison.svg)
319
319
 
320
320
  **Key Insights:**
321
321
  - **Dramatic reduction in storage requirements** - compressed data is 3-6x smaller than original
@@ -325,8 +325,8 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
325
325
 
326
326
  ### Speed & Throughput Metrics
327
327
 
328
- ![Speed Metrics](screenshots/speed_metrics.svg)
329
- ![Speed Metrics](screenshots/original_vs_decompressed.svg)
328
+ ![Speed Metrics](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/speed_metrics.svg)
329
+ ![Speed Metrics](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/original_vs_decompressed.svg)
330
330
 
331
331
  **Key Insights:**
332
332
  - **Compression speeds range from 50-200 MB/s** depending on method and prompt size
@@ -336,7 +336,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
336
336
 
337
337
  ### Memory Usage Analysis
338
338
 
339
- ![Memory Usage](screenshots/memory_usage.svg)
339
+ ![Memory Usage](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/memory_usage.svg)
340
340
 
341
341
  **Key Insights:**
342
342
  - **Memory footprint is minimal** - typically under 10 MB even for large prompts
@@ -346,7 +346,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
346
346
 
347
347
  ### Comprehensive Method Comparison
348
348
 
349
- ![Comprehensive Comparison](screenshots/comprehensive_comparison.svg)
349
+ ![Comprehensive Comparison](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/comprehensive_comparison.svg)
350
350
 
351
351
  **Key Insights:**
352
352
  - **Heatmaps provide at-a-glance comparison** of all metrics across methods and prompt sizes
@@ -356,7 +356,7 @@ Comprehensive benchmarks were conducted on 10 diverse prompts across three size
356
356
 
357
357
  ### Scalability Analysis
358
358
 
359
- ![Scalability Analysis](screenshots/scalability_analysis.svg)
359
+ ![Scalability Analysis](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/scalability_analysis.svg)
360
360
 
361
361
  **Key Insights:**
362
362
  - **Performance scales efficiently** with prompt size across all metrics
@@ -421,11 +421,28 @@ The app features:
421
421
  ### Setup Development Environment
422
422
 
423
423
  ```bash
424
- git clone https://github.com/amanulla/lopace.git
424
+ git clone https://github.com/connectaman/LoPace.git
425
425
  cd lopace
426
426
  pip install -r requirements-dev.txt
427
427
  ```
428
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
+
429
446
  ### Running Tests
430
447
 
431
448
  ```bash
@@ -449,7 +466,7 @@ See [.github/workflows/README.md](.github/workflows/README.md) for detailed setu
449
466
 
450
467
  LoPace uses the following compression techniques:
451
468
 
452
- ![Compression techniques](screenshots/lopace-compression-technique.png)
469
+ ![Compression techniques](https://raw.githubusercontent.com/connectaman/LoPace/main/screenshots/lopace-compression-technique.png)
453
470
 
454
471
  1. **LZ77 (Sliding Window)**: Used **indirectly** through Zstandard
455
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=PLPzXBIkQAXc-mvnIPLNmQqit_i0rmO6w4hdXJlO3xc,717
3
+ lopace/compressor.py,sha256=nUTWDcAPYvQaeSFKx_lne-D2xIQ02IMVGE4yLODo8qE,19060
4
+ lopace-0.1.6.dev2.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.6.dev2.dist-info/METADATA,sha256=3vzfkpgjCojuDUQ-Rq8O8IU18-m7SkdZhuB9TobCQGw,20788
12
+ lopace-0.1.6.dev2.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
13
+ lopace-0.1.6.dev2.dist-info/top_level.txt,sha256=k-gL-51ulMq50vhNS91c1eyGRNse0vs_PzS9VdAiYlw,21
14
+ lopace-0.1.6.dev2.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)
@@ -0,0 +1,5 @@
1
+ # Additional dependencies for visualization script
2
+ pandas>=2.0.0
3
+ matplotlib>=3.7.0
4
+ seaborn>=0.12.0
5
+ numpy>=1.24.0
@@ -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.4.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.4.dist-info/METADATA,sha256=ZmUiZoZWgbqs4jJLSbqumqabjngqjBBQf-RoCLRu22g,19041
9
- lopace-0.1.4.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
10
- lopace-0.1.4.dist-info/top_level.txt,sha256=k-gL-51ulMq50vhNS91c1eyGRNse0vs_PzS9VdAiYlw,21
11
- lopace-0.1.4.dist-info/RECORD,,