Catalog PyPI
Back to packageRELEASE DETAILS

0.1.5

PyPI

adaptive-pipeline

An adaptive Pipeline Cache composed of FIFO and upgraded TinyLFU with cost-awareness

adaptivecachecppfifolfulruperformancepipeline
Published14 Nov 2025
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.1.5 documentation

Adaptive Pipeline Cache

A high-performance adaptive caching system implemented in C++ with Python bindings. The cache dynamically adjusts its internal structure based on workload characteristics, combining FIFO, Approximate LRU (ALRU), and Cost-Aware LFU strategies.

Features

  • Adaptive Architecture: Automatically adjusts cache structure based on workload patterns
  • Multiple Eviction Policies: Combines FIFO, ALRU, and Cost-Aware LFU in a pipeline
  • High Performance: Implemented in C++20 with efficient memory management
  • Python Integration: Clean Python API via pybind11
  • Cost-Aware: Takes into account both latency and token costs for eviction decisions

Installation

pip install adaptive-pipeline

Building from Source

Requirements:

  • C++20 compatible compiler
  • CMake >= 3.15
  • Python >= 3.7
  • pybind11 >= 2.6.0
git clone <repository-url>
cd pipeline-cache
pip install -e .

Usage

Notice that for this version, the size of the cache is hard-coded to be 1024, and it ignores the size parameter.

from adaptive_pipeline import AdaptivePipelineCache

# Create a cache with capacity of 1024 items
cache = AdaptivePipelineCache(1024)

# Store items with (latency, tokens) tuple
cache[key] = (latency, tokens)

# Check if key exists
if key in cache:
    latency, tokens = cache[key]

# Get cache statistics
print(f"Current size: {cache.currsize}")
print(f"Max size: {cache.maxsize}")

How It Works

The Adaptive Pipeline Cache uses a novel approach that:

  1. Pipeline Structure: Divides the cache into three blocks (FIFO, ALRU, Cost-Aware LFU)
  2. Dynamic Adaptation: Periodically evaluates alternative configurations using "ghost caches"
  3. Quantum-Based Resizing: Moves chunks of items between blocks based on performance metrics
  4. Cost-Aware Eviction: Considers both access frequency and cost (latency × tokens) for eviction decisions

The cache automatically adapts its configuration every 10,240 operations (configurable) by comparing the performance of the current configuration against alternative configurations simulated by ghost caches.

Interface Compatibility

The implementation follows the interface of cacheutils for compatibility with GPT-Cache experiments.

License

MIT License - see LICENSE file for details

Author

Nadav Keren (nadavker@pm.me)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pybind11
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pybind11>=2.6.0runtime

Distribution files

25 collected
adaptive_pipeline-0.1.5-cp310-cp310-macosx_10_15_x86_64.whl

bdist_wheel · 162.52 KB · Python cp310

Source file
adaptive_pipeline-0.1.5-cp310-cp310-macosx_11_0_arm64.whl

bdist_wheel · 143.25 KB · Python cp310

Source file
adaptive_pipeline-0.1.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 180.63 KB · Python cp310

Source file
adaptive_pipeline-0.1.5-cp310-cp310-win_amd64.whl

bdist_wheel · 148.5 KB · Python cp310

Source file
adaptive_pipeline-0.1.5-cp311-cp311-macosx_10_15_x86_64.whl

bdist_wheel · 164.08 KB · Python cp311

Source file
adaptive_pipeline-0.1.5-cp311-cp311-macosx_11_0_arm64.whl

bdist_wheel · 144.7 KB · Python cp311

Source file
adaptive_pipeline-0.1.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 182.13 KB · Python cp311

Source file
adaptive_pipeline-0.1.5-cp311-cp311-win_amd64.whl

bdist_wheel · 149.11 KB · Python cp311

Source file
adaptive_pipeline-0.1.5-cp312-cp312-macosx_10_15_x86_64.whl

bdist_wheel · 165.52 KB · Python cp312

Source file
adaptive_pipeline-0.1.5-cp312-cp312-macosx_11_0_arm64.whl

bdist_wheel · 145.52 KB · Python cp312

Source file
adaptive_pipeline-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 182.11 KB · Python cp312

Source file
adaptive_pipeline-0.1.5-cp312-cp312-win_amd64.whl

bdist_wheel · 150.3 KB · Python cp312

Source file
adaptive_pipeline-0.1.5-cp313-cp313-macosx_10_15_x86_64.whl

bdist_wheel · 165.53 KB · Python cp313

Source file
adaptive_pipeline-0.1.5-cp313-cp313-macosx_11_0_arm64.whl

bdist_wheel · 145.63 KB · Python cp313

Source file
adaptive_pipeline-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 181.92 KB · Python cp313

Source file
adaptive_pipeline-0.1.5-cp313-cp313-win_amd64.whl

bdist_wheel · 150.28 KB · Python cp313

Source file
adaptive_pipeline-0.1.5-cp38-cp38-macosx_10_15_x86_64.whl

bdist_wheel · 162.43 KB · Python cp38

Source file
adaptive_pipeline-0.1.5-cp38-cp38-macosx_11_0_arm64.whl

bdist_wheel · 143.13 KB · Python cp38

Source file
adaptive_pipeline-0.1.5-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 180.61 KB · Python cp38

Source file
adaptive_pipeline-0.1.5-cp38-cp38-win_amd64.whl

bdist_wheel · 148.34 KB · Python cp38

Source file
adaptive_pipeline-0.1.5-cp39-cp39-macosx_10_15_x86_64.whl

bdist_wheel · 162.61 KB · Python cp39

Source file
adaptive_pipeline-0.1.5-cp39-cp39-macosx_11_0_arm64.whl

bdist_wheel · 143.3 KB · Python cp39

Source file
adaptive_pipeline-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

bdist_wheel · 181.06 KB · Python cp39

Source file
adaptive_pipeline-0.1.5-cp39-cp39-win_amd64.whl

bdist_wheel · 150.5 KB · Python cp39

Source file
adaptive_pipeline-0.1.5.tar.gz

sdist · 21.73 KB · Python source

Source file

Repository

PENDING
nadavkeren/python-adaptive-pipeline-cache

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:dd2429d6db899e32346a5c58ec166a1795b5b1dec7f4c4e217fad67afbdaf5b5

Other collected versions

View all collected versions →