feat: add Hermes-4.3-36B (dense) support and optimize architecture profiles#1
Merged
Conversation
added 11 commits
March 1, 2026 15:01
…ofiles - Add new model `hermes-4.3-36b` (NousResearch/Hermes-4.3-36B Q4_K_M) - Empirically test dense 36B architecture limits on RTX 5090 (32GB VRAM): - Pure decode: ~64.5 tok/s - 4-concurrent aggregate: ~132.0 tok/s - Tune Hermes rtx5090 profile for dense compute constraints: - Drop context to 32768 to fit 4 slots within 32GB VRAM - Keep --parallel 4 (yields 2x aggregate throughput vs 1 slot) - Keep KV cache q8_0 (empirically faster than q4_0 under heavy dense compute) - Re-enable prompt cache (no DeltaNet limitations here) - Refactor `docker-compose.yml` and `Makefile` to use `FOUNDRY_MODEL` env var instead of hardcoding services, making the repository fully modular - Update Prometheus config to scrape dynamic `inference` container name - Add Hermes architecture details and empirical benchmarks to README
…nd tooling - Introduce FOUNDRY_ARCH env (moe/dense) in Dockerfiles for systematic architecture-aware flag gating (--fit only for MoE, via Tier 1 in entrypoint) - Extract shared entrypoint to scripts/entrypoint.sh with 3-tier flag system: Tier 1 (architecture), Tier 2 (hardware profile), Tier 3 (user overrides) - Move model-specific flags (--swa-full, --cache-ram 0) out of arch tier into qwen PROFILE_EXTRA_ARGS where they belong (not all MoE needs these) - Remove PROFILE_FIT from qwen profiles (now driven by FOUNDRY_ARCH=moe) - Fix Hermes 4-concurrent benchmark: ~170 tok/s (was incorrectly ~132) - Remove duplicate Hermes benchmark table in README - Add hf_transfer to qwen Dockerfile for download parity - Update CI to matrix strategy building both models - Update download-model.sh to support --model flag - Fix Grafana dashboard container filter (inference, not qwen) - Restore prometheus depends_on for inference service - Update README: architecture tree, model selection docs, build commands Validated on RTX 5090: both models build, launch with correct flags (no duplicates), serve inference, and integrate with full monitoring stack (Prometheus scraping all 5 targets, Grafana healthy).
- Add .github/workflows/lint.yml with ruff (Python) and shellcheck (bash) - Add pyproject.toml with ruff config (E/F/W/I/UP/B/SIM rules, 100 char line) - Fix existing lint issues: unused import, empty f-strings, import order, line length - Format all Python files with ruff
- Refactor model Dockerfiles to multi-stage from-scratch builds compiling llama.cpp natively for sm_89 and sm_120a (Blackwell) to avoid upstream JIT/fallback overhead and drastically reduce final image size. - Switch Hermes source to official NousResearch/Hermes-4.3-36B-GGUF repo. - Update host-setup.sh with high-impact Linux kernel tweaks (numa_balancing=0, vm.swappiness=0, THP defrag, NVMe schedulers) discovered via profiling. - Add memlock unlimited ulimits to docker-compose.yml for mlock safety.
- Integrates Cloudflare's ebpf_exporter to trace deep Linux kernel metrics (starting with biolatency to trace exact NVMe model loading performance). - Adds ebpf_exporter to the docker-compose 'monitoring' profile. - Configures Prometheus to scrape the host-networked eBPF exporter.
- Disable PCIe ASPM to eliminate link-wake latency (critical for MoE expert fetching). - Set CPU Energy Performance Bias (EPB) to 0 alongside performance governor. - Add advanced GRUB GRUB_CMDLINE_LINUX documentation for isolcpus and nohz_full to completely isolate the CPU threads feeding the GPU.
- Added /usr/local/cuda/lib64/stubs to the linker path and LD_LIBRARY_PATH during the builder stage so libggml-cuda.so can link against libcuda.so.1 inside the development container. - Resolved Docker build warning regarding undefined $LD_LIBRARY_PATH variable.
…atency SSE streaming
…ibrary paths Three root causes were breaking CI: 1. libcuda.so.1 transitive link error: The CUDA backend links against CUDA::cuda_driver which isn't available in the Docker build environment. Fix: use GGML_BACKEND_DL=ON to build CUDA as a dlopen'd module, matching the official llama.cpp Dockerfile approach. 2. Wrong COPY paths: Dockerfiles referenced build/ggml/src/ and build/src/ but CMake outputs everything to build/bin/. Fix: COPY build/bin/ to /app/. 3. Additional fixes: GGML_NATIVE=OFF for GPU-less CI runners, GGML_CPU_ALL_VARIANTS=ON for broad CPU support, CUDA 12.9.1 base image, FROM...AS casing fix, and LD_LIBRARY_PATH undefined var warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes-4.3-36b(NousResearch/Hermes-4.3-36B Q4_K_M)rtx5090profile for dense compute constraints:--parallel 4(yields 2x aggregate throughput vs 1 slot)q8_0(empirically faster thanq4_0under heavy dense compute)docker-compose.ymlandMakefileto useFOUNDRY_MODELenv var instead of hardcoding services, making the repository fully modularinferencecontainer name