Skip to content

Template configurations

The built-in family that reads a checkpoint from a configuration instead of code (flide.formats.template): every field of its decision_config.json.

template

template: a decision checkpoint described by a configuration instead of code.

The configuration is the checkpoint's decision_config.json with "format_id": "flide-template-v1", or one that ships with Flide for a known checkpoint (formats/known/*.json, matched by its Hub repository, or by its own files and the fields of its own decision_config.json, or with "config" in its match, of its config.json). It says how the model is asked and read:

messages chat turns [{"role", "content"}], each content a Jinja template, rendered through the checkpoint's chat template with the generation prompt (thinking off unless "thinking" is true); "reply" is appended prompt instead of messages, one Jinja template for the whole prompt, no chat template labels a label set for every question type, or one per type {"choice": ..., "noul": ..., "score": ...}; a set is "A-Z+" (A to Z, then two-letter labels), "A-Z", "pairs" (two-letter labels only) or a list, or tiers [{"upto": 26, "labels": ...}, {"labels": ...}] chosen by the number of options; two-letter labels that are not one distinct token where they are read are left out, up to 256 labels a set label_ids the token ids of one label list, when the release fixed them; else each label's token after the prompt, or with "label_tokens": "standalone" the label encoded alone (one token that decodes back to it) label_forms several token forms per label, e.g. ["{label}", " {label}"]: each form that is one token alone is read and the label's logit is the log-sum-exp of its forms; a longer label is kept when its first form is new and is also its token after the prompt head "output" (the output head, with its soft cap unless "softcap" is false) or a safetensors file of readout rows, one per label ("head_key" names the tensor, "weight" by default) temperature one number, or one per question type ("choice", "noul", "score") over a "default"; a type's value {"a", "b"} makes it depend on the number of options n: log T = a + b ln n noul the order of a noul's two options in the prompt, of "false" and "true" (["false", "true"]) noul_text their descriptions when a request gives none attention "bidirectional": the checkpoint reads each question's whole prompt both ways in its full-attention layers (recurrent and sliding-window layers stay causal), so every question is a sequence of its own and nothing is shared (a request's images are read again in each); "causal" (the default) shares the state between questions; "prefix": the request, through the last occurrence of the text "prefix_ends", is read both ways and shared, and each question's tail after it one way; "blocks": the same shared prefix, with each question reading both ways within its own tail in the full-attention layers. Both shared-prefix modes are text only images {"min_pixels", "max_pixels"}: the model reads a request's images (data URLs or base64), ahead of the text of the last user turn as one image block each, resized by the checkpoint's processor within those bounds; without it images are refused. max_prompt_tokens counts the images' tokens midloop the checkpoint's recurrent depth (decision_config "midloop"): blocks of layers that run again inside the pass, each pass stepping from the stream that entered it (the backbone's set_midloop) types, max_options, max_prompt_tokens state the state as the prompt shows it, cut to a token budget: "text" (a Jinja template of state, the prompt reads it as state_text), "max_tokens", "min_tokens", "keep" ("head" or "tail", or one per state shape {"list": ..., "default": ...}) and "marks" (the text before and after the kept tokens, per side); while the longest prompt is over max_prompt_tokens the budget shrinks by the excess plus "slack", "tries" times A value "@file#a.b" is key a.b of that JSON file of the checkpoint. A checkpoint the match does not find (a copy in a directory of another name) is served with --format template --format-arg spec=.

Template variables: state, state_text, question (key, type, instructions, criteria, given: the fields the request wrote), options (label, key, description, index) in the prompt's order, questions (every question of the request, in its order, as question is). Filters: describe (a string as it is, anything else JSON), text (the same with compact separators) and json (indent, compact); test: matching(pattern); functions: refuse(message), which turns the request down, boundary(), where the text before and after is tokenized apart, and labels_for(type, n), the labels a question of that type and n options reads. Every question is its own prompt and the state comes first, so the questions fork where their prompts part. The answer is the softmax over the question's labels at the last prompt position, divided by the temperature of its type.