nl2jq Qwen3.5-2B (GGUF)
A small model that turns a plain-English request about a JSON document into a jq program. It powers jsontalk, which runs the model fully in the browser.
Fine-tuned from Qwen/Qwen3.5-2B-Base, Copyright 2026 Alibaba Cloud, Apache 2.0. This is an independent fine-tune; Alibaba Cloud and the Qwen team have not reviewed or endorsed it.
What changed from the base model
- LoRA fine-tune for jq generation, merged into the base weights.
- Quantized to GGUF Q4_K_M (about 1.27 GB).
- Split into three shards of at most 512 MB. llama.cpp and wllama load the set from the first shard.
Versions
| files | training | notes |
|---|---|---|
nl2jq-qwen35-2000m-step6-final-q4_k_m-0000N-of-00003.gguf | step 6 | current; jq 1.8.2, wider builtin coverage, harder tasks |
nl2jq-qwen35-2000m-step5-final-q4_k_m-0000N-of-00003.gguf | step 5 | previous version, kept for older jsontalk releases |
nl2jq-qwen35-2000m-step4-final-q4_k_m-0000N-of-00003.gguf | step 4 | older version, kept for older jsontalk releases |
Step 6 against step 5 (greedy, Q4_K_M, jq 1.8.2, same tasks):
| suite | tasks | step 5 | step 6 |
|---|---|---|---|
| nl2jq-bench test | 400 | 0.730 | 0.877 |
| jq feature probe (all groups) | 378 | 0.209 | 0.558 |
| hard tasks | 220 | 0.209 | 0.545 |
| real user requests | 60 | 0.350 | 0.817 |
| product eval P0 (pooled) | 164 | 0.939 | 0.939 |
Step 6 drops the Target jq version line from the system message and targets jq 1.8.2.
Steps 4 and 5 were trained with the line - Target jq version 1.7.1. after the "The program is run as" rule; keep it when you run those files.
Prompt format
The model never sees the raw document, only a path index: the document's structure plus a few sample values.
It uses the chat template with thinking turned off (enable_thinking: false).
System message:
You translate a natural-language request into a single jq program.
Rules:
- Output ONLY the jq program text. No explanation, no code fences, no shell quoting.
- The program is run as: jq -c '<program>' on a JSON document matching the path index shown.
- The program must generalize: it is also tested on other documents of the same shape with different values, so never hardcode values from the index.
- If the request is genuinely ambiguous (two plausible fields, unclear value, unclear operation, or unclear output shape), do NOT guess: reply exactly
CLARIFY: <one short question that resolves the ambiguity>
Use this only when a reasonable reading cannot be picked; otherwise output the program.
User message:
Path index:
$ object
$.users array, count=2
...
Request: show only active users
The reply is either a jq program or a line starting with CLARIFY:.
Step 6 was scored with greedy decoding under a GBNF grammar that allows only real jq 1.8.2 builtins with their argument counts (syntax mode of the project's grammar).
Steps 4 and 5 shipped with a grammar that also limits object keys to those in the document.
Example
llama-server -m nl2jq-qwen35-2000m-step6-final-q4_k_m-00001-of-00003.gguf --jinja