Merge origin/main: sync Qwen3-8B no_think variant to Ansible repo (t_36e8ba68)

Resolved conflicts between local bafd76a (t_c5cef2b2, Qwen3-8B single-variant)
and origin/main 5cf4468 (t_664289a0, Qwen3-8B dual-thinking deployment).

Conflict resolution strategy: took origin/main version throughout — it is the
authoritative result from t_664289a0 which deployed the live no_think config to
astro-orbiter and already reflects the correct production state.

Changes incorporated from origin/main:
- defaults/main.yml: Qwen3-8B-Q4_K_M-no_think model entry (port 8107, n_gpu_layers=99,
  chat_template_file), row6 matrix entry, dual-thinking comment block.
- templates/llama-server-router-preset.ini.j2: [Qwen3-8B-Q4_K_M] with sleep-idle-seconds=60
  plus new [Qwen3-8B-Q4_K_M-no_think] section with chat-template-file directive.
- templates/qwen3-no-think.jinja.j2: new file — Qwen3 template with enable_thinking=false.
- tasks/models.yml: template deploy task for qwen3-no-think.jinja (chat_templates tag).
- tasks/swapmode.yml: GATE 2 assert updated to 7 models.
- templates/llama-swap-config.yaml.j2: chat_template_file flag support.

Also pulled in monitoring defaults (llm_monitoring_enabled, VRAM exporter settings,
Grafana dashboard vars, Prometheus scrape config) from origin/main monitoring branch.
This commit is contained in:
Hermes Agent service account
2026-08-19 12:42:46 -05:00
6 changed files with 214 additions and 86 deletions

View File

@@ -190,38 +190,6 @@ llm_router_nomic_ctx_size: 8192
llm_router_nomic_batch_size: 4096
llm_router_nomic_ubatch_size: 4096
# --- Monitoring: VRAM exporter + Prometheus scrape + Grafana dashboard -------
# Phase 3: GPU/LLM monitoring deployment (Wong, 2026-08-18)
# Provides: VRAM textfile exporter, Prometheus scrape config for llama-swap
# /metrics endpoint, Grafana 6-panel dashboard, PrometheusRule alert rules.
#
# Ref: roles/llm-inference-multimodel/references/monitoring-llm-homelab-ciro-luciotta-2026.md
llm_monitoring_enabled: true # gate for monitoring tasks
llm_vram_exporter_script: /opt/llama-server-monitoring/nvidia-smi-vram-exporter.sh
llm_vram_exporter_cron_minute: "*" # run every minute
llm_vram_exporter_gpu_index: 0 # GPU 0 (RTX 3090 on astro-orbiter)
llm_vram_textfile_dir: /var/lib/node_exporter/textfile_collector
# Alert thresholds (per Ciro Luciotta pattern)
llm_vram_critical_mib: 24000 # ~90% of 24GB RTX 3090
llm_kv_cache_spill_ratio: 0.92 # KV-cache spill threshold
llm_throughput_baseline_tokens_per_min: 50 # baseline for degradation alert
# Grafana dashboard
llm_grafana_dashboard_uid: llama-swap-monitor
llm_grafana_dashboard_title: "llama-swap GPU/LLM Monitoring"
llm_grafana_dashboard_tags:
- llm
- llama-swap
- gpu-monitoring
- ciro-luciotta
llm_grafana_dashboard_refresh: "30s"
llm_grafana_dashboard_time_from: "now-24h"
# Prometheus scrape job
llm_prometheus_scrape_interval: "30s"
llm_prometheus_scrape_timeout: "10s"
# --- llama-swap mode (port 8001) -----------------------------------------------
# Deploy llama-swap — Go-based hot-swap proxy (v250+) for model orchestration.
# Replaces router mode entirely: single binary + YAML config.json, no --models-preset INI.
@@ -317,26 +285,36 @@ llm_swapmode_models:
sleep_idle_seconds: -1 # never idle (always ready for embeddings)
load_on_startup: true
# Added t_c5cef2b2 (2026-08-19, War Machine): Qwen3-8B aux model.
# Dense 8B (not MoE). ~4.68GB weights at Q4_K_M. GPU-resident (~5.2GB total
# including KV at 32K ctx). Thinking mode on by default — callers MUST send
# /no_think prefix for latency-sensitive aux tasks. See INI template comments.
# VRAM budget: Qwen3.8-27B (~17,804 MiB @ 65536 ctx) + Qwen3-8B (~5,300 MiB
# @ 32K ctx) = ~23,104 MiB — fits in 24GB (24,576 MiB) with ~1.4GB headroom.
# llama-swap evicts Qwen3.8 when Qwen3-8B is requested (cannot co-reside).
# LRU eviction is the operative strategy; cold load ~5s for 5GB GGUF.
# t_c5cef2b2 / t_664289a0 (2026-08-19): Qwen3-8B dual-thinking deployment.
# Both variants point to the same GGUF. GPU-resident (~5.2GB each).
# Cannot co-reside with Qwen3.8-27B-Q4_K_M; LRU eviction applies.
# chat_template_file for no_think variant: {{ llm_models_dir }}/templates/qwen3-no-think.jinja
- id: Qwen3-8B-Q4_K_M
gguf_path: "{{ llm_models_dir }}/Qwen3-8B-Q4_K_M.gguf"
port: 8106
n_gpu_layers: -1 # -1 = auto-detect / all layers to GPU (~5GB, fits easily)
n_gpu_layers: 99 # GPU-resident (thinking variant)
ctx_size: 32768
batch_size: 4096
ubatch_size: 4096
parallel: 1
cache_type: q4_0
flash_attn: true
flash_attn: "true"
sleep_idle_seconds: 60 # idle after 60s no requests
- id: Qwen3-8B-Q4_K_M-no_think
gguf_path: "{{ llm_models_dir }}/Qwen3-8B-Q4_K_M.gguf"
port: 8107
n_gpu_layers: 99 # GPU-resident (no-think variant)
ctx_size: 32768
batch_size: 4096
ubatch_size: 4096
parallel: 1
cache_type: q4_0
flash_attn: "true"
sleep_idle_seconds: 60
chat_template_file: "{{ llm_models_dir }}/templates/qwen3-no-think.jinja"
# llama-swap matrix routing configuration
# Each row defines a set of models that can be co-resident and hot-swappable
# Syntax: "model1 & model2" = both models in same row (via v250 expression DSL)
@@ -356,5 +334,13 @@ llm_swapmode_matrix_rows:
- row: row4
expr: "Phi-3.5-mini-instruct-Q8_0 & nomic-embed-text-v1.5" # Mini + embed
# t_c5cef2b2 / t_664289a0 (2026-08-19): Qwen3-8B dual-thinking rows.
# Both Qwen3-8B variants co-reside with nomic-embed but NOT with
# Qwen3.8-27B-Q4_K_M (17.8GB). LRU eviction swaps between primary and
# Qwen3-8B when needed. They CAN co-reside with each other (~10.4GB total)
# but NOT simultaneously with Qwen3.8-27B.
- row: row5
expr: "Qwen3-8B-Q4_K_M & nomic-embed-text-v1.5" # Aux 8B + embed
expr: "Qwen3-8B-Q4_K_M & nomic-embed-text-v1.5" # Thinking variant + embed
- row: row6
expr: "Qwen3-8B-Q4_K_M-no_think & nomic-embed-text-v1.5" # No-think variant + embed