FinEE Llama 8B - Indian Financial Entity Extractor
Model Description
FinEE Llama 8B is a fine-tuned version of Llama 3.1 8B Instruct, specialized for extracting financial entities from Indian banking messages (SMS, emails, statements).
Key Features
- π¦ Multi-Bank Support: HDFC, ICICI, SBI, Axis, Kotak, and 20+ Indian banks
- π³ All Transactions: UPI, NEFT, IMPS, Credit Card, EMI, Refunds
- π Multilingual: English, Hindi, Tamil, Telugu, Bengali, Kannada
- π Structured Output: Clean JSON with all entities
- β‘ Fast: <100ms per extraction (quantized)
Usage
With Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Ranjit0034/finee-llama-8b",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Ranjit0034/finee-llama-8b")
message = "HDFC Bank: Rs.2,500 debited from A/c XX1234 on 12-Jan-26. UPI:swiggy@ybl. Ref:123456789012"
prompt = f"""Extract financial entities from this message:
{message}
JSON:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
With MLX (Apple Silicon)
from mlx_lm import load, generate
model, tokenizer = load("Ranjit0034/finee-llama-8b")
output = generate(model, tokenizer, prompt, max_tokens=256)
print(output)
With FinEE Package
from finee import FinancialExtractor
extractor = FinancialExtractor(model="Ranjit0034/finee-llama-8b")
result = extractor.extract("HDFC Bank: Rs.2,500 debited...")
print(result)
# {'amount': 2500.0, 'type': 'debit', 'merchant': 'Swiggy', 'category': 'food'}
Output Schema
{
"amount": 2500.0,
"type": "debit",
"account": "1234",
"bank": "HDFC",
"date": "2026-01-12",
"reference": "123456789012",
"merchant": "Swiggy",
"vpa": "swiggy@ybl",
"category": "food",
"is_p2m": true
}
Training
- Base Model: meta-llama/Llama-3.1-8B-Instruct
- Training Data: 152K+ samples (finee-dataset)
- Method: LoRA fine-tuning (rank=16)
- Hardware: Apple M2 Ultra (MLX)
Benchmarks
| Metric | Score |
|---|---|
| Amount Accuracy | 99.2% |
| Type Accuracy | 98.5% |
| Merchant Detection | 92.3% |
| Category Accuracy | 88.7% |
| Overall F1 | 94.8% |
Limitations
- Optimized for Indian banking messages
- May not work well with non-Indian formats
- Requires structured input (not handwritten)
Related
- π¦ FinEE Package - Python library
- π Training Dataset
- π» GitHub
License
Apache 2.0
Model tree for Ranjit0034/finee-llama-8b
Base model
meta-llama/Llama-3.1-8B
Finetuned
meta-llama/Llama-3.1-8B-Instruct