Instructions to use aiml8726737/personal-prompt-engineer-qwen1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use aiml8726737/personal-prompt-engineer-qwen1.5b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "aiml8726737/personal-prompt-engineer-qwen1.5b") - Transformers
How to use aiml8726737/personal-prompt-engineer-qwen1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aiml8726737/personal-prompt-engineer-qwen1.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aiml8726737/personal-prompt-engineer-qwen1.5b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aiml8726737/personal-prompt-engineer-qwen1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aiml8726737/personal-prompt-engineer-qwen1.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aiml8726737/personal-prompt-engineer-qwen1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aiml8726737/personal-prompt-engineer-qwen1.5b
- SGLang
How to use aiml8726737/personal-prompt-engineer-qwen1.5b 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 "aiml8726737/personal-prompt-engineer-qwen1.5b" \ --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": "aiml8726737/personal-prompt-engineer-qwen1.5b", "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 "aiml8726737/personal-prompt-engineer-qwen1.5b" \ --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": "aiml8726737/personal-prompt-engineer-qwen1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aiml8726737/personal-prompt-engineer-qwen1.5b with Docker Model Runner:
docker model run hf.co/aiml8726737/personal-prompt-engineer-qwen1.5b
- Personal Prompt Engineer (Qwen2.5-1.5B LoRA)
- Model Details
- Intended Use
- Example
- Training Dataset
- Training Configuration
- Evaluation
- Installation
- Usage
- Bypass torchao metadata version check across all environments
- 1. Hugging Face Repositories
- 2. Device Selection
- 3. Load Tokenizer & Base Model
- 4. Load Fine-Tuned Adapter
- 5. Create Standard Hugging Face Text-Generation Pipeline
- 6. Prompt Rewriter Function using Hugging Face Pipeline
- 7. Test Example
- Limitations
- License
- Citation
Personal Prompt Engineer (Qwen2.5-1.5B LoRA)
Personal Prompt Engineer is a QLoRA fine-tuned LoRA adapter built on Qwen2.5-1.5B-Instruct. It specializes in transforming short, vague, or incomplete prompts into structured, detailed, and execution-ready prompts while preserving the user's original intent.
Unlike a general chatbot, this model is designed to rewrite prompts, not answer them.
Model Details
| Property | Value |
|---|---|
| Base Model | Qwen2.5-1.5B-Instruct |
| Fine-tuning Method | QLoRA |
| Adapter Type | LoRA |
| Quantization | 4-bit NF4 |
| Framework | Transformers + PEFT |
| Primary Task | Prompt Rewriting |
Intended Use
The model is designed for:
- Prompt Engineering
- AI Assistants
- RAG Pipelines
- Workflow Automation
- Coding Assistants
- Content Generation
- Agentic AI Systems
Typical workflow:
User Prompt
↓
Personal Prompt Engineer
↓
Optimized Prompt
↓
GPT / Claude / Gemini / Llama / Qwen
Example
Input
make a react app with dark mode
Output
Create a modern React application with a responsive user interface that includes a dark/light mode toggle.
Requirements:
- Use React functional components.
- Implement state management using Context API.
- Persist theme preference in localStorage.
- Include accessible UI components.
- Follow clean project architecture.
- Provide complete source code with explanations.
Training Dataset
The adapter was fine-tuned on approximately 3,030 curated prompt rewriting examples spanning:
- Software Development
- Business
- Marketing
- Creative Writing
- Education
- Science
- Productivity
- General AI Prompting
Each example consists of:
- Instruction
- Draft Prompt
- Rewritten Prompt
Training Configuration
| Hyperparameter | Value |
|---|---|
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| LoRA Dropout | 0 |
| Optimizer | paged_adamw_8bit |
| Learning Rate | 2e-4 |
| Scheduler | Cosine |
| Epochs | 2 |
| Sequence Length | 512 |
| Batch Size | 4 |
| Gradient Accumulation | 4 |
| Effective Batch Size | 16 |
Evaluation
| Epoch | Training Loss | Validation Loss | Mean Token Accuracy |
|---|---|---|---|
| 1 | 1.1990 | 1.1171 | 74.08% |
| 2 | 0.9854 | 1.0420 | 76.45% |
The validation loss consistently decreased during training, indicating good convergence without obvious signs of overfitting.
Installation
pip install transformers peft accelerate bitsandbytes
Usage
import warnings warnings.filterwarnings("ignore")
Bypass torchao metadata version check across all environments
import importlib.metadata _orig_version = importlib.metadata.version def _mock_version(package_name, *args, **kwargs): if package_name == "torchao": return "1.0.0" return _orig_version(package_name, *args, **kwargs) importlib.metadata.version = _mock_version
import torch from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer from peft import PeftModel
1. Hugging Face Repositories
BASE_MODEL = "Qwen/Qwen2.5-1.5B-Instruct" LORA_ADAPTER = "aiml8726737/personal-prompt-engineer-qwen1.5b"
2. Device Selection
device = "cuda" if torch.cuda.is_available() else ("mps" if hasattr(torch.backends, "mps") and torch.backends.mps.is_available() else "cpu") dtype = torch.float16 if device in ["cuda", "mps"] else torch.float32
print(f"Loading Hugging Face Pipeline on {device.upper()}...")
3. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL) tokenizer.pad_token_id = tokenizer.eos_token_id
base_model = AutoModelForCausalLM.from_pretrained( BASE_MODEL, torch_dtype=dtype, device_map="auto" if device == "cuda" else None ) if device != "cuda": base_model = base_model.to(device)
4. Load Fine-Tuned Adapter
model = PeftModel.from_pretrained(base_model, LORA_ADAPTER)
5. Create Standard Hugging Face Text-Generation Pipeline
generator = pipeline( "text-generation", model=model, tokenizer=tokenizer, device_map="auto" if device == "cuda" else None )
SYSTEM_PROMPT = "You are an expert Personal Prompt Engineer. Your task is to rewrite vague user prompts into professional, execution-ready prompts."
6. Prompt Rewriter Function using Hugging Face Pipeline
def rewrite_prompt(draft_prompt: str) -> str: messages = [ {"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": f"Rewrite the following draft prompt into a professional, execution-ready prompt.\n\nDraft Prompt:\n<<>> {draft_prompt} <<>>"} ]
# Hugging Face Pipeline Execution
result = generator(
messages,
max_new_tokens=300,
temperature=0.7,
do_sample=True,
return_full_text=False
)
return result[0]["generated_text"]
7. Test Example
if name == "main": draft = "create a landing page for an AI agent app" print("\n" + "="*70) print("DRAFT PROMPT:") print(draft) print("="*70) print("\nREWRITTEN BY HUGGINGFACE PIPELINE:") print(rewrite_prompt(draft)) print("="*70)
Limitations
- Optimized for prompt rewriting rather than general question answering.
- Performance depends on the quality and diversity of the training data.
- May not generalize well to highly specialized domains absent from the training set.
License
This LoRA adapter is released under the Apache 2.0 License, consistent with the license of the base Qwen2.5 model.
Citation
@misc{personalpromptengineer2026,
title={Personal Prompt Engineer: QLoRA Fine-tuning for Prompt Rewriting},
author={Yashvardhan Agrawal},
year={2026},
howpublished={Hugging Face Model Hub}
}
- Downloads last month
- 91
Model tree for aiml8726737/personal-prompt-engineer-qwen1.5b
Evaluation results
- Validation Loss on Prompt Rewriter Datasetself-reported1.042
- Mean Token Accuracy on Prompt Rewriter Datasetself-reported76.450