Run this model with HF Jobs
Run QwenQKing/Prompt-R1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/QwenQKing/Prompt-R1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/QwenQKing/Prompt-R1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/QwenQKing/Prompt-R1. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/QwenQKing/Prompt-R1. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use QwenQKing/Prompt-R1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QwenQKing/Prompt-R1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QwenQKing/Prompt-R1")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QwenQKing/Prompt-R1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QwenQKing/Prompt-R1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QwenQKing/Prompt-R1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QwenQKing/Prompt-R1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/QwenQKing/Prompt-R1
- SGLang
How to use QwenQKing/Prompt-R1 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 "QwenQKing/Prompt-R1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QwenQKing/Prompt-R1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "QwenQKing/Prompt-R1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QwenQKing/Prompt-R1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use QwenQKing/Prompt-R1 with Docker Model Runner:
docker model run hf.co/QwenQKing/Prompt-R1
Update README.md
Browse files1Coming soon123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144# Prompt-R1: Enhancing LLM interaction on behalf of humans<div align="center">[](https://arxiv.org/abs/2511.01016)[](https://qwenqking.github.io/Prompt-R1/)[](https://github.com/QwenQKing/Prompt-R1)[](https://huggingface.co/datasets/QwenQKing/Prompt-R1)### **Prompt-R1**: Collaborative Automatic Prompting Framework via End-to-end Reinforcement Learning[📄 Paper](https://arxiv.org/abs/2511.01016) | [🚀 Quick Start](#quick-start-prompt-r1) | [💬 Contact](mailto:wenjinliu23@outlook.com)</div>---## Overview<div align="center"><img src="figs/fig1.png" width="80%"/></div>**Prompt-R1** has addressed a critical challenge in interacting with large language models (LLMs)—the inability of users to provide accurate and effective interaction prompts for complex tasks. **Prompt-R1** is an **end-to-end reinforcement learning (RL)** framework that enhances the performance of LLMs by facilitating **collaborative automatic prompting** between a small-scale LLM and a large-scale LLM. **Prompt-R1**, through **multi-turn prompt interaction**, significantly improves the generation quality and reasoning accuracy of large-scale LLMs, enabling better task-solving performance without requiring user expertise in prompt formulation.<div align="center"><img src="static/images/1-overview.png" width="90%"/></div>By integrating **collaborative prompting** and **reinforcement learning**, **Prompt-R1** offers a **plug-and-play framework** that supports both **inference** and **training** with **various large-scale LLMs** as the environment.## Experimental Results**Results of Different Large language models:**<div align="center"><img src="figs/fig3.png" width="100%"/></div>## Prompt-R1 Implementation### Install Environment```bashconda create -n promptr1 python==3.12 -yconda activate promptr1cd verlpip3 install -e .pip3 install vllm==0.8.3pip3 install flash-attn==2.7.4.post1 # Download: https://github.com/Dao-AILab/flash-attention/releasespip3 install FlagEmbedding faiss-cpupip3 install debugpy==1.8.0 "ray[default]" debugpy```### Dataset Preparation>Our datasets are in:```bashTraining Dataset: dataset\train_dataEvaluation Dataset: dataset\eval_data```### Quick Start: Prompt-R1### 1. To use closed source LLM, modify promptr1_agent\tool\tools\LLM-toolpy:```bashAPI_KEY = "your_api_key"MODEL = "model_name"BASE_URL = "url"```>Run:```bashnohup bash run_prompt-R1.sh > Prompt-R1_training.out &```### 2. Deploy an Open-Source Model Locally#### 1. Install vLLM and dependencies```bash# Create environmentconda create -n vllmapi python=3.12 -yconda activate vllmapi# Install dependenciespip3 install transformers accelerate huggingface_hubpip3 install vllm```#### 2. Start the OpenAI-compatible server:```bashnohup bash vllm_api.sh > api.out 2>&1 &```#### 3. To use closed source LLM, modify promptr1_agent\tool\tools\LLM-toolpy to call your local API:>Edit agent_r1/tool/tools/search_tool.py and set the local API endpoint and model name```bashbase_url = "http://<SERVER_IP>:8006/v1"```### Evaluation#### 1.Edit model_merge.sh and set the paths:```bashexport CHECKPOINT_DIR='checkpoints/Prompt-R1/Prompt-R1-qwen3-4b-gpt-4o-mini/global_step_320/actor'export HF_MODEL_PATH='./Qwen/Qwen3-4B'export TARGET_DIR='./merge_model/Prompt-R1_Qwen3-4B'```#### 2.Edit vllm_serve.sh:```bashexport MODEL_NAME='./merge_model/Prompt-R1_Qwen3-4B'```#### 3.Inference```bashpython inference.py```#### 4.Batch inference & Evaluation```bashpython batch_inference.pypython eval_scores.py```## BibTexIf you find this work is helpful for your research, please cite:```bibtex@misc{liu2025promptr1collaborativeautomaticprompting,title={Prompt-R1: Collaborative Automatic Prompting Framework via End-to-end Reinforcement Learning},author={Wenjin Liu and Haoran Luo and Xueyuan Lin and Haoming Liu and Tiesunlong Shen and Jiapu Wang and Rui Mao and Erik Cambria},year={2025},eprint={2511.01016},archivePrefix={arXiv},primaryClass={cs.CL},url={https://arxiv.org/abs/2511.01016},}```For further questions, please contact: wenjinliu23@outlook.com.## AcknowledgementThis repo benefits from [Agent-R1](https://github.com/0russwest0/Agent-R1), [R1-Searcher](https://github.com/RUCAIBox/R1-Searcher), [Graph-R1](https://github.com/LHRLAB/Graph-R1), and [Search-R1](https://github.com/RUCAIBox/R1-Searcher). Thanks for their wonderful works.
README.md+144-1