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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- jaredpalmer/kev-0.8b
|
| 5 |
+
- Qwen/Qwen3.5-0.8B-Base
|
| 6 |
+
tags:
|
| 7 |
+
- vllm.cpp
|
| 8 |
+
- decisions
|
| 9 |
+
- systemone
|
| 10 |
+
- kev
|
| 11 |
+
- localai
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# kev-0.8b for vllm.cpp
|
| 15 |
+
|
| 16 |
+
This repository holds [jaredpalmer/kev-0.8b](https://huggingface.co/jaredpalmer/kev-0.8b)
|
| 17 |
+
converted into the single-directory layout that
|
| 18 |
+
[vllm.cpp](https://github.com/mudler/vllm.cpp) loads as `KevModel`.
|
| 19 |
+
|
| 20 |
+
kev is a System 1 decision model. It answers typed `choice`, `noul` and
|
| 21 |
+
`score` questions about a text `state` with one scoring pass per question. It
|
| 22 |
+
does not generate text. kev is a frozen `Qwen/Qwen3.5-0.8B-Base` backbone, a
|
| 23 |
+
rank-16 LoRA adapter, and a PointerHead readout.
|
| 24 |
+
|
| 25 |
+
**This checkpoint only works with vllm.cpp** (directly, or through LocalAI's
|
| 26 |
+
`vllm-cpp` backend). It is not a general-purpose checkpoint: `transformers`,
|
| 27 |
+
vLLM and llama.cpp do not know the `KevModel` architecture or `head.safetensors`.
|
| 28 |
+
|
| 29 |
+
## Redistribution and license
|
| 30 |
+
|
| 31 |
+
This is a redistribution of upstream weights, converted for vllm.cpp and
|
| 32 |
+
LocalAI. No weights were trained or changed here, other than the LoRA merge
|
| 33 |
+
described below.
|
| 34 |
+
|
| 35 |
+
- kev adapter and PointerHead: [jaredpalmer/kev-0.8b](https://huggingface.co/jaredpalmer/kev-0.8b)
|
| 36 |
+
@ `9a45d25eb2ab761841196625383fa1dff0e56c1e`, by Jared Palmer, Apache-2.0.
|
| 37 |
+
Reference code: [jaredpalmer/kev](https://github.com/jaredpalmer/kev).
|
| 38 |
+
- Base backbone and tokenizer: [Qwen/Qwen3.5-0.8B-Base](https://huggingface.co/Qwen/Qwen3.5-0.8B-Base)
|
| 39 |
+
@ `dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68`, by the Qwen team, Apache-2.0.
|
| 40 |
+
|
| 41 |
+
The upstream licenses apply to these files. Credit for the model belongs to
|
| 42 |
+
the original authors.
|
| 43 |
+
|
| 44 |
+
## Conversion
|
| 45 |
+
|
| 46 |
+
The converter is `scripts/convert-kev.py` from vllm.cpp at commit
|
| 47 |
+
`96788348627b6a079fcc3ef7fc6676a970965d7b`. It merges the LoRA once
|
| 48 |
+
(`W' = W + 2.0 * (B @ A)`, r=16, alpha=32, math in F32, stored in the base
|
| 49 |
+
dtype BF16), drops the base's vision and MTP tensors, converts `head.pt` to
|
| 50 |
+
`head.safetensors`, and writes a `config.json` with `architectures: ["KevModel"]`.
|
| 51 |
+
|
| 52 |
+
```sh
|
| 53 |
+
hf download jaredpalmer/kev-0.8b --revision 9a45d25eb2ab761841196625383fa1dff0e56c1e \
|
| 54 |
+
--local-dir kev-0.8b
|
| 55 |
+
hf download Qwen/Qwen3.5-0.8B-Base --revision dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68 \
|
| 56 |
+
--local-dir Qwen3.5-0.8B-Base
|
| 57 |
+
python3 scripts/convert-kev.py kev-0.8b \
|
| 58 |
+
--base-model-dir Qwen3.5-0.8B-Base --output-dir kev-0.8b-vllm-cpp
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
The converter logged: 186 of 186 LoRA modules merged, 168 vision/MTP tensors
|
| 62 |
+
dropped, 320 tensors written. Environment: torch 2.11.0, safetensors 0.7.0, CPU.
|
| 63 |
+
|
| 64 |
+
## Files
|
| 65 |
+
|
| 66 |
+
| file | bytes | content |
|
| 67 |
+
|---|---|---|
|
| 68 |
+
| `model.safetensors` | 1,504,832,320 | merged Qwen3.5-0.8B backbone, BF16 |
|
| 69 |
+
| `head.safetensors` | 2,099,504 | PointerHead `q`/`k` weight and bias, F32 |
|
| 70 |
+
| `config.json` | 2,526 | base config, `architectures: ["KevModel"]`, `kev_head_dim: 256`, `kev_temperature: 2.3510958125672174` |
|
| 71 |
+
| `meta.json` | 258 | head metadata from `head.pt` |
|
| 72 |
+
| `tokenizer.json`, `tokenizer_config.json`, `vocab.json`, `merges.txt` | | copied from the base model |
|
| 73 |
+
|
| 74 |
+
## Serve it with vllm.cpp
|
| 75 |
+
|
| 76 |
+
Build the vllm.cpp server (`-DVLLM_CPP_SERVER=ON`, target `vllm-server`), then:
|
| 77 |
+
|
| 78 |
+
```sh
|
| 79 |
+
hf download mudler/kev-0.8b-vllm-cpp --revision c17e73666ded1e9d284470eae7e0de9a27294e77 --local-dir kev-0.8b-vllm-cpp
|
| 80 |
+
build/examples/vllm-server --model kev-0.8b-vllm-cpp --served-model-name kev --port 8000
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
The server logs `kev decision model (KevModel); serving /v1/systemone`.
|
| 84 |
+
|
| 85 |
+
## Serve it with LocalAI
|
| 86 |
+
|
| 87 |
+
A model config for LocalAI's `vllm-cpp` backend:
|
| 88 |
+
|
| 89 |
+
```yaml
|
| 90 |
+
name: kev-0.8b
|
| 91 |
+
backend: vllm-cpp
|
| 92 |
+
known_usecases:
|
| 93 |
+
- decisions
|
| 94 |
+
parameters:
|
| 95 |
+
model: mudler/kev-0.8b-vllm-cpp
|
| 96 |
+
artifacts:
|
| 97 |
+
- name: model
|
| 98 |
+
target: model
|
| 99 |
+
source:
|
| 100 |
+
type: huggingface
|
| 101 |
+
repo: mudler/kev-0.8b-vllm-cpp
|
| 102 |
+
revision: c17e73666ded1e9d284470eae7e0de9a27294e77
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
Then send the same request body to LocalAI's `POST /v1/systemone` with
|
| 106 |
+
`"model": "kev-0.8b"`.
|
| 107 |
+
|
| 108 |
+
## Example
|
| 109 |
+
|
| 110 |
+
Request (served on CPU from this exact directory, 2026-09-30):
|
| 111 |
+
|
| 112 |
+
```sh
|
| 113 |
+
curl http://localhost:8000/v1/systemone -H 'Content-Type: application/json' -d '{
|
| 114 |
+
"model": "kev",
|
| 115 |
+
"state": "I was charged twice for my subscription this month. Please refund the duplicate payment.",
|
| 116 |
+
"questions": {
|
| 117 |
+
"refund": {"type": "noul", "instructions": "Does the user request a refund?"},
|
| 118 |
+
"department": {"type": "choice", "instructions": "Which department should handle this?",
|
| 119 |
+
"criteria": {"billing": "Payments and refunds", "technical": "Software bugs", "sales": "New purchases"}},
|
| 120 |
+
"urgency": {"type": "score", "instructions": "How urgent is this?",
|
| 121 |
+
"criteria": ["Routine", "Urgent", "Emergency"]}}}'
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
Response (the `rl_agent` fields are omitted here):
|
| 125 |
+
|
| 126 |
+
```json
|
| 127 |
+
{
|
| 128 |
+
"answers": {
|
| 129 |
+
"department": {"type": "choice", "choice": "billing", "confidence": 0.9264,
|
| 130 |
+
"probabilities": {"billing": 0.951, "sales": 0.0264, "technical": 0.0227}},
|
| 131 |
+
"refund": {"type": "noul", "noul": 0.9667},
|
| 132 |
+
"urgency": {"type": "score", "score": 0.7069, "confidence": 0.7244,
|
| 133 |
+
"legend": {"0": "Routine", "1": "Urgent", "2": "Emergency"},
|
| 134 |
+
"probabilities": {"0": 0.4222, "1": 0.4487, "2": 0.1291}}
|
| 135 |
+
},
|
| 136 |
+
"model": "kev",
|
| 137 |
+
"usage": {"input_tokens": 111, "output_tokens": 0},
|
| 138 |
+
"latency_ms": 2451.45
|
| 139 |
+
}
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
kev's answer semantics follow the kev reference: `choice` confidence is
|
| 143 |
+
`(max(p) - 1/K) / (1 - 1/K)`, `score` is the expected level index with
|
| 144 |
+
confidence `1 - E|level - mode| / (L - 1)`, `noul` is `p(true)`, and
|
| 145 |
+
probabilities are rounded to 4 decimals in this response.
|
| 146 |
+
|
| 147 |
+
## What was verified and what was not
|
| 148 |
+
|
| 149 |
+
Verified for this upload:
|
| 150 |
+
|
| 151 |
+
- The conversion above ran at the stated vllm.cpp commit and merged all 186
|
| 152 |
+
LoRA modules.
|
| 153 |
+
- The directory loads in the vllm.cpp CPU server built from the same commit,
|
| 154 |
+
and the one request above returns the answers shown. The answers are
|
| 155 |
+
plausible for the input. This is a smoke test, not an accuracy measurement.
|
| 156 |
+
|
| 157 |
+
Recorded by the vllm.cpp project, not re-measured for this upload:
|
| 158 |
+
|
| 159 |
+
- PointerHead golden-vector tests (25 cases) and LoRA-merge / hidden-state
|
| 160 |
+
goldens against the kev Python reference at
|
| 161 |
+
`jaredpalmer/kev@19dcae9b6e3e1a48200c5825aad9fc200d31e20a`.
|
| 162 |
+
- A 5-case end-to-end comparison (choice 2 and 3 options, score 5 levels,
|
| 163 |
+
noul, multi-question) against the kev reference server, recorded as equal.
|
| 164 |
+
|
| 165 |
+
Not verified:
|
| 166 |
+
|
| 167 |
+
- No GPU (CUDA, ROCm, Metal) run of this checkpoint.
|
| 168 |
+
- No comparison of this upload against the kev reference server. No vLLM
|
| 169 |
+
gate exists for kev, because vLLM does not serve this architecture.
|
| 170 |
+
- No accuracy benchmark.
|
| 171 |
+
- No GGUF or quantized variant.
|