Repository navigation
Description
What FLM does (v1.0.11, the spec)
A new decision model class — the Decision 3.0 (d3) family from vLLM Semantic Router — served through a
dedicated endpoint. It does not generate text. You send a state (any JSON) and one or more questions,
and it returns a probability for every option:
POST /v1/systemone(aliasPOST /v1/decisions) — answers decision requests.GET /v1/systemone/models— lists the decision models the build can serve.- question kinds:
choice(pick one of up to 255 options),noul(no / yes),score(2 to 10
ordered levels). - Input limit 32,768 tokens per question; a longer prompt gets
max_length_exceededfor that question and
nothing is truncated. - Served alone (
flm serve --decision d3:lite) or beside a chat model
(flm serve qwen3.5:4b --decision d3:lite). The HTTP API is the same as the upstream d3 server, so vLLM
Semantic Router can use FLM as its d3 backend unchanged. - d3:turbo / d3:ultra: the state is computed once per request and every question reads it (2.5× faster at
16 questions, up to 32× with a 4k-token state); they also acceptbox/track/assetsquestions
(objects in images, follow through videos, images in questions/options/instructions); videos need FFmpeg
6/7/8 on the machine and get a clear 422 without it (frame lists{"frames": [...]}still work);
plan for ~28 GB free memory;long_context: trueis refused with 422. - Accuracy: every d3 size stays close to the upstream BF16 model on the Decision Index public suite.
What we do today
Nothing. grep -rn "systemone\|/v1/decisions" over the tree → no hits. The d3 packs we inventoried
(~/briefs/TUPSTREAM-STATE.md, item 1) are Qwen3.5 GDN backbones (12–64 layers) whose extra pieces our
loader ignores entirely: decision_config.json (question kinds, option limits, readout layout) and
readout.safetensors (the decision head). No catalog row exists for them, by design
(1bit-MONSTER/lemonade, TUPSTREAM item 3): d3 needs this endpoint first.
Smallest implementation
- Read the pack's decision metadata:
decision_config.json+readout.safetensorsnext to
model.q4nx, in a newnpu/decision.h— the readout is 1–5 MB, dense, and separable from the backbone
weights we already load (npu/model.cppreadsconfig.json+model.q4nxonly). - Endpoint:
POST /v1/systemonetaking{state, questions: [...]}→ one backbone prefill of the state,
then per question a readout over its option set and a softmax of the option logits;GET /v1/systemone/modelslists what the build can serve. Return the same JSON shape as the upstream d3 server
(that is the interop contract with vLLM Semantic Router). - Limits as exact checks: 32,768 tokens per question with
max_length_exceededper question (no
truncation), 255 options forchoice, 2–10 levels forscore. - First slice: text-only
choice+noul+scoreon d3:lite (0.8B, 0.62 GB), the smallest pack that
has all three.box/track/assets/video need the vision tower and FFmpeg — a separate issue.
The "state computed once per request" optimisation falls out of the prefix-cache work (the state KV is
exactly a cached prefix slot).
Refs: FLM v1.0.11 release notes ("Decision 3.0 (d3)"), https://fastflowlm.com/docs/models/d3/,
https://github.com/vllm-project/semantic-router. Packs: FastFlowLM/D3-{Lite,Nano,Mini,Turbo,Ultra,Flash,Edge}-NPU2
(base tags vllm-sr/d3-*), inventory in ~/briefs/TUPSTREAM-STATE.md.
No code before Sunday (2026-11-01 06:00 ADT).
Activity
census-watch: pin the Q4NX converter and the d3 source, and watch both
census-watch: pin the Q4NX converter and the d3 source, and watch both (
census-watch: a Q4NX pack for a family with no NPU route is an alert (#…
bong-water-water-bong commentedon Oct 31, 2026
Triage:
enhancement(a model-request blocker more than a feature — no d3 pack can enter the catalogwithout it). Confirmed absent at
origin/main31d52e1:Only the census half of this area landed:
#654(6c83ff13c) pins the d3 source and watches it move, whichis how the packs get noticed, not how they get served.
Held to Sunday 2026-11-01 06:00 ADT. Two things bound a first slice, and neither is the endpoint:
decision_config.json+readout.safetensorsare the whole specificationof question kinds and option limits, and the inventory in
~/briefs/TUPSTREAM-STATE.mditem 1 lists thepacks but no layout has been checked byte by byte here yet.
npu/model.cppreadsconfig.json+model.q4nxonly, so this is not "add a route": it is a second weight class (1–5 MB, dense) plus a readoutthat the backbone prefill feeds. Item 1 of the issue's plan is the small half; items 2–3 are the work.
Acceptance for a first PR, deliberately narrow:
GET /v1/systemone/modelslists the pack, and onechoicequestion with two options returns two probabilities that sum to 1 and match the reference readout within a
stated tolerance — not a full endpoint, and not the
box/track/assetskinds.Board row:
~/briefs/TISSUES-BOARD.md; lane request is ORCHESTRATOR item 2.bong-water-water-bong commentedon Nov 1, 2026
The conversion blocker is gone: #763 adds
tools/safetensors_to_q4nx.py(pack / verify / decision), the shared q4_1 packers extracted intotools/q4nx_pack.pyso both converters write identically, andnpu/decision.h— the readout head as a loader tensor class (logits()= W·h,probabilities_over()= temperature softmax over a question's options).Verified without hardware, including against the real pack:
vllm-sr/d3-lite's 1.04 MBreadout.safetensors+decision_config.jsonconvert todecision.q4nxand load as codes=255, hidden=1024, format=d3-code-readout-v1, prompt=d3, temp=1.00, with 255 probabilities summing to 1.000000 (a zero-mean state gives 0.0040 each = 1/255). ctestdecision_headandsafetensors_to_q4nxcover the arithmetic, the temperature, the refusals (non-F32 head, row/code mismatch, 255-option limit, missing files), sharded safetensors, and a bit-exact head round-trip.Next on this issue is
/v1/systemoneitself (endpoint, question kindschoice/noul/score, the 32,768-token per-question limit withmax_length_exceeded), on top of that class. Not yet done: a real 5.14 GB d3 backbone conversion — the backbone path is proven on synthetic fixtures, and the download is a deliberate separate step under the memory rule.bong-water-water-bong commentedon Nov 1, 2026
Second piece of the blocker chain is up: #765 — the d3 question/answer contract (
npu/systemone.h), checked byte for byte against the pack's ownd3_format.py.Nine committed fixtures (with the upstream revision in the file) cover choice/noul/score, null and JSON descriptions, unicode, explicit instructions, a null state — all nine prompts identical to
d3_format.user_prompt()'s output. Plus the option rules (1–255; score 2–10 distinct levels; 255 refused at 256), the answer shapes, upstream'sconfidence= 1 − H/log n, score's expected value, and the refusals.Two findings worth recording on this issue:
scorequestions are not ind3_format.py— they are rendered as a choice byd3_runtime.py, which also supplies the expected-value answer,confidenceandlegend; and the state's key order is part of the contract (upstream preserves the request's order), so an endpoint must parse the body as an ordered JSON, not a sorted map — a sorted object is a different prompt.Chain now in place: #763 safetensors→q4nx + the readout head loader, #765 the prompt/answer contract. What remains for this issue is the route itself: HTTP
POST /v1/systemone(+/v1/decisions,GET /v1/systemone/models), the backbone forward with last-position pooling, and the 32,768-token per-question limit withmax_length_exceeded.npu: the d3 question/answer contract, byte-equal to the pack's own d3…
tools: safetensors -> Q4NX converter + the d3 readout head loader (#653…
npu: the d3 question/answer contract, byte-equal to the pack's own d3…
npu: the d3 question/answer contract, byte-equal to the pack's own d3…
npu: the /v1/systemone decision route on the d3 contract (#653)
bong-water-water-bong commentedon Nov 1, 2026
Route landed as #775 (
1bit/npu-systemone-route,8a9afdc, basemainafter #765 merged as1d42bad).It serves
POST /v1/systemone(+/v1/decisions),GET /v1/systemone/models, and the decision head loads whendecision_config.json+decision.q4nxsit next tomodel.q4nx.Q4nxNpuForwardgainedlast_hidden()(the post-final-norm vector the LM head already reads), so pooling ispooling: lastwith no new maths.Everything in the envelope was copied from the pack's own
d3_server.py/d3_runtime.pyat2fc06364…, which is why it differs from this issue's sketch in three ways worth knowing:questionsis an object (id → question), and the ids come back as the keys ofanswers.usageis{input_tokens, output_tokens: 0},input_tokens= sum of the answered questions' prompt lengths.422 {"detail": {"invalid_questions": …}}and nothing runs; an over-limit question is an entry insideanswers(max_length_exceeded, nothing truncated) while the other questions still answer. These routes therefore use 422, not the chat route's 400 — the vLLM Semantic Router interop contract.Measured on a real forward with a synthetic 255×1024 readout (Qwen3-0.6B, host GEMM under
npu-hold, 0 amdxdna errors): choice/noul/score, three questions in one request,/v1/decisions, 422 unknown-field / invalid_questions /images, 401 withoutDECISION_API_KEY's bearer key, andmax_length_exceededat 34086 > 32768 beside an answered question.ctest systemone_route(30 assertions) +systemone_contract+decision_head+npu_samplingall pass.What this issue still needs is a real d3 backbone, and it is blocked in the converter, not the route — measured on the real
vllm-sr/d3-litepack:tools/safetensors_to_q4nx.py packassumes 2-D tensors and dies onlinear_attn.conv1d.weight [6144,1,4](too many values to unpack); the pack has 235 non-2-D tensors including a 5-D vision patch embed.language_model.*,linear_attn.in_proj_qkv/in_proj_a/in_proj_b/conv1d/dt_bias/norm/out_proj) where the engine loads llama.cpp-style names (model.*,qkv_proj/ssm_alpha_proj/ssm_beta_proj/ssm_conv1d/ssm_dt.bias/ssm_norm/ssm_out_proj).ggml-org/vllm-d3-lite-GGUF) isgeneral.architecture = qwen35, whichtools/gguf_to_q4nx.pydoes not accept (qwen3/qwen2 only).So no accuracy claim against upstream yet, and none is made. The 1.7 GB pack is on the box at
~/models/npu/d3-lite-srcfor whoever takes that piece next.npu: key a score answer by level index, as upstream does (#653)
npu: the /v1/systemone decision route on the d3 contract (#653) (#775)
npu: key a score answer by level index, as upstream does (#653) (#776)
bong-water-water-bong commentedon Nov 2, 2026
Closing evidence — the chain is merged and the route answers a d3 pack (host-side)
All four pieces are on
main(ebc1139at the time of this run):npu/decision.h)dcf4751f9npu/systemone.h, byte-equal to the pack'sd3_format.py)1d42bad64app/npu_systemone.h,POST /v1/systemone,/v1/decisions,GET /v1/systemone/models,last_hidden())e55096b8eByte-equal contract, checked rather than asserted.
ctest systemone_contractcompares the rendered prompt againstnine fixtures generated by the pack's own
d3_format.pyat revision2fc06364…, byte for byte — andctest systemone_routecompares the chat-template wrapper around those same user turns (the assistant turn opens withthe empty think block that
enable_thinking=Falseemits; those bytes are model input). Onmain: 4/4 pass(
systemone_contract,systemone_route,decision_head,npu_sampling), copyright rc 0.The route answering, on the merged
mainbinary (1bit forward-servebuilt fromebc1139,NPU_INFER_HOST_GEMM=1under an
npu-holdticket — host GEMM, no device opened, 0amdxdna.*ERRORafterwards):GET /health{"status":"ok","model":"d3-synth-0.6b","max_input_tokens":32768,"modalities":["text"],"authentication":true}GET /v1/systemone/models{"models":[{…,"max_input_tokens":32768,"modalities":["text"]}]}choiceover 2 options{"choice":"fast","confidence":0.685,"probabilities":{"cheap":0.0568,"fast":0.9431},"type":"choice"},usage {"input_tokens":97,"output_tokens":0}noulvia the/v1/decisionsalias{"noul":0.0461,"type":"noul"},input_tokens 90scoreover 3 levels{"score":0.0525,"confidence":0.810,"probabilities":{"0":0.949,"1":0.0492,"2":0.00167},"legend":{"0":"bad","1":"ok","2":"great"}}usage.input_tokens 269422 {"detail":"temprature not understood; a request may carry state, questions, model"}422 {"detail":{"invalid_questions":{"bad1":"…needs at least one option","bad2":"…is not served by this build"}}}, nothing ranimagesin the body422 "images: this build serves the text path only"DECISION_API_KEYset)401max_length_exceeded— 34086 > 32768 tokens, "nothing was truncated" — while the sibling question still answered (input_tokens 90)The envelope is upstream's, copied from
d3_server.py/d3_runtime.pyat2fc06364…:questionsis an object whoseids are the keys of
answers;usage.input_tokensis the sum over answered questions; a malformed question is a422 with nothing run, whereas an over-limit question is a per-question entry inside
answersand never atruncation.
What these numbers are and are not. The pack is d3-shaped —
decision.q4nxwritten bytools/safetensors_to_q4nx.py decision, adecision_config.jsonin the pack's format (d3-code-readout-v1, 255 codes,temperature 1.0,pooling last), the pack's own contract strings — and the head is loaded and used as a tensor classby the route. The readout weights in this run are synthetic (255×1024, random) and the backbone is Qwen3-0.6B, so
choice/scorehere have no meaning: what is proven is the route, the contract, the envelope and the plumbing, notaccuracy. No accuracy claim against upstream is made.
The real
vllm-sr/d3-litepack (1.7 GB, on this box at~/models/npu/d3-lite-src) still cannot be converted, and thereasons are measured, not guessed: the converter assumes 2-D tensors (the GDN
conv1dis[6144,1,4], 235 non-2-Dtensors in total), the pack carries HF names where the engine loads llama.cpp-style ones (the authority for the map is
already in the tree,
configs/q4nx/qwen3.5_0.8b.json), and the Hub GGUF isarch qwen35which our GGUF converterdoes not accept. Three transforms must be got right there (
A_log→ssm_ais F32 and negative, i.e.-exp(A_log), per the 27B GDN model on this box;conv1dneeds a transpose, not a flatten; alpha/beta are int8 tilesvs the config's Q8_0) and each of them fails silently if wrong.
@pi-issues — please close this if the evidence above satisfies the acceptance. The one item that legitimately
outlives it is tracked separately below, so closing #653 does not lose it.
Device line, exactly one thing: a real d3-lite row needs an ELF set for the 0.8B-GDN geometry (7 designs: QKV
1024×1536, O 1024×1024, GDN qkv 1024×6144, attn_gate 1024×2048, ssm_out 2048×1024, GU 1024×7168, D 3584×1024,
i.e. an AIE compile) — the engine asserts ELF existence even in host-GEMM mode, and with no such set the backbone
cannot be loaded at all; everything else on the road to that row (name map, the three transforms, numeric parity
against the pack's own
d3_runtime.py) is host-side and needs no device.bong-water-water-bong commentedon Nov 2, 2026
Closed on the route evidence — and the one item that does not close with it is now its own issue: #796.
I took the split rather than keeping this open, for the reason the lane stated itself: a synthetic-readout row is not a d3 pack, and this issue's subject is the endpoint. The real pack keeps its own acceptance in #796 so nothing is lost.
Verified on this side before closing (not taken from the comment):
main=ebc11395c, anddcf4751f9(#763),1d42bad64(#765),e55096b8e(#775) are all ancestors of it;npu/systemone.h,npu/decision.h,app/npu_systemone.h,tests/systemone_test.cppand the goldentests/golden/systemone/prompts.jsonare all present atmain, withsystemone_contractanddecision_headwired as ctest targets (CMakeLists.txt:467,479).What closes here, from the lane's measurements on
ebc1139:255 options, hidden 1024, d3-code-readout-v1, pooling last;POST /v1/systemone, the/v1/decisionsalias andGET /v1/systemone/modelsansweringchoice/noul/score, three questions in one request answered in request order;d3_server.py/d3_runtime.pyat2fc06364…:questionsas an object keyed by id,usage.input_tokenssummed over answered questions,422with nothing run for a malformed question, per-questionmax_length_exceededwith "nothing was truncated" beside a question that still answers,401underDECISION_API_KEY,422forimages;d3_format.pygenerated (ctest systemone_contract), plus the chat-template wrapper including the empty think block (enable_thinking=False), 4/4 ctest onmain.What I am explicitly not counting as met, and why this close is narrower than the acceptance I had written down: my board line said "a d3 pack answering". What ran is a d3-shaped pack with synthetic 255×1024 readout weights on a Qwen3-0.6B backbone — the route, contract, envelope and plumbing are proven, accuracy is not, and the lane makes no accuracy claim. The real
vllm-sr/d3-litepack cannot be converted or loaded yet. That work — the converter's 2-D limit (235 non-2-D tensors, GDNconv1das[6144,1,4]), the HF→llama.cpp name map, theqwen35GGUF, the three silently-failing transforms, and the 7-design 0.8B-GDN ELF set — is #796, and it is what stands between here and a real d3 row.No device number was produced for this issue and none is implied by this close.
registry: bump semantic-router to 9db2903 and list vllm-sr/d3.1-nano …
registry: review HYV4FlashForConditionalGeneration as a declined clas…
gpu-hold: reap a token that names no holder (#2880)
census: semantic-router moved 360ec173 -> 394b1490 - re-pin it, the S…