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.3-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.3-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.3-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.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pegaflow_llm-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c838db9ed69cc554233662477469872f779a7e408f77b983cdef76f9cabe16b9
MD5 3d1c8332741f9f95fd7d4fa2d26c416b
BLAKE2b-256 f3e44713bb1c68af781ce20f5020e32b62f3a076e815224859bcb95a213eb327

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pegaflow_llm-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d7d52d95b7d20853e97401381d87ec0e8ef5f69b12c26b4a26678cc0c14fc9db
MD5 5ed10b42dae297a165190439632d4d4b
BLAKE2b-256 4ed84d4f2a64a9d16c4f4fe8b03f00a8784acde5f6abe69ef7f90baeabbb836b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pegaflow_llm-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7f1e2cd1e5da30a78ea6c7913340657c1e500bbbc39e3d602a33ab1ac9e7c622
MD5 285c1f5f2c6e3ea553815677480c876f
BLAKE2b-256 97eeea9ae33d339db8c10c333ceaade14a370035752f80d2f1b2228984984006

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