Downloads · 30 days
6
18% of all-time downloads
tshaik1990/qwen3.5-2b-prompt-compiler
qwen3.5-2b-prompt-compiler is a text generation model from tshaik1990. Use it when you need the model to write or continue text. It is set up for peft.
A LoRA adapter fine-tuned on unsloth/Qwen3.5-2B that turns a short, underspecified request into a clear, structured, implementation-ready prompt — instead of answering the request directly.
Downloads · 30 days
6
18% of all-time downloads
All-time downloads
34
Public
Repo size
63.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors43.7 MB · 69%
From the Hugging Face model README
A LoRA adapter fine-tuned on unsloth/Qwen3.5-2B that turns a short, underspecified request into a clear, structured, implementation-ready prompt — instead of answering the request directly.
Example
| Input | Base model | This adapter |
|---|---|---|
should i rent or buy a home | Answers the question directly, or asks the user clarifying questions in chat form | Emits a structured prompt: "Ask for my location, budget, timeline... Compare renting and buying as a decision framework... with a clearly labeled summary." |
unsloth/Qwen3.5-2Bq/k/v/o_proj, gate/up/down_proj)unsloth 2026.8.22, transformers 5.2.0, trl 0.22.2, peft 0.20.0, torch 2.8.0Given a system prompt instructing the model to act as a prompt compiler, e.g.:
"You are a prompt compiler. Convert the user's request into a clear, structured, implementation-ready prompt while preserving all stated requirements."
...the model converts a terse user request into a well-specified prompt suitable for handing to a stronger model or downstream pipeline. It is trained to elicit missing context (ask for it) rather than invent facts, prices, or requirements that weren't given.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3.5-2B", device_map="auto")
model = PeftModel.from_pretrained(base, "tshaik1990/qwen3.5-2b-prompt-compiler")
tok = AutoTokenizer.from_pretrained("tshaik1990/qwen3.5-2b-prompt-compiler")
messages = [
{"role": "system", "content": "You are a prompt compiler. Convert the user's request into a clear, structured, implementation-ready prompt while preserving all stated requirements."},
{"role": "user", "content": "should i rent or buy a home"},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512, temperature=0.2, top_p=0.95, top_k=20)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
A quantized GGUF build (for Ollama / llama.cpp) is available at tshaik1990/qwen3.5-2b-prompt-compiler-GGUF.
Single epoch, 50 steps, on an instruction-style dataset of paired (raw request → compiled prompt) examples.
Evaluated on a 20-prompt held-out benchmark spanning categories such as coding, business, travel, financial research, and agent/tool-use safety, each prompt tagged with the specific failure mode it probes (e.g. missing_context, invented_requirements, destructive_action_safety).
Compared against the base model under identical sampling settings (temperature 0.2, top_p 0.95, top_k 20, same system prompt):
| Base | This adapter | |
|---|---|---|
| Avg. output length | 2775 chars | 1002 chars |
| Leaks meta-commentary ("Here is a prompt for...") | 55% | 0% |
| Opens with a role assignment ("You are an expert...") | 0% | 85% |
| Output includes an explicit "ask for X if missing" clause | 0% | 70% |
Shorter output on 18 of 20 benchmark prompts (avg. ~2.8x more compact); the model was also verified to reload correctly from a fresh checkpoint and reproduce the same behavior.
Inherits the license of the base model, unsloth/Qwen3.5-2B.