Skip to main content

High-performance key-value storage engine with Python bindings

Project description

PegaFlow Python Package

High-performance key-value storage engine with Python bindings, built with Rust and PyO3.

Features

  • PegaEngine: Fast Rust-based key-value storage with Python bindings
  • PegaKVConnector: vLLM KV connector for distributed inference with KV cache transfer

Installation

From Source

# Install maturin if you haven't already
pip install maturin

# Build and install in development mode
cd python
maturin develop

# Or build a wheel
maturin build --release

From PyPI (coming soon)

pip install pegaflow

Usage

Basic KV Storage

from pegaflow import PegaEngine

# Create a new engine
engine = PegaEngine()

# Store key-value pairs
engine.put("name", "PegaFlow")
engine.put("version", "0.1.0")

# Retrieve values
name = engine.get("name")  # Returns "PegaFlow"
missing = engine.get("nonexistent")  # Returns None

# Remove keys
removed = engine.remove("name")  # Returns "PegaFlow"

vLLM KV Connector

from vllm import LLM
from vllm.distributed.kv_transfer.kv_transfer_agent import KVTransferConfig

# Configure vLLM to use PegaKVConnector
kv_transfer_config = KVTransferConfig(
    kv_connector="PegaKVConnector",
    kv_role="kv_both",
    kv_connector_module_path="pegaflow.connector",
)

# Create LLM with KV transfer enabled
llm = LLM(
    model="gpt2",
    kv_transfer_config=kv_transfer_config,
)

Development

See the examples directory for more usage examples.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pegaflow_llm-0.0.4-cp312-cp312-manylinux_2_34_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pegaflow_llm-0.0.4-cp311-cp311-manylinux_2_34_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pegaflow_llm-0.0.4-cp310-cp310-manylinux_2_34_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file pegaflow_llm-0.0.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pegaflow_llm-0.0.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca944bbe7bbd3f4dfd2d46dfd4fade342e3857e27823a937a349930da28b4fe5
MD5 75e43081cc62a44b7296ffe66ccf413c
BLAKE2b-256 5af9a230fc8bdfa9af5675226f21009735ec030d798cc6d08aa549f5123da0a2

See more details on using hashes here.

File details

Details for the file pegaflow_llm-0.0.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pegaflow_llm-0.0.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0630298ac1c15b9eca223a8796ccb10f64eabdbff0bf8b71c3da13994b42a3c6
MD5 5e9b8916b1dbba44155236c866641771
BLAKE2b-256 de5529e5d3b166bf1d92af9c02aedb7500f94a025784651ccc4da536dab10929

See more details on using hashes here.

File details

Details for the file pegaflow_llm-0.0.4-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pegaflow_llm-0.0.4-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 43d7d3718bc710b7e1963d9a5b35a945e1c0eb3c7dbd6ff21a7f48803702bdf1
MD5 b06d2905bd810bb207a621a552716a2d
BLAKE2b-256 55ca4ec72abed0a2eb3118218f371d8bb2c989e24f956624e27aca3fab23cf51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page