Fast local LLM inference on plain CPUs. No GPU, 8 GB of RAM. OpenAI-compatible server.
Python aiavx512cpu-inferenceedge-aiggufinference-enginellama-cppllmllm-inferencelocal-ailocal-llmno-gpuon-device-aiopenai-apiopenai-compatiblequantizationqwenself-hostedspeculative-decodingternary
diff --git a/common/arg.cpp b/common/arg.cpp
index eef8b9962..09476ec11 100644
--- a/common/arg.cpp
+++ b/common/arg.cpp
@@ -311,6 +311,9 @@ const std::vector<ggml_type> kv_cache_types = {
GGML_TYPE_IQ4_NL,
GGML_TYPE_Q5_0,
GGML_TYPE_Q5_1,
+ GGML_TYPE_KV4, // 4 / 5 / 6-bit rows, one f32 gain each (132 / 164 / 196 B per 256): ggml-cpu/kvq.h,
+ GGML_TYPE_KV5, // CPU attention kernel only
+ GGML_TYPE_KV6,
GGML_TYPE_Q8_K, // int8 rows with one f32 scale each; CPU attention kernel only (release/kernels/attn-fast.inc)
};
diff --git a/ggml/include/ggml.h b/ggml/include/ggml.h
index c9339461c..61f879010 100644
--- a/ggml/include/ggml.h
+++ b/ggml/include/ggml.h
@@ -432,6 +432,10 @@ extern "C" {
GGML_TYPE_Q2_0 = 42,
// Prism-private Q2_0 at group size 128 (upstream Q2_0 is group 64). High id so it
// slots above upstream types; type_traits is sized to COUNT (143) with 43..141 unused.
+ // openset-llm: low-bit KV cache rows (ggml-cpu/kvq.h; CPU attention kernel only)
+ GGML_TYPE_KV6 = 139,
+ GGML_TYPE_KV5 = 140,
+ GGML_TYPE_KV4 = 141,
GGML_TYPE_PQ2_0 = 142,
GGML_TYPE_PTQ1_0 = 143, // Prism-private ternary, group 128
GGML_TYPE_COUNT = 144,
diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c
index da2575cd9..419f6a42a 100644
--- a/ggml/src/ggml-cpu/ggml-cpu.c
+++ b/ggml/src/ggml-cpu/ggml-cpu.c
@@ -212,6 +212,8 @@ typedef pthread_t ggml_thread_t;
#include <TargetConditionals.h>
#endif
+#include "kvq.h" // quantize_row_kv4/5/6 (GGML_TYPE_KV4/5/6: low-bit KV cache rows)
+
static const struct ggml_type_traits_cpu type_traits_cpu[GGML_TYPE_COUNT] = {
[GGML_TYPE_F32] = {
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_fp32,
@@ -408,6 +410,9 @@ static const struct ggml_type_traits_cpu type_traits_cpu[GGML_TYPE_COUNT] = {
[GGML_TYPE_Q8_K] = {
.from_float = quantize_row_q8_K,
},
+ [GGML_TYPE_KV4] = { .from_float = quantize_row_kv4, },
+ [GGML_TYPE_KV5] = { .from_float = quantize_row_kv5, },
+ [GGML_TYPE_KV6] = { .from_float = quantize_row_kv6, },
[GGML_TYPE_BF16] = {
.from_float = (ggml_from_float_t) ggml_cpu_fp32_to_bf16,
.vec_dot = (ggml_vec_dot_t) ggml_vec_dot_bf16,
diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c
index 762655731..8e39abfe1 100644
--- a/ggml/src/ggml.c
+++ b/ggml/src/ggml.c
@@ -898,6 +898,10 @@ static const struct ggml_type_traits type_traits[GGML_TYPE_COUNT] = {
.type_size = sizeof(block_q8_K),
.is_quantized = true,
},
+ // low-bit KV cache rows: f32 gain + 256 b-bit codes (ggml-cpu/kvq.h)
+ [GGML_TYPE_KV4] = { .type_name = "kv4", .blck_size = 256, .type_size = 132, .is_quantized = true, },
+ [GGML_TYPE_KV5] = { .type_name = "kv5", .blck_size = 256, .type_size = 164, .is_quantized = true, },
+ [GGML_TYPE_KV6] = { .type_name = "kv6", .blck_size = 256, .type_size = 196, .is_quantized = true, },
[GGML_TYPE_BF16] = {
.type_name = "bf16",
.blck_size = 1,