Instructions to use MRaviteja/qwen2.5-3b-toolcalling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MRaviteja/qwen2.5-3b-toolcalling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MRaviteja/qwen2.5-3b-toolcalling") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MRaviteja/qwen2.5-3b-toolcalling") model = AutoModelForCausalLM.from_pretrained("MRaviteja/qwen2.5-3b-toolcalling", device_map="auto") 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]:])) - PEFT
How to use MRaviteja/qwen2.5-3b-toolcalling with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MRaviteja/qwen2.5-3b-toolcalling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MRaviteja/qwen2.5-3b-toolcalling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MRaviteja/qwen2.5-3b-toolcalling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MRaviteja/qwen2.5-3b-toolcalling
- SGLang
How to use MRaviteja/qwen2.5-3b-toolcalling 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 "MRaviteja/qwen2.5-3b-toolcalling" \ --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": "MRaviteja/qwen2.5-3b-toolcalling", "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 "MRaviteja/qwen2.5-3b-toolcalling" \ --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": "MRaviteja/qwen2.5-3b-toolcalling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MRaviteja/qwen2.5-3b-toolcalling with Docker Model Runner:
docker model run hf.co/MRaviteja/qwen2.5-3b-toolcalling
Qwen2.5-3B Business Tool-Calling
A fine-tuned version of Qwen2.5-3B-Instruct optimized for structured tool calling, business analytics, and robust reasoning over noisy real-world tabular data.
Unlike the base model, this version focuses on producing schema-valid JSON tool calls, handling inconsistent CSV structures, and performing multi-step KPI calculations with significantly higher reliability.
Highlights
- 🧠 Fine-tuned using Supervised Fine-Tuning (SFT) + QLoRA (PEFT)
- 📊 Optimized for business analytics workflows
- 🔧 Reliable JSON-RPC tool invocation
- 📁 Handles noisy and malformed CSV schemas
- ⚡ 4-bit quantized inference support
- 🤖 Designed for MCP (Model Context Protocol) tool integration
Model Details
| Property | Value |
|---|---|
| Base Model | Qwen2.5-3B-Instruct |
| Fine-tuning | SFT + QLoRA |
| Framework | PyTorch |
| Libraries | Transformers, PEFT, TRL |
| Intended Use | Tool Calling, Business Analytics, KPI Reasoning |
| Quantization | 4-bit inference supported |
Motivation
Large language models frequently struggle with structured business data because real-world datasets are rarely clean.
Common failure modes include:
- malformed JSON tool calls
- incorrect function arguments
- hallucinated fields
- broken numerical reasoning
- inability to adapt to inconsistent column names
This project fine-tunes Qwen2.5-3B to improve reliability on these tasks while maintaining low inference latency.
Training
Fine-tuning Method
- Supervised Fine-Tuning (SFT)
- QLoRA parameter-efficient adaptation
- Hugging Face Transformers
- PEFT
- TRL
- PyTorch
Synthetic Data Pipeline
Training data was generated to simulate real-world business datasets by introducing:
- inconsistent column names
- missing values
- malformed schemas
- noisy numerical data
- adversarial table layouts
- ambiguous KPI requests
The objective was to improve robustness against inputs that commonly cause tool-calling failures.
Evaluation
Evaluation was performed on a held-out adversarial benchmark containing noisy business documents and malformed tabular schemas.
Results
| Metric | Base Model | Fine-Tuned |
|---|---|---|
| Function-calling Schema Compliance | 81.2% | 99.6% |
| Reasoning / Output Failures | Baseline | 76% Reduction |
| Inference Latency | — | <3.2 s |
Intended Use
This model is designed for applications involving:
- Business Intelligence
- KPI Calculation
- Financial Reporting
- Dashboard Generation
- CSV Analysis
- Structured Tool Calling
- Agentic AI Workflows
- MCP-based Systems
Tool Calling
The model is trained to generate structured JSON-RPC calls for tools such as:
calculate_kpisgenerate_chart
Example:
{
"tool": "calculate_kpis",
"arguments": {
"metrics": [
"Revenue",
"Profit Margin",
"YoY Growth"
]
}
}
Example
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "MRaviteja/qwen2.5-3b-toolcalling"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto"
)
Integration
This model was developed as the reasoning engine for an MCP-powered analytics platform.
It integrates directly with:
services/mcp_service.pyservices/tool_service.py
If the fine-tuned weights are unavailable, the application gracefully falls back to an Ollama-hosted model without requiring changes to the surrounding tool pipeline.
Repository Contents
config.json
generation_config.json
model.safetensors
tokenizer.json
tokenizer_config.json
chat_template.jinja
README.md
Limitations
Although optimized for structured tool calling, this model:
- is not intended as a general-purpose reasoning benchmark
- has primarily been evaluated on business analytics workflows
- may require additional fine-tuning for domains outside structured enterprise data
Citation
If you use this model in research or production, please cite this repository.
@misc{qwen-business-toolcalling,
title={Qwen2.5-3B Business Tool Calling},
author={Raviteja},
year={2026},
publisher={Hugging Face}
}
Acknowledgements
- Alibaba Qwen Team
- Hugging Face Transformers
- PEFT
- TRL
- PyTorch
- Downloads last month
- 18