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
Table with columns: Property, Value| 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
Table with columns: Metric, Base Model, Fine-Tuned| 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
The model is trained to generate structured JSON-RPC calls for tools such as:
calculate_kpis
generate_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.py
services/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.jsongeneration_config.jsonmodel.safetensorstokenizer.jsontokenizer_config.jsonchat_template.jinjaREADME.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