Instructions to use Cheng-1/agenttune-qwen2.5-3b-react-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Cheng-1/agenttune-qwen2.5-3b-react-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "Cheng-1/agenttune-qwen2.5-3b-react-lora") - Transformers
How to use Cheng-1/agenttune-qwen2.5-3b-react-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Cheng-1/agenttune-qwen2.5-3b-react-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Cheng-1/agenttune-qwen2.5-3b-react-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Cheng-1/agenttune-qwen2.5-3b-react-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Cheng-1/agenttune-qwen2.5-3b-react-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Cheng-1/agenttune-qwen2.5-3b-react-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Cheng-1/agenttune-qwen2.5-3b-react-lora
- SGLang
How to use Cheng-1/agenttune-qwen2.5-3b-react-lora 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 "Cheng-1/agenttune-qwen2.5-3b-react-lora" \ --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": "Cheng-1/agenttune-qwen2.5-3b-react-lora", "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 "Cheng-1/agenttune-qwen2.5-3b-react-lora" \ --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": "Cheng-1/agenttune-qwen2.5-3b-react-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Cheng-1/agenttune-qwen2.5-3b-react-lora with Docker Model Runner:
docker model run hf.co/Cheng-1/agenttune-qwen2.5-3b-react-lora
AgentTune: Qwen2.5-3B ReAct Agent LoRA
QLoRA fine-tuned adapter that teaches Qwen2.5-3B-Instruct multi-step agent reasoning using the ReAct (Thought โ Action โ Observation โ Answer) framework.
Key Results
| Metric | Zero-Shot | Fine-Tuned | Improvement |
|---|---|---|---|
| Task Success Rate | 93.3% | 100% | +6.7% |
| Tool Selection Accuracy | 30.0% | 100% | +70.0% |
| Exact Tool Match | 30.0% | 100% | +70.0% |
Training Details
- Method: QLoRA (4-bit NF4, double quantization)
- LoRA rank / alpha: 16 / 32
- Target modules: All attention + MLP projections
- Training samples: 500 ReAct trajectories
- Epochs: 3
- Learning rate: 2e-4 (cosine schedule)
- Training time: ~10 minutes on L4 GPU
- Final loss: 0.419
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
model = PeftModel.from_pretrained(base_model, "Cheng-1/agenttune-qwen2.5-3b-react-lora")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
Links
- GitHub: XIECHENG6/agenttune
- Phase 1 (Single-turn tool use): XIECHENG6/small-llms-tool-use
- Downloads last month
- 3