Instructions to use asterbraid/jqweave-1.5b-real-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use asterbraid/jqweave-1.5b-real-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="asterbraid/jqweave-1.5b-real-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("asterbraid/jqweave-1.5b-real-v2") model = AutoModelForCausalLM.from_pretrained("asterbraid/jqweave-1.5b-real-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use asterbraid/jqweave-1.5b-real-v2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M # Run inference directly in the terminal: llama cli -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M # Run inference directly in the terminal: llama cli -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Use Docker
docker model run hf.co/asterbraid/jqweave-1.5b-real-v2:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use asterbraid/jqweave-1.5b-real-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "asterbraid/jqweave-1.5b-real-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asterbraid/jqweave-1.5b-real-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/asterbraid/jqweave-1.5b-real-v2:Q4_K_M
- SGLang
How to use asterbraid/jqweave-1.5b-real-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "asterbraid/jqweave-1.5b-real-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asterbraid/jqweave-1.5b-real-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "asterbraid/jqweave-1.5b-real-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asterbraid/jqweave-1.5b-real-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use asterbraid/jqweave-1.5b-real-v2 with Ollama:
ollama run hf.co/asterbraid/jqweave-1.5b-real-v2:Q4_K_M
- Unsloth Desktop
- Pi
How to use asterbraid/jqweave-1.5b-real-v2 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "asterbraid/jqweave-1.5b-real-v2:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use asterbraid/jqweave-1.5b-real-v2 with Docker Model Runner:
docker model run hf.co/asterbraid/jqweave-1.5b-real-v2:Q4_K_M
- Lemonade
How to use asterbraid/jqweave-1.5b-real-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Run and chat with the model
lemonade run user.jqweave-1.5b-real-v2-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use asterbraid/jqweave-1.5b-real-v2 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use asterbraid/jqweave-1.5b-real-v2 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asterbraid/jqweave-1.5b-real-v2:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "asterbraid/jqweave-1.5b-real-v2:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Jqweave 1.5B Real v2
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.
- Synthetic data: asterbraid/jqweave-data
- Real training data: asterbraid/jqweave-real-train-data
- Demo: Jqweave Space
- Output contract: one bare
jqcommand with no filename, shell pipeline, Markdown, or explanation.
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 v2 | 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) |
| Jqweave 1.5B Real v2 | 78.0% (39/50) | 38.0% (19/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) |
| Jqweave 1.5B Real v2 | 59.2% (29/49) | 28.6% (14/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-v2",
)
print(command)
Or clone this repository for the CLI:
git clone https://huggingface.co/asterbraid/jqweave-1.5b-real-v2
cd jqweave-1.5b-real-v2
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-v2.Q4_K_M.ggufjqweave-1.5b-real-v2.Q8_0.gguf
For Ollama, run ollama create jqweave-1.5b-real-v2 -f Modelfile from this repository and follow OLLAMA.md. For llama.cpp, run llama-server -m jqweave-1.5b-real-v2.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 | 46.53s | 2.72s | 9.54 GiB |
| Q4_K_M GGUF / llama.cpp | 10.88s | 0.63s | 1.69 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 2,580 repetitions of 215 real-training examples covering 174 unique reviewed source tasks.
- 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
- -
Model tree for asterbraid/jqweave-1.5b-real-v2
Base model
Qwen/Qwen2.5-1.5B