Instructions to use mainger/mainger-qwen2.5-1.5b-ft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mainger/mainger-qwen2.5-1.5b-ft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mainger/mainger-qwen2.5-1.5b-ft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mainger/mainger-qwen2.5-1.5b-ft") model = AutoModelForCausalLM.from_pretrained("mainger/mainger-qwen2.5-1.5b-ft") 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
- vLLM
How to use mainger/mainger-qwen2.5-1.5b-ft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mainger/mainger-qwen2.5-1.5b-ft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mainger/mainger-qwen2.5-1.5b-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mainger/mainger-qwen2.5-1.5b-ft
- SGLang
How to use mainger/mainger-qwen2.5-1.5b-ft 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 "mainger/mainger-qwen2.5-1.5b-ft" \ --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": "mainger/mainger-qwen2.5-1.5b-ft", "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 "mainger/mainger-qwen2.5-1.5b-ft" \ --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": "mainger/mainger-qwen2.5-1.5b-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mainger/mainger-qwen2.5-1.5b-ft with Docker Model Runner:
docker model run hf.co/mainger/mainger-qwen2.5-1.5b-ft
mainger-qwen2.5-1.5b-ft
Fine-tuned Qwen2.5-1.5B-Instruct for the mainger-agent — an LLM agent that
drives the mainger R package for Mahalanobis-integrated regression under
privacy constraints.
This is an anonymous release accompanying a submission to STAIX 2026.
Intended use
Tool-calling assistant for the mainger-agent: parses user requests about external-data integration, selects a sharing regime (full / partial / restricted), calls into the R package via the agent's tool layer, and explains the returned diagnostics. Not intended as a general-purpose chat model.
How to load
The model was fine-tuned with LoRA and the adapter has been merged into the base weights, so it loads exactly like any Qwen2.5-1.5B checkpoint:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"mainger/mainger-qwen2.5-1.5b-ft",
torch_dtype="bfloat16",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("mainger/mainger-qwen2.5-1.5b-ft")
Serving with vLLM (extended 65k context)
The agent uses YaRN rope-scaling to extend the native 32k context to 65k.
Tool calling uses the hermes parser:
vllm serve mainger/mainger-qwen2.5-1.5b-ft \
--served-model-name qwen-1.5b-ft \
--max-model-len 65536 \
--rope-scaling '{"rope_type":"yarn","factor":2.0,"original_max_position_embeddings":32768}' \
--enable-auto-tool-choice \
--tool-call-parser hermes \
--dtype bfloat16 \
--gpu-memory-utilization 0.85
Note on the rope-scaling key. The JSON uses
"rope_type"(not"type"). HF transformers ≥ 4.45 renamed the field; vLLM ≥ 0.6.6 follows the new convention. Older vLLM or transformers may still accept"type"; on a mismatched pair you'll seeKeyError: 'rope_type'at startup.
Compatible toolchain pin
vLLM 0.6.6.post1 expects transformers == 4.47.x. With a newer transformers
the tokenizer call all_special_tokens_extended is missing and vLLM crashes
on startup. Pin the matching pair:
pip install "vllm>=0.6,<0.7" "transformers==4.47.1"
Training
- Base model: Qwen/Qwen2.5-1.5B-Instruct
- Method: LoRA fine-tuning, merged back into base weights
- Precision: BF16
- Task: Tool-calling for the mainger-agent's R-package interface
Reproducibility
The agent that uses this model fixes cv_seed = 548 when calling
mainger::mainger(..., tuning = "cv", cv_seed = 548), producing
bit-identical integration results across machines.
License
Apache 2.0 (inherited from Qwen2.5-1.5B-Instruct).
- Downloads last month
- 38