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.2-cp312-cp312-manylinux_2_34_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pegaflow_llm-0.0.2-cp311-cp311-manylinux_2_34_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pegaflow_llm-0.0.2-cp310-cp310-manylinux_2_34_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for pegaflow_llm-0.0.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c24ce0524d7ae054c0d7b5b5e2633563cfddccb9495896e30cf81b86cd97fd5a
MD5 971b256077a3df7746576274c6b930ab
BLAKE2b-256 cb40999580edf72ee859a09b0b38a27a72b49a7df522186766170b012ba98ff8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pegaflow_llm-0.0.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 533cca15c87d671134860ecabd1d15d72c935130e8f3221bc822e0e513914c36
MD5 27d335a0c641519d8acfebc4d8bfbd3f
BLAKE2b-256 1c212bc268c657c3e2a9ea5b4c676f70c7f3e134b71f346cf02abb0c2799ca30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pegaflow_llm-0.0.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 790a4b75420f5c65494ad7e027850da3cbb27782a743394e0e5b98efdb33eec8
MD5 09ae959e33c9b4fb3d7dd8ae7c08d58b
BLAKE2b-256 50245d962a77cf80942803c3eede6b3e6e1c402a500f7dba8d42105ae845456e

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