Skip to content

glide-mqThe Node.js Message Queue - Fast, Reliable, AI-Ready

Rust NAPI core, 1-RTT Valkey Server Functions, cluster-native hash slots, workflows and DAGs. Plus built-in AI primitives - cost tracking, token streaming, human-in-the-loop, model failover, budget caps, and vector search.

Performance

Benchmarked on AWS ElastiCache Valkey 8.2 (r7g.large) with TLS:

Concurrencyglide-mqLeading AlternativeDelta
c=510,754 j/s9,866 j/s+9%
c=1018,218 j/s13,541 j/s+35%
c=1519,583 j/s14,162 j/s+38%

AI-Native Primitives

Every primitive AI orchestration needs - built into the queue, not a plugin or middleware.

PrimitiveAPIWhat it does
Cost trackingjob.reportUsage() / queue.getFlowUsage()Record model, tokens, cost, latency per job. Aggregate across entire flows.
Token streamingjob.stream() / queue.readStream()Stream LLM output tokens to consumers in real time. SSE proxy endpoint included.
Human-in-the-loopjob.suspend() / queue.signal()Pause for approval. Resume with a named signal and payload. Zero compute while suspended.
Budget capsFlowProducer.add(flow, { budget })Cap total tokens or cost across all jobs in a flow. Pre-dispatch + post-completion enforcement.
Fallback chainsopts.fallbacks / job.currentFallbackOrdered model/provider alternatives tried automatically on failure.
Rate limitingtokenLimiter + limiterRPM (requests/min) + TPM (tokens/min) with per-queue and per-worker scopes.
Vector searchqueue.createJobIndex() / queue.vectorSearch()KNN similarity search over jobs via Valkey Search. Your jobs are your vector store.
typescript
const worker = new Worker('ai', async (job) => {
  const result = await callLLM(job.data.prompt);
  await job.reportUsage({ model: 'gpt-5.4', tokens: { input: 50, output: 200 }, costs: { total: 0.003 }, costUnit: 'usd' });
  await job.stream({ type: 'token', content: result });
  return result;
}, {
  connection,
  tokenLimiter: { maxTokens: 100000, duration: 60000 },
});

Read the full AI-Native guide | 18 runnable examples | Vercel AI SDK integration | LangChain integration

Quick Install

bash
npm install glide-mq

Requires Node.js 20+ (also works with Bun and Deno) and Valkey 7.0+ or Redis 7.0+. For vector search, use valkey-bundle.

Ecosystem

PackageDescription
glide-mqCore queue library
@glidemq/honoHono middleware
@glidemq/fastifyFastify plugin
@glidemq/nestjsNestJS module
@glidemq/hapiHapi plugin
@glidemq/dashboardExpress web dashboard

Released under the Apache-2.0 License.