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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pegaflow_llm-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pegaflow_llm-0.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c838db9ed69cc554233662477469872f779a7e408f77b983cdef76f9cabe16b9
|
|
| MD5 |
3d1c8332741f9f95fd7d4fa2d26c416b
|
|
| BLAKE2b-256 |
f3e44713bb1c68af781ce20f5020e32b62f3a076e815224859bcb95a213eb327
|
File details
Details for the file pegaflow_llm-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pegaflow_llm-0.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7d52d95b7d20853e97401381d87ec0e8ef5f69b12c26b4a26678cc0c14fc9db
|
|
| MD5 |
5ed10b42dae297a165190439632d4d4b
|
|
| BLAKE2b-256 |
4ed84d4f2a64a9d16c4f4fe8b03f00a8784acde5f6abe69ef7f90baeabbb836b
|
File details
Details for the file pegaflow_llm-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pegaflow_llm-0.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f1e2cd1e5da30a78ea6c7913340657c1e500bbbc39e3d602a33ab1ac9e7c622
|
|
| MD5 |
285c1f5f2c6e3ea553815677480c876f
|
|
| BLAKE2b-256 |
97eeea9ae33d339db8c10c333ceaade14a370035752f80d2f1b2228984984006
|