REPLACE; DB 0 only — one database, as Redis with databases 1
MOVE
✅
✅
✅
SLOW
✅
One database, as Redis with databases 1: DB 0 is the source itself, any other index is out of range
OBJECT ENCODING
✅
✅
✅
SLOW
✅
By Redis 8's size rules: int / embstr (≤44 bytes) / raw; a list is listpack while its elements fit 8 KB, else quicklist; hash listpack up to 512 short entries, set intset up to 512 integers or listpack up to 128, sorted set listpack up to 128; stream. Redis also keeps an encoding a value grew into, which Pion does not track (#47)
OBJECT REFCOUNT
✅
✅
✅
SLOW
✅
OBJECT IDLETIME
✅
✅
🟡
SLOW
✅
Under an LRU maxmemory policy, the idle seconds. Otherwise refuses: Pion keeps no per-key access time without one
OBJECT FREQ
✅
✅
✅
SLOW
✅
Under an LFU maxmemory policy, the logarithmic counter. Otherwise refuses, as Redis does. On a missing key every OBJECT subcommand answers nil
SORT
✅
✅
✅
SLOW
✅
Lists, sets and sorted sets; BY/LIMIT/GET/ASC/DESC/ALPHA/STORE
SORT_RO
✅
✅
✅
SLOW
✅
SORT without STORE
SCAN
✅
✅
✅
SLOW
✅
MATCH/COUNT/TYPE; single sweep (cursor 0 returns every key, cursor "0" back)
KEYS
✅
✅
✅
SLOW
✅
O(N), not safe for production use; skips expired keys (#45)
RANDOMKEY
✅
✅
✅
SLOW
✅
A random key, never an expired one (#45; it returned the first key in shard order)
TOUCH
✅
✅
✅
SLOW
✅
DUMP
✅
✅
✅
SLOW
❌
Every type, any size (#41). The payload is Pion's records with Redis's footer (format version + CRC-64): Redis refuses it, and Pion refuses Redis's, each with DUMP payload version or checksum are wrong
RESTORE
✅
✅
✅
SLOW
❌
As Redis: REPLACE, ABSTTL, IDLETIME/FREQ (checked; Pion keeps no LRU/LFU data), the TTL argument, and Redis's errors in Redis's order. Logged, so a restored key survives a restart (#41)
WAIT
✅
✅
✅
SLOW
✅
Counts replicas that reached the offset; parks the client. 0 on a single node
WAITAOF
✅
✅
✅
SLOW
✅
[0, 0] on a single node
Expiry (#45). As in Redis, a key past its deadline is gone for every command, read or write. Each lookup compares the key's deadline with one clock per dispatch batch (Redis's command time snapshot), and removes the key when the deadline has passed. A background sweep removes keys nobody reads (DEBUG SET-ACTIVE-EXPIRE 0 turns it off). Both log the removal as a DEL in the WAL, so a key created again after it expired survives a restart as the new key. On a replica an expired key is hidden, never removed: the primary's DEL removes it, as on a Redis replica. DBSIZE and INFO's key count include expired keys until they are removed, as Redis's do.
Redis's checks against Pion's implementation: the counting kernel against a scalar reference, then the error bound at every power of ten up to 10M elements (#39)
PFDEBUG
✅
✅
✅
SLOW
❌
GETREG returns Pion's 16,384 registers. Pion keeps every HyperLogLog dense: ENCODING is dense, TODENSE is 0, DECODE answers Redis's error for a dense one. The register values differ from Redis's for the same elements (another hash: the HyperLogLog fence) (#39)
Streams and their consumer groups follow Redis 7, compared with Redis 8.10
(#40), and are durable: entries, the stream's metadata, groups, consumers and
pending entries reach the WAL as effect records (23, 27, 34, 38-45), the
snapshot, DUMP payloads, COPY and replicas. A pending list stays fast at work
queue sizes: acknowledging an entry is a binary search, not a shift of every
later one.
Redis 8.2's group-reference handling is implemented too: XDELEX, XACKDEL, and
KEEPREF / DELREF / ACKED on XADD and XTRIM trimming (keep the pending entries
that name a deleted entry, remove them with it, or delete only what no group
still references). Redis 8's later stream additions are not: XREADGROUP CLAIM
(8.4), idempotent XADD with XCFGSET and XIDMPRECORD (8.6), XNACK (8.8), and
XREAD / XREADGROUP MAXCOUNT / MAXSIZE. Each is refused with an error, never
ignored. XINFO STREAM leaves out the fields they report (idmp-*,
pids-tracked, iids-*, nacked-count) and Redis's internal
radix-tree-keys / radix-tree-nodes (Pion keeps no radix tree).
Command
Redis 8
Valkey 8
Pion
Pion path
GLIDE
Notes
XADD
✅
✅
✅
SLOW
✅
*, ms-seq, ms-*; NOMKSTREAM; MAXLEN/MINID with =/~ and LIMIT (~ trims exactly — see below) (#34); KEEPREF / DELREF / ACKED for the trim (#40)
XREAD
✅
✅
✅
SLOW
✅
Only streams with new entries are returned. BLOCK parks the connection until an XADD or the timeout; inside MULTI/EXEC it answers at once
XLEN
✅
✅
✅
SLOW
✅
Real length
XRANGE
✅
✅
✅
SLOW
✅
-/+, ms, exclusive (id; COUNT
XREVRANGE
✅
✅
✅
SLOW
✅
As XRANGE, reversed
XINFO STREAM
✅
✅
✅
SLOW
✅
length, last-generated-id, max-deleted-entry-id, entries-added, recorded-first-entry-id, groups, first/last entry; FULL [COUNT n] with every group, its pending entries and consumers (#40)
XINFO GROUPS
✅
✅
✅
SLOW
✅
Consumers, pending, last-delivered-id, entries-read and lag, by Redis 7's rules (a deletion past a group makes its lag nil) (#40)
XINFO CONSUMERS
✅
✅
✅
SLOW
✅
Pending, idle and inactive, in name order (#40)
XSETID
✅
✅
✅
SLOW
✅
With ENTRIESADDED and MAXDELETEDID (#40)
XDEL
✅
✅
✅
SLOW
✅
Deletes by ID; every ID validated first
XTRIM
✅
✅
✅
SLOW
✅
MAXLEN/MINID with =/~ and LIMIT. With ~ Redis removes only whole internal nodes (a small stream keeps everything); Pion has no nodes and trims exactly — both within the "at least N kept" contract
XGROUP
✅
✅
✅
SLOW
✅
CREATE (MKSTREAM, ENTRIESREAD), SETID (ENTRIESREAD), DESTROY, CREATECONSUMER, DELCONSUMER, HELP (#40)
XREADGROUP
✅
✅
✅
SLOW
✅
> for new entries (COUNT, NOACK), an id for the consumer's history (a deleted entry as [id, nil]); BLOCK parks the connection until an entry arrives for the group, the group or key goes (NOGROUP), the key changes type (WRONGTYPE) or the timeout; inside MULTI/EXEC it answers at once (#40)
XACK
✅
✅
✅
SLOW
✅
Counts the entries it acknowledged (#40)
XCLAIM
✅
✅
✅
SLOW
✅
IDLE, TIME, RETRYCOUNT, FORCE, JUSTID, LASTID; a claimed entry that was deleted leaves the pending list (#40)
XAUTOCLAIM
✅
✅
✅
SLOW
✅
Cursor, COUNT, JUSTID, and the ids of deleted entries it dropped (#40)
XPENDING
✅
✅
✅
SLOW
✅
Summary, and the extended form with IDLE and a consumer filter (#40)
XDELEX
✅ (8.2)
❌
✅
SLOW
—
KEEPREF / DELREF / ACKED; per id 1 deleted, -1 missing, 2 still referenced (#40)
XACKDEL
✅ (8.2)
❌
✅
SLOW
—
Acknowledges in the group, then deletes as XDELEX (#40)
XNACK, XCFGSET, XIDMPRECORD
✅ (8.6+)
❌
❌
—
—
Redis 8 additions, not implemented: unknown command
Delivery goes through each subscriber's output buffer, in RESP2 or as RESP3
pushes, with no cap on channels, patterns or subscribers (#42). A subscriber
that is slow to read keeps what it has not read yet; one more than 32 MB behind
is disconnected, as Redis disconnects one past its pubsub output-buffer limit
(32 MB), so it never receives half a message. A RESP2 connection with subscriptions may run
only the pub/sub commands, PING ([pong, <message>]), QUIT and RESET, as in
Redis. With -w N > 1 (--independent-workers) a message reaches subscribers
on every worker; PUBLISH counts those of its own worker, as a Redis Cluster
node counts its own, and PUBSUB reports its own worker's subscriptions.
Command
Redis 8
Valkey 8
Pion
Pion path
GLIDE
Notes
SUBSCRIBE
✅
✅
✅
SLOW
✅
UNSUBSCRIBE
✅
✅
✅
SLOW
✅
Without arguments, from every channel
PUBLISH
✅
✅
✅
SLOW
✅
Any size; the publisher gets its own message (RESP3) before the reply. Works from a script
PSUBSCRIBE
✅
✅
✅
SLOW
✅
Redis's glob, as KEYS
PUNSUBSCRIBE
✅
✅
✅
SLOW
✅
PUBSUB
✅
✅
✅
SLOW
✅
CHANNELS, NUMSUB, NUMPAT, SHARDCHANNELS, SHARDNUMSUB, HELP
SSUBSCRIBE
✅
✅
✅
SLOW
✅
Shard channels are their own namespace, delivered as smessage, with their own counts
Engine: Lua 5.1.5, statically linked, with Redis's read-only-table patch. Each worker has two states, as Redis has: one for EVAL scripts and one for FUNCTION libraries.
redis.call() runs the server's own commands. Each call goes through the slow-path dispatcher re-entrantly (SlowPathHandler.script_dispatch). Every command and option is therefore available, with the same replies. Every write is logged to the WAL and replicated by the command itself. The checks Redis makes come first:
- an unknown command;
- the arity;
- the noscript commands (MULTI, EVAL, SUBSCRIBE, CLIENT, CONFIG, SAVE, …);
- a write from a read-only script.
WAIT and XREAD BLOCK answer at once inside a script, as in Redis.
What a script sees, checked against redis-server 8.10:
- Errors carry Redis's suffix: <error> script: <sha>, on @user_script:<line>. (@user_function for FCALL).
- pcall(redis.call, …) catches a command's error and returns its message.
- Lua ↔ RESP conversions follow Redis in both protocols, redis.setresp(3) and its map/set/double/big_number/verbatim_string tables included.
- The globals are Redis's: base minus print, dofile, loadfile, getfenv, setfenv; table, string, math, coroutine; os with clock only; cjson, cmsgpack, struct and bit; and redis.
- Everything is read-only, and reading an undefined global is an error.
- Shebang flags (flags=no-writes,allow-oom) are honoured.
- redis.REDIS_VERSION is 7.0.0, the version INFO reports.
Limits:
- --lua-time-limit MS (default 5000) stops a script that has run that long without writing, with ERR Script killed: it ran longer than lua-time-limit (… ms) without writing. A worker runs one thing at a time, so it cannot answer the SCRIPT KILL or BUSY that Redis uses here. A script that has written keeps running, as an unkillable script does in Redis. 0 turns the limit off.
- --lua-memory-limit SIZE (default 1gb, 0 = none) caps each Lua state's heap. Redis has no such cap.
Persistence: FUNCTION libraries are written to the WAL (records 35 LOAD, 36 DELETE, 37 FLUSH) and into snapshots, and replicated. The EVAL script cache is not persisted, as in Redis.
Per-connection tx state (tx_in_multi[fd]): queues commands, validates names at QUEUE time against the generated command table, and answers EXEC with -EXECABORT on an unknown one
EXEC
✅
✅
✅
SLOW
✅
Runs the queued commands atomically and returns their replies as an array; -EXECABORT if any was rejected at QUEUE time
DISCARD
✅
✅
🟡
SLOW
✅
Returns +OK
WATCH
✅
✅
✅
SLOW
✅
Monitors keys for changes between WATCH and EXEC; EXEC returns null if any watched key was modified or has expired since (#45, as Redis 7). Per-fd version tracking via key_versions[65536] array, bumped by SET/DEL/HSET in fast path
Exponential-doubling batch copy for pipelined PINGs
FLUSHALL
✅
✅
✅
FAST/SLOW
✅
Clears this worker's keyspace (one keyspace by default; -w N > 1 needs --independent-workers)
FLUSHDB
✅
✅
✅
SLOW
✅
Clears this worker's keyspace (same as FLUSHALL in shared-nothing)
DBSIZE
✅
✅
✅
FAST
✅
Returns sum of shard sizes for this worker
SELECT
✅
✅
✅
FAST
✅
One database, as Redis with databases 1: SELECT 0 is OK, any other index is refused
SWAPDB
✅
✅
✅
SLOW
✅
One database: SWAPDB 0 0 is OK, any other index is out of range
SAVE
✅
✅
✅
SLOW
✅
Synchronous WAL flush
BGSAVE
✅
✅
✅
SLOW
✅
Async WAL msync
BGREWRITEAOF
✅
✅
✅
SLOW
✅
Rewrites the WAL compactly (the live keyspace as fresh records), and answers Redis's Background append only file rewriting started (#47)
LASTSAVE
✅
✅
✅
SLOW
✅
The unix time of the last SAVE/BGSAVE, and the startup time before one, as Redis (#47)
TIME
✅
✅
✅
SLOW
✅
[unix seconds, microseconds]
INFO
✅
✅
🟡
SLOW
✅
Server / Memory / Cluster / Replication / Persistence / Stats / Pion / Keyspace sections; INFO <section> ... returns only those. Port, RSS, uptime, per-worker key counts and the replication role are resolved from real state; redis_version stays 7.0.0 for client feature gating, pion_version carries the build. A RESP3 verbatim string under HELLO 3.
PION.STATS
n/a
n/a
n/a
SLOW
n/a
Pion-only. The value receipt: a 14-pair map (RESP3 %, RESP2 flat array) — kvprefix_hits/misses/tokens_served/bytes_served, prefill_seconds_avoided (measured + estimated) and prefill_seconds_avoided_measured (client-reported PREFILL_MS only), semantic_hits/misses, vector_queries. Per WORKER. PION.STATS RESET zeroes the counters.
CONFIG GET
✅
✅
✅
SLOW
✅
Glob patterns over the parameters Pion can state truthfully (databases, maxmemory, maxmemory-policy, maxmemory-samples, lfu-log-factor, lfu-decay-time, appendonly, save, port, timeout, enable-debug-command, slowlog-*, latency-monitor-threshold 0, latency-tracking no)
CONFIG SET
✅
✅
🟡
SLOW
✅
maxmemory, maxmemory-policy, maxmemory-samples, lfu-log-factor, lfu-decay-time, slowlog-log-slower-than and slowlog-max-len are runtime-settable, several pairs at once (all checked before any is set); latency-monitor-threshold 0 and latency-tracking no are accepted (that is what Pion is); every other key refuses with an explanatory -ERR
CONFIG REWRITE
✅
✅
✅
SLOW
✅
ERR The server is running without a config file, as Redis without one
CONFIG RESETSTAT
✅
✅
✅
SLOW
✅
Resets the counters INFO reports (PION.STATS)
COMMAND
✅
✅
✅
SLOW
✅
Every command's entry: Redis's own (RESP2 and RESP3, key specs, ACL categories, subcommands) for a command Redis has, one built from Pion's table for a Pion-only command (#47)
COMMAND COUNT
✅
✅
✅
SLOW
✅
The commands in Pion's generated table (not their subcommands, as Redis)
COMMAND DOCS
✅
✅
🟡
SLOW
✅
Each command's group; Pion carries no command documentation text
COMMAND INFO
✅
✅
✅
SLOW
✅
As COMMAND, for the named commands (nil for an unknown one). Also COMMAND LIST [FILTERBY MODULE|ACLCAT|PATTERN] (commands and command\|subcommand), GETKEYS / GETKEYSANDFLAGS (Redis's key-spec walk, and its own procedures where the specs are incomplete) and HELP (#47)
DEBUG
✅
✅
🟡
SLOW
❌
Refused unless --enable-debug-command yes\|local (default no, as Redis 7). Has HELP, SET-ACTIVE-EXPIRE, SLEEP and Pion's own MAXMEMORY-HIDE-RSS (for tests: hides bytes of RSS from --maxmemory); any other subcommand is refused (#45; it answered +OK to everything)
SLOWLOG
✅
✅
✅
SLOW
✅
Records commands at or over slowlog-log-slower-than (10 ms), up to slowlog-max-len, in Redis 8's entry shape (with the argument count; 32 arguments, 128 bytes each; credentials redacted; EXEC not logged, what it ran is). Fast-path commands are O(1) and not timed, except that a threshold under 1 ms sends every command through the timed path, and an LRANGE over 4096 elements is timed. GET [count] / LEN / RESET / HELP. Per worker (#47)
LATENCY
✅
✅
✅
SLOW
✅
Pion has no latency monitor and no per-command latency tracking, and answers as Redis does with both off: LATEST/HISTORY empty, RESET 0, GRAPH no samples, DOCTOR the monitoring-disabled report, HISTOGRAM an empty map, HELP (#47)
MEMORY USAGE
✅
✅
✅
SLOW
✅
Pion's own layout: the slot, the key if it does not fit, the value's allocations (containers sampled, SAMPLES n, 0 = all); nil for a missing key (#47)
MEMORY DOCTOR
✅
✅
🟡
SLOW
❌
A report of what Pion measures: RSS, its peak, maxmemory. Also MEMORY STATS (those, under Redis's field names), MALLOC-STATS (Redis's answer for an allocator without statistics), PURGE, HELP (#47)
MODULE
✅
✅
✅
SLOW
❌
LIST names search (Pion's built-in FT.*), which clients check for; LOAD / LOADEX / UNLOAD refuse; HELP (#47)
ACL
✅
✅
🟡
SLOW
✅
Pion's users are the default user (with --requirepass) and the --tenant users: GETUSER, LIST, USERS, WHOAMI, CAT, DRYRUN, GENPASS and HELP describe them as Redis does (passwords as SHA-256). LOG records failed AUTHs and tenants' denied commands. SETUSER and DELUSER refuse; SAVE / LOAD give Redis's no-ACL-file error (#47)
CLIENT ID / INFO / LIST
✅
✅
✅
SLOW
✅
IDs are never reused (it was the fd). LIST [TYPE t | ID id ...] and INFO give Redis's fields that Pion measures: id, addr, laddr, fd, name, age, idle, flags (N P x b O r e T), db, sub/psub/ssub, multi, watch, qbuf, qbuf-free, events, user, redir, resp, lib-name, lib-ver, io-thread; memory and network counters and the last command are left out. Per worker (#47)
CLIENT KILL
✅
✅
✅
SLOW
✅
<ip:port>, or ID / ADDR / LADDR / TYPE / USER / SKIPME / MAXAGE filters, as Redis; a client that kills itself gets its reply and is closed (#47)
CLIENT PAUSE / UNPAUSE
✅
✅
✅
SLOW
✅
ALL holds every command, WRITE Redis's write and may-replicate commands (and Pion's ingest), an EXEC that writes; held clients show b and resume in order; expiry pauses too (#47)
CLIENT REPLY
✅
✅
✅
SLOW
✅
ON / OFF / SKIP, as Redis (a reply already partly sent cannot be withdrawn) (#47)
CLIENT UNBLOCK
✅
✅
✅
SLOW
✅
A client blocked in BLPOP & co., XREAD BLOCK or WAIT: TIMEOUT answers as its timeout, ERROR with -UNBLOCKED (#47)
Client-side caching is not supported: TRACKING ON refuses, OFF is OK; GETREDIR -1 and TRACKINGINFO off, which is true (#47)
RESET
✅
✅
✅
SLOW
✅
As Redis: leaves MONITOR, discards MULTI and WATCH, drops every subscription, back to RESP2, the default user (unauthenticated when a password is set) and no name; READONLY off. Runs at once inside MULTI, as do QUIT and WATCH (#44)
MONITOR
✅
✅
✅
SLOW
❌
Redis's lines: shown after it runs, scripts before what they call, EXEC after its commands, admin commands never, AUTH/HELLO credentials redacted. A monitor may not touch the keyspace. With --independent-workers a monitor sees its own worker's commands. While a client monitors, every command takes the slow path (#39)
LOLWUT
✅
✅
✅
SLOW
✅
VERSION 5 (Schotter) and VERSION 6 (the skyline), ported from Valkey; otherwise Pion ver. <version> (#39)
ROLE
✅
✅
✅
SLOW
✅
A standalone server is a primary with offset 0 and no replicas. Under --cluster, a primary lists its replicas [ip, port, acked offset], and a replica reports its primary and its link state (#39)
REPLICAOF / SLAVEOF
✅
✅
🟡
SLOW
✅
NO ONE is OK on a primary. Refused in cluster mode, as Redis refuses it. Pointing a standalone server at a primary is refused with an error naming the startup flags: Pion replicates in cluster mode, over its own stream (#39)
FAILOVER
✅
✅
✅
SLOW
✅
As a Redis primary with no connected replicas, which a standalone Pion always is (arguments parsed and checked, then ERR FAILOVER requires connected replicas.). Refused in cluster mode, as Redis does: Pion's failover there is CLUSTER FAILOVER (#39)
SYNC
✅
✅
🟡
SLOW
n/a
Refused: a Redis primary streams an RDB file and then commands, which Pion does not produce. Pion replicas follow their primary over its replication port (#39)
QUIT
✅
✅
🟡
FAST
✅
Returns +OK
AUTH
✅
✅
✅
SLOW
✅
Real auth: with --requirepass/--tenant, AUTH <pw> gates every command (-NOAUTH before, -WRONGPASS on a bad password); with no password set, AUTH replies the Redis error, not +OK
HELLO
✅
✅
✅
SLOW
✅
HELLO 3 switches the connection to RESP3 (map/push replies); HELLO/HELLO 2 stay RESP2
SHUTDOWN
✅
✅
✅
SLOW
✅
NOSAVE, SAVE, NOW, FORCE parsed. A plain SIGTERM drains the WAL first. ABORT answers No shutdown in progress. (it shut the server down) (#47)
With --cluster; outside cluster mode refused as Redis refuses it (#47)
READONLY
✅
✅
✅
FAST
✅
With --cluster, allows reads on a replica; outside cluster mode refused as Redis refuses it (#47)
READWRITE
✅
✅
✅
FAST
✅
Inverse of READONLY; outside cluster mode refused (#47)
MIGRATE
✅
✅
✅
SLOW
✅
As Redis: COPY, REPLACE, AUTH, AUTH2, KEYS, NOKEY, the target's own errors, each key's remaining TTL, a host name or IPv6 address. To a Pion target (Redis refuses Pion's payload). The deletions are logged (#41)
PSYNC
✅
✅
🟡
SLOW
n/a
Refused, as SYNC. It answered +OK, and a Redis replica then waited for an RDB file that never came (#39)
REPLCONF
✅
✅
✅
SLOW
n/a
Redis's answers for a client that is not a replica: options checked, ACK/GETACK answer nothing (#39)
RESTORE-ASKING
✅
✅
✅
SLOW
n/a
RESTORE, as a cluster's MIGRATE sends it (#39, #41)
16. Pion-Native AI Commands (no Redis / Valkey equivalent)¶
Command
Pion path
GLIDE
Description
FT.CREATE
SLOW
❌
Create vector index (HNSW, SCHEMA, VECTOR field); indexes the hashes already in the keyspace unless SKIPINITIALSCAN; PREFIX, TAG SEPARATOR / CASESENSITIVE, NOINDEX applied; ON JSON, FILTER, TEMPORARY, AS, non-FLOAT32 TYPE and unknown options refused (vector_engine.md)
Build l0_compact, compact_buffer; save HNSW to disk (pion.hnsw.0)
FT.DROPINDEX
SLOW
❌
Drop vector index; clears in-memory HNSW. DD deletes the documents too (-w 1). An unknown name or argument is refused, nothing dropped
FT.INFO
SLOW
❌
[index_name, <name>, num_docs, <n>] (documents with a vector, deleted ones not counted); checks the name against the shared registry, same answer on every worker; unknown name → Unknown index name
Add text doc: store in keyspace + BM25 doc set (integer ids), embed via HTTP → insert into semantic HNSW
FT.SEARCHTEXT
SLOW
❌
Semantic text search over docs added via FT.ADDTEXT
AI.COMPLETE
SLOW
❌
Semantic cache check → LLM call on miss → cache result
AI.SEMANTIC_CACHE GET
SLOW
❌
Embed query → HNSW search → return cached response if cos sim ≥ threshold
AI.SEMANTIC_CACHE SET
SLOW
❌
Embed query → insert into HNSW → store response
AI.CHAT
SLOW
❌
Full RAG in one command: retrieve context → build prompt → call LLM
AI.FLARE LOAD
SLOW
❌
Add text to in-Mojo FLARE knowledge base
AI.FLARE RUN
SLOW
❌
Mid-generation retrieval loop (FLARE algorithm in Mojo)
AI.FLARE INFO
SLOW
❌
FLARE KB stats
AI.EMBED
SLOW
❌
Embed text with the in-process model. -ERR AI.EMBED requires --inference or --emb-enabled when no backend is active
AI.GENERATE
SLOW
❌
Generate via the sidecar; -ERR ... requires --inference otherwise
AI.LOADMODEL
SLOW
❌
Load a sidecar model; -ERR ... requires --inference otherwise
AI.MEMORY
SLOW
❌
AI.MEMORY ADD\|RECALL\|CONTEXT ... — agent-memory surface; a bare call returns the syntax line
16c. Fixed-Size State Cache — STATE.* (--kvcache)¶
A distinct surface from V-store: a fixed-size, overwrite-in-place buffer for
per-request recurrent state, not an evicting cache. Every command answers
-ERR state cache not enabled (use --kvcache) when the flag is absent.
Store KV cache tensor with HNSW-indexed embedding key. Experimental — TTL/MODEL stubs, capacity-capped 1000 entries, no LRU. See the external-parametric-memory Stage-2 reframe results §5.
KV.FETCH ⚠️
SLOW
❌
Fetch nearest cached tensor by cosine similarity. Experimental — MODEL arg silently ignored on FETCH.
KV.INFO
SLOW
❌
KV cache store statistics (entries, blob bytes, hits, misses, capacity)
~~KV.EVICT~~
none
❌
Not implemented — documented in source comments only, no handler.
KV.PREFIX.REGISTER
SLOW
❌
Register namespace for shared prefix KV cache; creates <ns>_pk and <ns>_pv V-store sessions. Optional PREFILL_MS <ms> reports the client's measured cold prefill for the value receipt. See doc/shared_kv_cache.md.
KV.PREFIX.LOOKUP
SLOW
❌
Returns +HIT if both K and V sessions exist for the namespace, +MISS otherwise
KV.PREFIX.INFO
SLOW
❌
Global stats: registered prefix count, total tokens, total fetches
V.CREATE
SLOW
❌
Create V-store session for token-ID-indexed value storage (used by KV.PREFIX.* and externalized attention)
V.STOREBATCH
SLOW
❌
Append a batch of FP32 values quantized to session format (int8/turbo4/turbo3/turbo2/fp16)
V.FETCH
SLOW
❌
Fetch values by token ID list, or contiguous range via RANGE start end (single round-trip per layer; bypasses 64-token RESP frame limit)
V.EXPORT
SLOW
❌
V.EXPORT <k_session> <v_session> <start> <end> <layers> <kv_heads> <head_dim>: writes a prefix's K and V as a safetensors file (fp16, [1, kv_heads, N, head_dim] per layer) and replies with its path, for a client on the same machine to map with mx.load. Local peers only; the server picks the name, in $PION_EXPORT_DIR (default ./pion-export), files 0600. A changed session gets a new file. The prompt cache's same-machine hit lane; see doc/shared_kv_cache.md.
KV.PREFIX.BLOCKS
SLOW
❌
Per-block visibility for a stored prefix
KV.PREFIX.MEMBERSHIP
SLOW
❌
Which blocks of a prefix are resident
KV.PREFIX.OWNER
SLOW
❌
Which worker holds a prefix. -w N is N independent keyspaces, so this is how a client finds the right one
KV.PREFIX.WARM
SLOW
❌
Promote a cold-tier prefix back to RAM
KV.PREFIX.SAVE
SLOW
❌
Persist a prefix to the cold tier
V.SNAPSHOT
SLOW
❌
Point-in-time V-store snapshot
V.COMMIT
SLOW
❌
Seal a snapshot
V.RESTORE
SLOW
❌
Reload a sealed snapshot
V.INFO
SLOW
❌
Per-session or global V-store statistics
ATTEND.PREFIX.STORE
SLOW
❌
Push K/V to native Metal SDPA session cache; resident until DROP / LRU eviction. Body: <session_id> <layer_id> <H> <N> <D> <K_blob> <V_blob>. See doc/shared_kv_cache.md Stage 2.
ATTEND.PREFIX.LOOKUP
SLOW
❌
Probe the Metal session cache for (sid, layer_id). Returns +HIT if slot exists with non-nil K/V, +MISS otherwise. Symmetric to KV.PREFIX.LOOKUP for V-store state. Required for stage-2-aware client PionPromptCache.lookup to avoid stale V-store hits causing skipped _stage2_push_cold.
ATTEND.PREFIX.QUERY
SLOW
❌
Run M=1 single-query attention on cached K/V (Q-only on wire). Body: <session_id> <layer_id> <H> <D> <top_k> <Q_blob>. Returns H*D float32. Native Metal SDPA path (sdpa_q1_fp32/fp16); supports D ∈ {32,64,96,128,160,192,256,512}.
Store opaque byte blob (serialized SSM recurrent state — Mamba [conv_state, ssm_state], RWKV-7 size=3 tuple, or any future linear-attention family). Body: <session_id> <layer_id> <state_blob>. Server never parses the blob.
SSM.PREFIX.FETCH
SLOW
❌
Retrieve previously-stored blob for (sid, layer_id). Returns bulk string or $-1 (miss).
SSM.PREFIX.DROP
SLOW
❌
Drop stored blob. Body: <session_id> [<layer_id>]. Layer omitted = drop all layers for the session. Idempotent.
ATTEND.CREATE
SLOW
❌
Create attention session with key_dim and value_dim
ATTEND.STORE
SLOW
❌
Stage token KV pairs (FP32 memcpy)
ATTEND.FINALIZE
SLOW
❌
Batch build HNSW index from staged keys
ATTEND.QUERY
SLOW
❌
Top-k HNSW search over attention keys
ATTEND.INFO
SLOW
❌
Index statistics (sessions, tokens, queries)
Binary protocol commands on port 1975 (0xCA5E framing):
Vector sets are separate from FT.* indexes and need no FT.CREATE. Persisted like every other type: VADD/VREM/VSETATTR are WAL-logged and SAVE / BGREWRITEAOF serialize the set.
Pion dispatches 355 command names (PION_COMMAND_COUNT in the generated
src/commands/command_table.mojo), and tests/test_dispatch_sweep.py sends
every one of them in five argument shapes. The counts below are of the rows in
this document; ✅ and 🟡 both count as supported, and a 🟡 row's notes say
what is missing.
GETSETMGETMSETINCRDECRHSETHGETLPUSHRPUSHLPOPRPOPLRANGELLENDELEXISTSSADDSPOPZADDZPOPMINPINGFUNCTION LOADFCALLGETBITSETBITBITCOUNT(no-arg) PFADDPFCOUNT(single-key) ECHOTYPESELECTDBSIZEQUIT. CLIENT and COMMAND go to the slow path (#47); RESET goes to the slow path, which resets the connection.
Python redis-py sends INCRBY key 1, not INCR key. Both work; INCR takes the fast path.
Multi-worker + AI
When --flare / --emb-enabled is set, Pion auto-caps to -w 1. SemanticCache is per-worker and cannot share state across workers.
SCAN cursor semantics
SCAN, HSCAN, SSCAN and ZSCAN iterate incrementally, COUNT-bounded, with a working cursor (#50). A full iteration returns every key present from start to finish, as in Redis. A small keyspace still returns in one call; a large one paginates.
Blocking commands
BLPOP, BRPOP, BRPOPLPUSH, BLMOVE, BLMPOP, BZPOPMIN, BZPOPMAX and BZMPOP block as in Redis. The wait is per worker: with -w N > 1 a push on another worker's keyspace never reaches them (see --independent-workers). Inside MULTI/EXEC and inside a script they answer at once.
Lua scripting
redis.call() runs every command. A script that runs past --lua-time-limit without writing is stopped, because a worker cannot answer SCRIPT KILL mid-script (see §12).
GLIDE connects in cluster or standalone mode. With Pion:
- Standalone mode works today: GlideClient.create(GlideClientConfiguration(..., port=1974))
- Cluster mode (GlideClusterClient) requires --cluster flag on Pion; sends CLUSTER SLOTS/SHARDS at connect time; Pion responds correctly
- RESP3 negotiation (HELLO 3): supported; the connection switches to RESP3 replies
- Auth (AUTH): supported when the server runs with --requirepass