Skip to content

Deployment, Cluster KV Fabric & Telemetry

1. Multi-Node Shared Cluster KV Cache Node

Start a lightweight, zero-dependency shared canonical KV cache daemon on a shared NVMe host (with Bearer token auth and LRU disk quotas):

dag-kv cache-node \
  --host 0.0.0.0 --port 9100 \
  --cache-dir /var/lib/dagkv-cluster \
  --max-disk-gb 128 \
  --api-key "$DAGKV_CLUSTER_KEY"

Point any number of GPU serving replicas at the shared cache node (or at Redis / S3):

# Worker Node A & Worker Node B share 100% of canonical chunks over Tier-4 fabric
dag-kv serve \
  --host 0.0.0.0 --port 8000 \
  --model Qwen/Qwen2.5-7B-Instruct --sharded \
  --quantization k8v4 \
  --bridge-strategy lse_hybrid --bridge-top-k 0.04 \
  --cuda-graphs \
  --disk-cache /var/cache/dag_kv --max-disk-gb 32 \
  --remote-cache-url http://cache-node:9100

Alternatively, attach Redis / Valkey (--redis-url redis://redis:6379/0) or AWS S3 / MinIO (--s3-bucket my-dagkv-bucket) via pip install "dag-kv[cluster]".

HTTP Endpoints (dag-kv serve)

Endpoint Method Purpose
/v1/chat/completions POST OpenAI-compatible chat completion + SSE streaming (dag_chunks, documents, ### FILE:, top_p, top_k, repetition_penalty, stop)
/v1/models GET Loaded model discovery
/v1/cache/prefill POST Pre-warm canonical chunks or sync AST-delta files
/v1/cache/invalidate POST Evict stale canonical chunks by chunk_id
/metrics GET Prometheus text exposition telemetry
/health GET Readiness probe

2. OpenTelemetry Distributed Tracing

from dag_kv import configure_otel_tracing, trace_span

configure_otel_tracing(service_name="dag-kv-worker-a")
# Automatically traces Tier-4 remote fetches (`dagkv.tier4_remote_fetch`) and custom request spans

Install optional tracing dependencies with pip install "dag-kv[observability]".

3. One-Command Docker Compose + Prometheus + Grafana

cd deploy
docker compose up -d

Import deploy/grafana_dashboard.json into Grafana (http://localhost:3000, default login admin / dagkv) to monitor canonical hit rate, TTFT, TPOT, active decode batch size, free KV blocks, and LRU evictions in real time.