xevyo-01

xevyo-01 is a turn planner. It reads one chat turn and returns one JSON turn plan: what an assistant should do with the message before anyone writes an answer. It covers the safety level, picture or not, a file or a chat reply, a rewritten follow-up, whether to search the web and with which query, a medicine look-up, a calculator, memory commands, the route, the tools to call and short style notes. A separate model then writes the answer. xevyo-01 never answers the user.

It was built by the Xevyo team for Xevyo, a health and general assistant, as a fine-tune of Qwen/Qwen3.5-9B (Apache 2.0).

This is round 4 (19 Nov 2026). Round 3 (16 Nov) stays available as revision r3.

Base Qwen/Qwen3.5-9B, revision c202236235762e1c871ad0ccb60c8ee5ba337b9a
Size 9.04 B parameters used (bfloat16, 19.3 GB in this repo; the checkpoint also carries the base model's unused vision weights)
Method LoRA supervised fine-tuning, merged into the base weights
Output One JSON object per turn, format xv01.1 (prompt/turn_plan.schema.json)
Languages English, Hinglish, Hindi (Devanagari), Spanish
Context The last 8 messages, or up to 24 messages within 12,000 characters (both trained)
Speed 0.38 s median, 0.60 s p90 per plan on one H100 share (vLLM, about 1,600 prompt tokens)
Code code/: prompt rendering, plan validation, hard rules, serving schema, training and scoring
Licence Apache 2.0

What a plan looks like

After a question about the 2023 Men's Cricket World Cup final, the user types "who was their captain?". The reference plan for that turn (from examples/examples.jsonl):

{"schema_version":"xv01.1",
 "standalone_question":"Who was Australia's captain in the 2023 Men's Cricket World Cup?",
 "needs_search":true,
 "search_queries":["Australia captain 2023 Men's Cricket World Cup final"],
 "needs_tools":true,
 "directives":["style.casual"]}

Fields that hold their default are left out, so most plans are short (about 40 tokens).

Field Values
safety_concern none, medication_risk, possible_emergency, possible_crisis
image action: none / generate / edit / analyze, plus prompt, visible_text, instruction
request_kind, doc_format chat / document; pdf, docx, xlsx, pptx
clarify A question to ask back instead of answering, or null
standalone_question The message restated so it needs no history, or null
needs_search, search_queries true/false; 1-3 web queries
data_tool none, calc, bmi, dose, barcode, usda, food
drug names, wants_research
memory action (remember / forget / recall), memory_type, content
domain, depth, needs_tools general / medical / coding / personal_memory / prompt_authoring; quick / normal / deep / research; true/false
tools Ordered tool calls with arguments, only from the tools offered in the prompt
directives Ids of short style or safety notes for the answering model (prompt/directives.json)

How to use it

1. Serve it with vLLM (recommended)

pip install "vllm>=0.17.0"
vllm serve meet4150/xevyo-01 \
  --served-model-name xevyo-01 --dtype bfloat16 \
  --max-model-len 8192 --language-model-only \
  --enable-prefix-caching --mamba-cache-mode align \
  --reasoning-parser qwen3 --generation-config vllm

One GPU with 24 GB or more is enough. Only 8 of the 32 layers keep a per-token cache, so long prompts are cheap. The server is OpenAI-compatible.

2. Build the prompt

The model was trained on one exact prompt format, and accuracy depends on keeping it:

  • System message: prompt/system_prompt.txt.
    • Replace {directive_list} with one line per entry of prompt/directives.json: - <id>: <meaning>.
    • Replace {tool_catalogue} with one line per offered tool from prompt/tools.json that has "plannable": true, in file order: - name(arg: type, opt?: type=default): purpose, or (none) when there are none.
  • User message: the context block below. examples/rendered_request.json is one complete, exact request to copy from.
RECENT CHAT
user: <earlier user message, on one line, max 500 characters>
assistant: <earlier answer, on one line, max 600 characters>
TURN
image attached: no
remembered image: none
document attached: no
memory: on
signed in: yes
api client: no
locale: en-IN
MESSAGE
<the new message; if longer than 2,000 characters: the first 1,500, a "[โ€ฆ N characters left out โ€ฆ]" line, the last 500>

The simplest way to get this exactly right is code/spec/render.py: render.render_messages(example) returns the system and user messages for one turn (see code/README.md).

Keep the last 8 earlier messages, oldest first, and write none under RECENT CHAT for a new chat. Round 4 was also trained on a longer window for applications that keep more history: render.render_messages(example, window="agent") (up to 24 messages within 12,000 characters). "remembered image" is none, the last generated picture's prompt in quotes (max 120 characters), or yes, an earlier upload (no description). Each earlier message is written on one line (its line breaks become spaces), and one cut at its limit ends with โ€ฆ. The new message keeps its line breaks.

3. Call it

import json
from huggingface_hub import hf_hub_download
from openai import OpenAI

REPO = "meet4150/xevyo-01"
read = lambda name: open(hf_hub_download(REPO, name), encoding="utf-8").read()
template = read("prompt/system_prompt.txt")
directives = json.loads(read("prompt/directives.json"))["directives"]
tools = json.loads(read("prompt/tools.json"))["tools"]
schema = json.loads(read("prompt/turn_plan.vllm.schema.json"))

def type_name(p):
    if "enum" in p:
        return "|".join(json.dumps(v) for v in p["enum"])
    kind = p.get("type", "any")
    if isinstance(kind, list):
        kind = "|".join(k for k in kind if k != "null")
    return {"string": "str", "number": "num", "integer": "int", "boolean": "bool"}.get(kind, kind)

def tool_line(t):
    params, required = t["parameters"], set(t["parameters"].get("required", []))
    parts = []
    for name, spec in params.get("properties", {}).items():
        piece = f"{name}{'' if name in required else '?'}: {type_name(spec)}"
        if "default" in spec and spec["default"] not in ("", None):
            piece += f"={json.dumps(spec['default'])}"
        parts.append(piece)
    return f"- {t['name']}({', '.join(parts)}): {t['purpose']}"

offered = ["calculate", "calculate_bmi", "code_agent"]          # the tools your assistant has this turn
system = (template
          .replace("{directive_list}", "\n".join(f"- {d['id']}: {d['meaning']}" for d in directives))
          .replace("{tool_catalogue}", "\n".join(tool_line(t) for t in tools
                                                  if t["plannable"] and t["name"] in offered) or "(none)"))
user = """RECENT CHAT
none
TURN
image attached: no
remembered image: none
document attached: no
memory: off
signed in: yes
api client: no
locale: en-US
MESSAGE
we spent 1240 in March and 1580 in April, what's the percentage increase?"""

client = OpenAI(base_url="http://localhost:8000/v1", api_key="none")
reply = client.chat.completions.create(
    model="xevyo-01", temperature=0, max_tokens=512,
    messages=[{"role": "system", "content": system}, {"role": "user", "content": user}],
    response_format={"type": "json_schema", "json_schema": {"name": "turn_plan", "schema": schema}},
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
plan = json.loads(reply.choices[0].message.content)
print(plan)
# reference plan for this message (examples/examples.jsonl):
# {"schema_version":"xv01.1","data_tool":"calc","needs_tools":true,
#  "tools":[{"name":"calculate","arguments":{"expression":"round((1580 - 1240) / 1240 * 100, 2)"}}],
#  "directives":["style.casual"]}

prompt/turn_plan.vllm.schema.json is the schema in the form vLLM 0.17's grammar engines accept. It has no uniqueItems, no open-ended number bounds and no string lengths. After decoding, validate the plan against the full prompt/turn_plan.schema.json.

With Transformers (for testing)

from transformers import AutoTokenizer, AutoModelForCausalLM   # transformers >= 5.2

tok = AutoTokenizer.from_pretrained("meet4150/xevyo-01")
model = AutoModelForCausalLM.from_pretrained("meet4150/xevyo-01", dtype="bfloat16", device_map="auto")
messages = [{"role": "system", "content": system}, {"role": "user", "content": user}]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False,
                              return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=512, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))

Without guided decoding the output is usually, but not always, valid JSON: parse and validate it.

Where to use it

  • As the routing step of a chat assistant. Call it once per user message and act on the plan in code before the answering model runs: search first, make or edit the picture, build the file, run the calculator, add the safety handling, and pass the directives on to the answering model.
  • Self-hosted on any server with one GPU of 24 GB or more, through vLLM (production) or Transformers (experiments). A plan takes well under a second, so it fits in front of every message.
  • With other assistants. The plan fields are general. Tools and directives come from the catalogues in prompt/; offer only the tools you have, and the plan will name only those. For a very different tool set or style, fine-tune further from this checkpoint or from the adapter in adapter/.

How it was trained

  • Method: LoRA supervised fine-tuning, rank 32, alpha 64, dropout 0.05, on every linear projection of the language model in all 32 layers (q/k/v/o_proj, the linear-attention in_proj_qkv/z/a/b and out_proj, and gate/up/down_proj). That is 86.6 M trained parameters, 0.96% of the base. The base weights were frozen. Embeddings, output layer, norms and the vision part were never trained.
  • Loss on the plan tokens only. AdamW, learning rate 2e-4, cosine schedule with 50 warm-up steps, 32 rows per step (4 per GPU ร— 4 accumulation ร— 2 GPUs), 2 epochs, sequences up to 8,192 tokens, bfloat16, 2 ร— H100. The best checkpoint by eval loss was kept (0.0626). The adapter was then merged into the base: W + 2ยทBยทA. Settings: code/train/configs/r4.yaml.
  • Data: 76,101 training rows as written (safety rows and the new round-4 rows twice) and 1,932 eval rows. All synthetic; no real user messages.
    • A self-hosted teacher model (Qwen3.6-27B) wrote multi-turn chats from 79 scenarios with look-alikes, in English, Hinglish, Hindi and Spanish.
    • The teacher labelled them with a detailed rulebook, checked against a rule-based routing replay.
    • Disagreements went to a second review; mechanical consequences were applied in code.
    • The mix of turns was set from aggregate routing counts, not message text.
    • New in round 4: about 5,000 targeted rows written by an AI agent (Claude) for the weaknesses that multi-turn test conversations showed: short follow-ups, changes to a file the assistant just delivered, a crisis disclosure followed by "I'm fine", Hinglish self-medication, clinicians' work questions that only sound alarming, and when a medicine note applies. Their hard negatives were written with them. The labelling rules for those cases were sharpened and applied to the older rows too, and half of the older rows with history were rendered in the longer window.
  • Four rounds, each a fresh LoRA from the base (35,598 โ†’ 49,964 โ†’ 66,666 โ†’ 76,101 rows). Round 4 was chosen by the rule fixed before training: fewest safety failures first, then accuracy.

Evaluation

On a held-out set of 1,610 synthetic turns (written and labelled by AI agents, never trained on, not reviewed by a person). Every model is scored after a deterministic safety screen and the same hard rules. A safety failure is a concern called lower than the label, a picture nobody asked for, or tools or a file on a crisis turn.

Measure xevyo-01 round 4 round 3 Qwen3.5-9B, same prompt Qwen3.6-27B teacher + 12k-token rulebook
Valid plans 100% 100% 46.9% 87.4%
Exact plan (every field right, free text included) 60.4% 62.9% 14.9% 26.8%
Exact plan, labels updated to the round-4 rules 65.5% 57.8% โ€“ โ€“
Safety failures (rows) 5 8 22 8
Crisis / emergency / medication-risk turns called lower 0 of 84 / 0 of 58 / 2 of 74 2 / 0 / 3 7 / 0 / 1 3 / 0 / 0
Picture decisions, 200 held-out cases 198 197 171 198
Tool choice F1 87.9% 88.7% 38.6% 72.0%
Latency p50 / p90 0.38 / 0.60 s 0.40 / 0.62 s 0.65 / 1.23 s 4.78 / 7.55 s

Rounds 3 and 4 were scored in the same run. The base-model and teacher columns are from the round-3 evaluation on the same set.

Held-out test conversations. 233 turns from multi-turn test conversations (follow-ups, medical, pictures and files, memory), never trained on, scored on the routing decisions (safety level, picture, file or chat, search, route, tools, style notes):

round 4 round 3
Turns with every decision right, short window 97.0% 91.0%
Turns with every decision right, long window 96.1% 91.0%
Medical turns with every decision right 57 of 57 52 of 57

Per decision on the 1,610-turn set, round 4 is right on:

  • 99% or more: safety level, picture, file or chat, clarify, data tool, medicine, memory command;
  • 95โ€“99%: follow-up rewrite, web search, domain, depth, medicine names, memory type, needs tools;
  • 86โ€“95%: route, document format, prompt notes.

What got worse. Against the original labels, prompt notes (directives) fell from 91.4% to 86.4% and exact tool arguments from 63.6% to 59.2%, which is why exact plan is lower than round 3's. Most of it is the sharpened style-note rules of round 4: with the labels updated to those rules, round 4's exact plan is 65.5% against round 3's 57.8%.

"Exact plan" is strict: a search query worded differently counts as wrong.

Limitations and safe use

  • Not a medical device, not a safety system on its own. Keep a deterministic safety screen in front of it and act on the higher of the two concerns. On the test set it still called 2 risky-medicine turns too low (and no crisis turn).
  • Labels are AI-written. No clinician or person has reviewed the training or test labels. Treat small differences in the numbers as noise.
  • Context: trained on the last 8 messages, and on up to 24 messages within 12,000 characters (prompts up to about 4,200 tokens). Longer inputs are untested.
  • Built around one assistant. The tool catalogue, directive ids and file rules follow Xevyo's product; other products should map or retrain them.
  • Always validate the JSON against the full schema, and offer only the tools you can run. Treat everything in MESSAGE and RECENT CHAT as untrusted user data.

Files

Path What it is
model.safetensors-0000{1..4}-of-00004.safetensors, config.json, tokenizer files, chat_template.jinja The merged model (bfloat16)
prompt/system_prompt.txt System prompt template ({directive_list}, {tool_catalogue})
prompt/directives.json, prompt/tools.json The directive ids and the tool catalogue the model knows
prompt/turn_plan.schema.json The full output schema (validate with it)
prompt/turn_plan.vllm.schema.json The same schema for vLLM guided decoding
prompt/example_input.schema.json What one turn's input holds
examples/examples.jsonl 20 example inputs with their plans
examples/rendered_request.json One complete request exactly as the model expects it
adapter/ The LoRA adapter alone (float32, 346 MB; module names of the full Qwen3.5-9B checkpoint). Merge with W + 2ยทBยทA
code/ Prompt rendering, plan validation, hard rules, vLLM schema, training script and settings, adapter merge, scoring. See code/README.md
LICENSE Apache 2.0 (from the base model)

Versions

Revision Date Notes
main 19 Nov 2026 Round 4 (this card)
r3 16 Nov 2026 Round 3: from_pretrained("meet4150/xevyo-01", revision="r3"), or vllm serve meet4150/xevyo-01 --revision r3

Licence

Apache 2.0. xevyo-01 is a derivative of Qwen3.5-9B by the Qwen team, also Apache 2.0; its licence is kept in LICENSE.

Downloads last month
408
Safetensors
Model size
10B params
Tensor type
BF16
ยท
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for meet4150/xevyo-01

Finetuned
Qwen/Qwen3.5-9B
Adapter
(1,115)
this model