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
Parameters¶
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
ZeroMQ endpoint of MaruServer |
|
|
|
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 |
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). |
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 |
|
|
|
CXL memory pool size ( |
|
|
|
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.
LMCache Configuration¶
For LMCache YAML configuration (plugin settings, extra_config parameters), see LMCache.