Instructions to use ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned
Run Hermes
hermes
- MLX LM
How to use ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned", "messages": [ {"role": "user", "content": "Hello"} ] }'
ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned
Fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct for Indian Income Tax Return (ITR) structured JSON extraction. The LoRA adapter has been merged into the base model weights (fused model).
Model Details
- Base model: Qwen/Qwen2.5-1.5B-Instruct
- Fine-tuning method: LoRA (rank=16, scale=32, dropout=0.05)
- Framework: MLX-LM v0.31.3 (Apple Silicon)
- Task: Extract structured JSON from ITR documents (ITR-1, ITR-2, ITR-3, ITR-4)
- Training: 3 epochs, 1500 iterations, lr=2e-5 (cosine decay), batch size=1 with grad accumulation=4
- Developed by: Ligaments AI
Evaluation Results
Evaluated on 49 held-out ITR examples:
| Metric | Pass Rate |
|---|---|
| JSON Validity | 98.0% |
| Form Type Match | 98.0% |
| Numeric Sums Correct | 98.0% |
| Boolean Y/N Only | 98.0% |
| Date YYYY-MM-DD Format | 98.0% |
| State/Country Numeric Codes | 98.0% |
| No Round Numbers | 81.6% |
Usage
pip install mlx-lm
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("ligaments-dev/Qwen2.5-1.5B-Instruct-itr-finetuned")
sampler = make_sampler(temp=0.1)
messages = [
{"role": "system", "content": "You are an ITR JSON extraction assistant..."},
{"role": "user", "content": "<your ITR document text here>"}
]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=False
)
response = generate(model, tokenizer, prompt=prompt, sampler=sampler, max_tokens=4096, verbose=True)
Intended Use
- Extracting structured financial data from Indian ITR documents for MSME lending workflows
- Automating credit risk assessment pipelines
- Not intended for general-purpose tax advice or legal decisions
- Downloads last month
- 193
Model size
2B params
Tensor type
BF16
·
Hardware compatibility
Log In to add your hardware
Quantized