Instructions to use RinnRinnmini/qwen3-4b-agent-trajectory-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RinnRinnmini/qwen3-4b-agent-trajectory-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RinnRinnmini/qwen3-4b-agent-trajectory-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RinnRinnmini/qwen3-4b-agent-trajectory-lora") model = AutoModelForCausalLM.from_pretrained("RinnRinnmini/qwen3-4b-agent-trajectory-lora") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RinnRinnmini/qwen3-4b-agent-trajectory-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RinnRinnmini/qwen3-4b-agent-trajectory-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RinnRinnmini/qwen3-4b-agent-trajectory-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RinnRinnmini/qwen3-4b-agent-trajectory-lora
- SGLang
How to use RinnRinnmini/qwen3-4b-agent-trajectory-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 "RinnRinnmini/qwen3-4b-agent-trajectory-lora" \ --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": "RinnRinnmini/qwen3-4b-agent-trajectory-lora", "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 "RinnRinnmini/qwen3-4b-agent-trajectory-lora" \ --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": "RinnRinnmini/qwen3-4b-agent-trajectory-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RinnRinnmini/qwen3-4b-agent-trajectory-lora with Docker Model Runner:
docker model run hf.co/RinnRinnmini/qwen3-4b-agent-trajectory-lora
qwen3-4b-agent-trajectory-merged
This repository provides a MERGED (fully materialized) model created by merging a LoRA adapter into the base model:
- Base model: Qwen/Qwen3-4B-Instruct-2507
- Method: LoRA + Unsloth, then merge_and_unload() into full weights
✅ This repo contains the merged model weights.
You do NOT need PEFT / LoRA adapters at inference time.
Note: This is a derivative of the base model. Usage must comply with the base model's original terms.
What is included
- Full merged model weights (the LoRA adapter is already merged)
- Tokenizer / config files needed for inference
Training Objective
This model is trained to improve multi-turn agent task performance on agent-trajectory style data (e.g., ALFWorld household tasks and DBBench database operations, depending on the datasets listed below).
Loss is applied to all assistant turns in the multi-turn trajectories so the model learns: environment observation, action selection, tool use, and recovery from errors.
Training Configuration (summary)
- Base model: Qwen/Qwen3-4B-Instruct-2507
- Method: LoRA training (base loaded without 4-bit quantization), then merged into full weights
- Max sequence length: 2048
- Epochs: 2
- Learning rate: 1e-06
- LoRA: r=64, alpha=128
Usage
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "your_id/your-merged-repo"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
# (optional) generation example
inputs = tokenizer("Hello! What should I do next?", return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(out[0], skip_special_tokens=True))
- Downloads last month
- 1
Model tree for RinnRinnmini/qwen3-4b-agent-trajectory-lora
Base model
Qwen/Qwen3-4B-Instruct-2507