feat(vllm): add phi4-mini FP8 summarizer/dreamer on ana-ml2; retire granite from llama-swap

phi4-mini supersedes the granite-4-small llama-swap pin as the summarizer +
dreaming agent. New vllm-phi4 service: Phi-4-mini-instruct, vLLM-native FP8
(near-lossless on RTX 6000 Ada cc 8.9), 50K ctx, FP8 KV cache, GPU 1, :8004.

llama-swap: removed granite-4-small (depinned) + granite-4-micro config —
both superseded. CONFIG ONLY; the GGUFs stay on disk. Frees granite-4-small's
~24 GB (it was pinned at 120K ctx).

Placement: phi4 on GPU 1 with the embed/rerank/reward trio (~1.2 GB margin at
50K); keeps GPU 0 clear for llama-swap heavy models. docs/roadmap.md captures
the deferred vLLM observability (Langfuse req/resp tracing + Prometheus/Grafana).

Deploy order: llama-swap config (free granite) -> vllm-phi4 -> repoint nevermore.
This commit is contained in:
vh
2026-06-03 23:21:45 -07:00
parent 5cd4678d9f
commit 40a374b809
4 changed files with 151 additions and 37 deletions
+25
View File
@@ -52,3 +52,28 @@ API_KEY=
# HuggingFace token — only needed for gated models in the HF-Hub-loaded
# services (embed/rerank). Reward is local-path, ignores this.
HF_TOKEN=
# === phi4-mini (summarizer / dreaming agent; supersedes llama-swap granite-4-small) ===
PHI4_PORT=8004
# GPU 1 — co-locate with the embed/rerank/reward trio so GPU 0 stays clear for
# llama-swap's heavy swap-ins. Post-granite GPU 1 has ~10.4 GB free; phi4 at 50K
# + FP8 KV needs ~9 GB → ~1.2 GB margin (tight). NOTE: llama-swap also uses GPU 1
# dynamically (a model's ~10 GB share lives here), so a large swap-in could
# contend — for clean separation, pin llama-swap to GPU 0 (follow-up).
PHI4_GPU_ID=1
# FP8 path. Default = vLLM-native dynamic FP8 from the official BF16 weights
# (most robust on Ada/Hopper, near-lossless, ~1.2x). Alternative = the
# pre-quantized checkpoint: PHI4_MODEL=pytorch/Phi-4-mini-instruct-FP8 + PHI4_QUANT=torchao.
PHI4_MODEL=microsoft/Phi-4-mini-instruct
PHI4_QUANT=fp8
PHI4_SERVED_NAME=phi4-mini
# 50K ctx (51200) — dropped from the 128K canonical max to fit GPU 1's ~10.4 GB
# free post-granite (64K was ~10 GB = no margin). Ample for feed summarization +
# the dreaming agent; Phi-4-mini supports up to 131072 if it ever moves to GPU 0.
PHI4_MAX_MODEL_LEN=51200
# FP8 KV cache (native on Ada cc 8.9). At 50K ≈ ~3.1 GB KV (vs ~6.3 GB at fp16).
PHI4_KV_CACHE_DTYPE=fp8
# ~9 GB total: ~4 GB FP8 weights + ~3.1 GB FP8 KV @50K + overhead. 0.20×46≈9.2 GB.
# vLLM prints the real KV size on first boot — tune after; do NOT raise without
# first confirming GPU 1 freed more (it's only ~1.2 GB over budget here).
PHI4_GPU_MEM_UTIL=0.20