FinnAI 1.7B Bank SMS Parser (Merged Model)
This is a standalone, merged model built on top of finndot/finnai-slm-v4 (Qwen3-1.7B architecture) fine-tuned specifically for extracting structured financial transaction data from Indian bank SMS messages.
The model merges the base language model with domain-specific LoRA adapter weights, allowing direct standalone loading via Hugging Face transformers without needing PEFT or runtime adapter merging.
Model Details
- Base Model:
finndot/finnai-slm-v4(Qwen3 1.7B Causal LM) - Parameters: ~1.7 Billion
- Precision:
bfloat16 - Architecture:
Qwen3ForCausalLM - Tokenizer: Qwen tokenizer with ChatML / Jinja chat template support
- Context Length: Up to 40,960 tokens (optimized for concise single-turn SMS parsing)
Canonical Output Schema (8 Fields)
The model extracts key banking and transaction entities into a strictly formatted JSON object with eight fields:
| Field | Type | Description |
|---|---|---|
message_type | string | Transaction classification: "TRANSACTION", "BALANCE_ALERT", "DECLINED", "PROMOTIONAL", or "OTHER" |
amount | number | null | Transacted monetary value (e.g. 2450.00). Set to null if no transaction occurred |
transaction_type | string | null | Direction of funds: "DEBIT", "CREDIT", or null for balance inquiries/declines |
bank_name | string | null | Name of the financial institution (e.g., "HDFC Bank", "SBI", "ICICI Bank") |
account | string | null | Masked account suffix or identifier (preserved as string with leading zeros, e.g. "0211") |
transaction_date | string | null | Extracted or normalized transaction date/time string |
balance | number | null | Available post-transaction or reported account balance |
reference_number | string | null | Reference number, UPI Ref ID, UTR, or txn ID |
Intended Use & Financial Guardrails
This model is engineered for deterministic, high-precision extraction from unstructured SMS alerts:
- Amount vs. Balance Distinction: Rigorously keeps the transacted amount and the remaining balance separate.
- Direction Accuracy: Distinguishes debit vs. credit accurately according to standard Indian banking terminology.
- Non-Hallucination: Emits
nullfor missing or unspecified fields instead of inventing account numbers or amounts. - Alert Discrimination: Distinguishes actual debit/credit transactions from informational balance updates and card declines.
Inference Usage
Using Hugging Face Transformers (Python)
import json
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "YOUR_USERNAME/finnai-1.7b-bank-sms-parser"
# Load tokenizer and merged model
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model.eval()
# Input bank SMS
sms_text = "HDFC Bank: Rs. 2450.00 debited from A/c XX9087 on 23-Oct-2026. Avl Bal: Rs. 18250.75. Ref 629104821049"
# Format prompt using chat template
messages = [
{
"role": "system",
"content": (
"You are FinnAI, a specialized financial information extractor. "
"Extract structured JSON with keys: message_type, amount, transaction_type, "
"bank_name, account, transaction_date, balance, reference_number."
)
},
{"role": "user", "content": sms_text}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()
print("Model Output:", response)
Using Hugging Face Inference API / Endpoints (cURL)
curl -X POST https://api-inference.huggingface.co/models/YOUR_USERNAME/finnai-1.7b-bank-sms-parser \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inputs": "<|im_start|>system\nYou are FinnAI...<|im_end|>\n<|im_start|>user\nHDFC Bank: Rs 2450.00 debited...<|im_end|>\n<|im_start|>assistant\n",
"parameters": {
"max_new_tokens": 256,
"temperature": 0.01,
"return_full_text": false
}
}'
Training & Merging Details
- Base Architecture: Qwen3 1.7B base model (
finndot/finnai-slm-v4) - Adaptation: Low-Rank Adaptation (LoRA) on
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_projwith rank $r=16$ and scaling $\alpha=32$. - Merge Method: Direct linear weight fusion via
peft.PeftModel.merge_and_unload()inbfloat16. - Serialization: SafeTensors format (
model.safetensors, 3.22 GB).
Limitations
- Optimized primarily for English-language Indian bank notification formats (SMS/WhatsApp).
- Extremely truncated or corrupted SMS messages may fail to yield all 8 fields.
- Does not store, process, or transmit sensitive bank credentials; designed strictly for local or secure private endpoint inference.