The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(local-runtime): support MXFP4 GGUF tensors
fangliquanae908a93baa2
diff --git a/hermes_cli/local_runtime/gguf.py b/hermes_cli/local_runtime/gguf.pyindex 4c56d44bb91..dbf2b1b82bc 100644--- a/hermes_cli/local_runtime/gguf.py+++ b/hermes_cli/local_runtime/gguf.py@@ -32,6 +32,7 @@ _GGML_TYPE_SIZES = {17: (74, 256), 18: (98, 256), 19: (50, 256), 20: (18, 32),21: (110, 256), 22: (82, 256), 23: (136, 256), 24: (1, 1), 25: (2, 1),26: (4, 1), 27: (8, 1), 28: (8, 1), 29: (56, 256), 30: (2, 1),+ 39: (17, 32),}# GGUF metadata value types -> struct format; STRING (8) and ARRAY (9) are variable-length.diff --git a/tests/hermes_cli/test_local_runtime_gguf.py b/tests/hermes_cli/test_local_runtime_gguf.pynew file mode 100644index 00000000000..b69d5a46da7--- /dev/null+++ b/tests/hermes_cli/test_local_runtime_gguf.py@@ -0,0 +1,25 @@+"""Behavior contracts for the managed local runtime's GGUF reader."""++from __future__ import annotations++import struct++from hermes_cli.local_runtime.gguf import read_gguf_header+++def test_reader_sizes_mxfp4_tensor_blocks(tmp_path):+ """MXFP4 stores 32 elements in one 17-byte block."""+ name = b"token_embd.weight"+ gguf = tmp_path / "gpt-oss.gguf"+ gguf.write_bytes(+ b"GGUF"+ + struct.pack("<IQQ", 3, 1, 0)+ + struct.pack("<Q", len(name))+ + name+ + struct.pack("<IQIQ", 1, 64, 39, 0)+ )++ header = read_gguf_header(gguf)++ assert header.tensor_bytes == 34+ assert header.embd_table_bytes == header.tensor_bytes