Jqweave 1.5B Real

Jqweave translates an English JSON-processing request plus representative input into a jq command. It is a LoRA fine-tune of Qwen2.5-Coder-1.5B-Instruct, merged into ordinary Transformers weights for local, offline inference. No API key is needed for inference.

Results

Greedy generation, one prediction per row. Valid means jq executes the command on the primary input. Correct requires exact output equality on the primary and second inputs. Only trailing special tokens are stripped; Markdown is not repaired.

Model Test valid Test correct
Jqweave 0.5B 100.0% (3900/3900) 100.0% (3900/3900)
Jqweave 1.5B Real 100.0% (3900/3900) 100.0% (3900/3900)

The test split contains 3900 grammar-generated rows from the same 39 task families as training, with different random records. It measures in-distribution behavior, not broad real-world competence. Input texts are disjoint, although 100 request/command pairs recur with new inputs. Full predictions and summaries are included under evaluation/.

Real-question generalization

The Jqweave Real Questions test set contains 50 manually reviewed tasks derived from unique Stack Overflow questions, with no input or request/command overlap with the synthetic data. These tasks were held out from training.

Model Real-question valid Real-question correct
Jqweave 0.5B 54.0% (27/50) 10.0% (5/50)
Jqweave 1.5B 62.0% (31/50) 12.0% (6/50)
Jqweave 1.5B Real 72.0% (36/50) 24.0% (12/50)

This small, high-vote sample is not representative of all jq use. Full predictions are included as evaluation/so-test.jsonl.

Independent frozen validation

The Jqweave Frozen Questions set contains 49 tasks from new source questions, disjoint from training and the development benchmark.

Model Frozen valid Frozen correct
Jqweave 1.5B 44.9% (22/49) 6.1% (3/49)
Jqweave 1.5B Real 46.9% (23/49) 20.4% (10/49)

Verified generation

Request: Please extract the value of the 'name' field.

{"id":396819,"name":"hana","username":"hana","category":"delta","status":"closed","score":8,"active":false,"password":"remove-me","_row_nonce":"select_field-1-a"}

Generated command:

jq '.name'

Executed output:

"hana"

Use

from jqweave.model import generate_command

command = generate_command(
    "Extract the value of the 'name' field.",
    '{"name":"delta","score":90}',
    "asterbraid/jqweave-1.5b-real",
)
print(command)

Or clone this repository for the CLI:

git clone https://huggingface.co/asterbraid/jqweave-1.5b-real
cd jqweave-1.5b-real
pip install -e '.[model]'
printf '%s' '{"name":"delta","score":90}' | jqweave "Extract the value of the 'name' field."

Python 3.10+ and jq are required. Add --run to print the command to stderr and execute it with the included safety guard.

GGUF and Ollama

Quantized builds:

  • jqweave-1.5b-real.Q4_K_M.gguf
  • jqweave-1.5b-real.Q8_0.gguf

For Ollama, run ollama create jqweave-1.5b-real -f Modelfile from this repository and follow OLLAMA.md. For llama.cpp, run llama-server -m jqweave-1.5b-real.Q4_K_M.gguf --host 127.0.0.1 --port 8080.

The Q4_K_M build passed a real llama-completion generation smoke check.

CPU performance

Measured with 8 CPU threads, five identical short generations, and deterministic decoding. Cold total includes model initialization but not network downloads. Warm median is the median of five generations after the first. Peak memory is process RSS. GGUF uses a persistent llama-server.

Format Cold total Warm median Peak memory
Transformers 50.90s 4.70s 9.53 GiB
Q4_K_M GGUF / llama.cpp 9.99s 0.62s 1.68 GiB

Environment: Transformers 5.17.0, torch 2.14.0+cu130, llama.cpp 1f1e6cb26a478c772d8d1c1d456f62ecd1a3be6c. These are short-request measurements, not a throughput benchmark. Raw results and scripts are under evaluation/.

Training

  • Base: Qwen/Qwen2.5-Coder-1.5B-Instruct (Apache-2.0).
  • Data: all 31,200 synthetic training rows plus 996 repetitions of 83 real-training examples from disjoint source questions.
  • Method: LoRA rank 32, alpha 64, dropout 0.05, targeting attention and MLP projections; adapter merged after training.
  • Schedule: one epoch, cosine decay, learning rate 5e-05, effective batch size 64, maximum sequence length 1024.
  • Precision: FP32 optimization for numerical stability, BF16 export, non-fused AdamW, maximum gradient norm 0.5.

Every reference command in the dataset was executed on two inputs with jq 1.6. Full settings are in training_config.json.

Execution and safety

The model emits text only. The optional CLI and Space execute commands with jqweave.execution.run_jq, which accepts only jq on stdin/stdout and rejects filenames, additional options, modules, environment access, and additional inputs. CPU, memory, file-size, and wall-clock limits are applied. Review generated commands before use; a valid command can implement the wrong request.

Limitations

English only and single-input jq. No filenames, modules, environment access, or additional inputs. The test set is synthetic and in-distribution, so it does not establish broad real-world accuracy. Outputs can be sensitive to request phrasing, so prefer explicit operations, fields, and values.

License and attribution

Code and merged weights are Apache-2.0. See LICENSE and NOTICE. Synthetic training data is CC-BY-4.0; real Stack Overflow-derived training data is CC-BY-SA-4.0 with attribution in the linked datasets.

Downloads last month
2,555
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for asterbraid/jqweave-1.5b-real

Quantized
(223)
this model

Datasets used to train asterbraid/jqweave-1.5b-real

Collection including asterbraid/jqweave-1.5b-real