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) |
Examples¶
# Default
maru-server
# 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
LMCache Configuration¶
For LMCache YAML configuration (plugin settings, extra_config parameters), see LMCache Integration.