lmvalkey

lmvalkey is a single-executable Valkey key-value server combining the native RESP protocol engine, an integrated HTTP REST API, and an embedded LMScript bytecode host. It serves unified in-memory data over RESP and JSON REST endpoints while running pipelined _lmcode_ batches and standard lmcode_std_v3 routes.

Quick reference

npm install -g @lmctl-ai/lmctl@latest
lmvalkey --version
lmvalkey --lmcode-schema --json
lmvalkey --lmcode-signatures
Interface or flagSignature or syntaxPurpose
Server RESP + RESTlmvalkey --port 6379 --rest-port 8080 [--daemonize yes]Start the unified Valkey RESP server and zero-auth HTTP JSON REST listener.
CLI host bytecodelmvalkey --lmcode prog.dslbExecute compiled LMScript bytecode against a live Valkey server or the built-in in-memory store.
CLI schema and signatureslmvalkey --lmcode-schema [--json] | --lmcode-signaturesPrint embedded schema JSON bytes or all 245 canonical signatures (19 host + 226 standard library).
HTTP REST endpointsGET /ping | GET /get/<k> | POST /set/<k> | GET /keys[/<pat>] | POST /cmdRead, write, query, or run arbitrary Valkey commands over HTTP returning {"ok":true,"result":...}.
context valkey: Valkeyvalkey.set(k, v) -> bool | valkey.get(k) -> string | valkey.del(k) -> int | valkey.exists(k) -> boolExecute typed key-value operations from _lmcode_ blocks against VALKEY_HOST:VALKEY_PORT or fallback memory.
Valkey.cmdvalkey.cmd(c) | valkey.cmd(c, a1) | valkey.cmd(c, a1, a2) -> stringRun arbitrary Valkey commands (such as PING, INCR, HGETALL, INFO) with up to two arguments.
Batch pipelinelet b = valkey.batch(); b.set(k, v).get(k).exec() -> stringQueue multiple commands and execute them in a single pipelined RESP round-trip returning a JSON array string.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ cli="lmvalkey" install="github:lmctl-ai/lmvalkey@latest";
assert_eq(valkey.set("user:100", "Alice"), true);
assert_eq(valkey.get("user:100"), "Alice");

let b = valkey.batch();
b.set("item:1", "Apples").set("item:2", "Oranges").get("item:1").get("item:2");
assert_eq(b.exec(), "[\"OK\",\"OK\",\"Apples\",\"Oranges\"]");

@"/kv/:key"
fn get_kv(x: RestExchange) -> void implements RestGet {
  x.json("{\"key\":\"" + x.param("key") + "\",\"val\":\"" + valkey.get(x.param("key")) + "\"}");
}
assert_eq(rest_cli(str_split("/kv/user:100", " ")), "{\"key\":\"user:100\",\"val\":\"Alice\"}");
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));

Documentation pages

Source repository and releases