Configuration#
MaruConfig#
Client-side configuration dataclass.
from maru import MaruConfig
@dataclass
class MaruConfig:
server_url: str = "tcp://localhost:5555"
instance_id: str | None = None
pool_size: int = 104_857_600 # 100MB
chunk_size_bytes: int = 1_048_576 # 1MB
auto_connect: bool = True
timeout_ms: int = 2000
use_async_rpc: bool = True
max_inflight: int = 64
eager_map: bool = True
storage_backend: str = "cxl" # "cpu", "cxl", "mixed" or "remote_cxl"
engine_id: str | None = None
cache_namespace: str | None = None
rdma_device: str = ""
rdma_staging_size: int | None = None
rdma_timeout_s: float = 30.0
rdma_load_reserve: float = 0.0
remote_cxl_agent_key_file: str = "~/.maru/remote-cxl-agent.key"
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
ZeroMQ endpoint of MaruServer. With |
|
|
|
Unique client identifier |
|
|
|
Initial memory pool size to request (bytes) |
|
|
|
Page size for paged allocation (bytes) |
|
|
|
Connect automatically on |
|
|
|
RPC socket timeout in milliseconds |
|
|
|
Use async DEALER-ROUTER RPC client |
|
|
|
Max concurrent in-flight async RPC requests |
|
|
|
Pre-map all shared regions on connect (can be overridden by |
|
|
|
Where KV lives: |
|
|
|
Engine identity of a storage session; required for |
|
|
|
Namespace whose keys a storage session shares; required for |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples#
Default configuration:
config = MaruConfig()
with MaruHandler(config) as handler:
...
Custom configuration:
config = MaruConfig(
server_url="tcp://10.0.0.1:5555",
instance_id="worker-0",
pool_size=1024 * 1024 * 1024, # 1GB
chunk_size_bytes=2 * 1024 * 1024, # 2MB pages
timeout_ms=5000,
)
Synchronous RPC (for debugging):
config = MaruConfig(
use_async_rpc=False,
timeout_ms=10000,
)
MaruServer Configuration#
The MaruServer is configured via CLI arguments.
maru-server [OPTIONS]
Option |
Default |
Description |
|---|---|---|
|
|
Bind address |
|
|
Bind port |
|
|
Logging level (DEBUG, INFO, WARNING, ERROR) |
|
any pool |
DAX device path for allocation. Repeat for multiple pools (fill-first fallback). |
|
none |
Remote CXL agent ( |
|
|
Copy of the remote CXL agent key; read when |
Examples#
# Default (any available pool)
maru-server
# Pin to a specific DAX device
maru-server --dax-path /dev/dax0.0
# Multiple pools (fill-first fallback)
maru-server --dax-path /dev/dax0.0 --dax-path /dev/dax1.0
# Production
maru-server --host 0.0.0.0 --port 5555 --log-level WARNING
# Debug
maru-server --host 127.0.0.1 --port 5556 --log-level DEBUG
vLLM KV Connector Configuration#
When using MaruKVConnector with vLLM, configuration is passed via kv_connector_extra_config in the --kv-transfer-config JSON:
vllm serve <model> --kv-transfer-config '{
"kv_connector": "MaruKVConnector",
"kv_connector_module_path": "maru_vllm",
"kv_role": "kv_both",
"kv_connector_extra_config": {
"maru_server_url": "tcp://localhost:5555",
"maru_pool_size": "4G"
}
}'
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
MaruServer address. With |
|
|
|
CXL memory an engine gets at a time ( |
|
|
|
Maru page size (CXL allocation unit) |
|
|
auto-generated UUID |
Unique client instance identifier |
|
|
|
Pre-map other instances’ CXL regions on connect |
|
|
|
KV cache chunk granularity (in tokens). Auto-aligned to vLLM |
For full architecture and data path details, see vLLM.
Remote CXL (maru_storage_backend: "remote_cxl")#
Engines on nodes without CXL keep KV in the CXL memory of memory nodes and move it over RDMA (see the vLLM guide). These settings apply to that backend only:
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
|
|
|
required |
Names the engine’s storage session; unique among the engines of one maru-server |
|
|
required |
Sharing scope: engines with the same namespace and model shape share KV, whichever path they load the weights from |
|
|
required |
CXL memory the engine gets at a time, as with |
|
|
|
Copy of the memory nodes’ remote CXL agent key, readable only by the engine’s user |
|
|
UCX default |
The engine’s RDMA NIC, e.g. |
|
|
two |
Host staging buffer registered with the NIC and CUDA |
|
|
|
Deadline of one RDMA batch |
Remote CXL agent (maru-remote-cxl-agent)#
One per memory node, installed as maru-remote-cxl-agent.service with NIXL. An
option with an environment variable in parentheses also takes its value from
it, and the service reads these variables from /etc/maru/remote-cxl-agent.env.
Option |
Default |
Description |
|---|---|---|
|
|
Resource manager of the pool |
|
UCX default |
RDMA NIC to register regions with, e.g. |
|
|
Bind address; empty means the address of the |
|
|
Bind port |
|
|
Key every connection must prove; the installer creates it |
|
hostname |
Name of the memory node; names the default lock file |
|
|
Keeps one remote CXL agent per node |
|
off |
Accept UCX transports that do not check remote keys (tests on one host only) |
|
|
Logging level (DEBUG, INFO, WARNING, ERROR) |
LMCache Configuration#
For LMCache YAML configuration (plugin settings, extra_config parameters), see LMCache.