The Latest AIs, every day
AIs with the most favorites on Toolify
AIs with the highest website traffic (monthly visits)
AI Tools by Apps
Discover the Discord of AI
AI Tools by browser extensions
GPTs from GPT Store
Discover The Best Model For AI
Top AI lists by month and monthly visits.
Top AI lists by category and monthly visits.
Top AI lists by region and monthly visits.
Top AI lists by source and monthly visits.
Top AI lists by revenue and real traffic.

A QLoRA-fine-tuned adapter on Qwen2.5-7B-Instruct for financial sentiment classification , benchmarked directly against GPT-6 Luna and Claude Haiku 4.5 on identical test data.
The question this project answers: when does fine-tuning a small open model actually beat calling a frontier API for a narrow task — and by how much, on accuracy, latency, and cost?
Evaluated on a held-out test set of 227 examples from FinancialPhraseBank (all-agreement subset), using the identical prompt template and zero-shot for all frontier models (i.e. they were not fine-tuned — that asymmetry is intentional, see Limitations).
| Model | Macro F1 | Avg Latency (ms) | P95 Latency (ms) | Cost / 1,000 classifications |
|---|---|---|---|---|
| This model (QLoRA) | 0.9722 | 349.3 | 392.3 | $0.00 * |
| Claude Haiku 4.5 | 0.9252 | 800.1 | 1,003.8 | $0.2704 |
| GPT-6 Luna | 0.9248 | 1,031.1 | 1,477.0 | $0.068 |
* Local inference cost is amortized GPU/electricity cost, not a per-call API charge — not directly comparable to the hosted-API columns, but effectively negligible at this scale on consumer hardware (RTX 4060, 8GB VRAM).
Takeaway: the fine-tuned model matched or exceeded both frontier APIs on accuracy while being 2.3–3x faster per call and free to run at inference time, at the cost of being narrowly specialized to this one task.
Gemini was excluded from this comparison due to persistent Google Cloud billing-verification issues encountered during testing (see Limitations).
FinancialPhraseBank , all-agreement subset (sentences where all annotators agreed on the label) — 2,264 examples total.
Split with a fixed random seed for reproducibility.
Training and quantized local inference require an NVIDIA GPU with CUDA support.
This project was built and tested end-to-end on a single RTX 4060 Laptop GPU (8GB VRAM) under WSL2. The 4-bit quantization path relies on
bitsandbytes
, which is CUDA-specific.
bitsandbytes
has no functional Apple Silicon (Metal/MPS) support, so
BitsAndBytesConfig
will fail on a Mac.
BitsAndBytesConfig
entirely and using
device_map="mps"
(Apple Silicon) or
device_map="cpu"
. This needs considerably more memory (Qwen2.5-7B in fp16 needs roughly 15GB+ of unified memory/RAM, ideally 24GB+ for comfortable headroom) and runs slower without quantization.
max_seq_length
or LoRA rank further.
Training loss dropped from 3.32 to approximately 1.0 over the course of training; validation loss tracked closely with training loss throughout, with no signs of overfitting.
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
base_model_name = "Qwen/Qwen2.5-7B-Instruct"
adapter_name = "afzal2003/finllm-sentiment-qlora"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name, quantization_config=bnb_config, device_map="auto"
)
model = PeftModel.from_pretrained(base_model, adapter_name)
model.eval()
prompt = (
"Classify the sentiment of the following financial statement as "
"exactly one of: negative, neutral, positive.\n\n"
"Statement: The company reported record profits this quarter.\n\n"
"Sentiment:"
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=5, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
(The snippet above requires an NVIDIA GPU per the Hardware Requirements section. On a Mac or CPU-only machine, drop
quantization_config=bnb_config
and use
device_map="mps"
or
device_map="cpu"
instead.)
All models were evaluated on the same 227-example test set, using the identical prompt template shown above, with greedy/deterministic decoding where the API allowed it. Frontier models were called zero-shot via their respective APIs (OpenAI, Anthropic) — no fine-tuning or few-shot examples were provided to them, so this comparison measures this model's fine-tuned specialization against general-purpose models used out of the box , not two fine-tuned systems against each other.
gpt-6-luna
), Claude Haiku 4.5 (
claude-haiku-4-5-20251001
)
Full training and evaluation code (data preparation, QLoRA training script, evaluation harness) is available on GitHub: afzall003/finllm-sentiment-qlora .
If you use this adapter, please cite the base model and the FinancialPhraseBank dataset:
@article{malo2014good,
title={Good debt or bad debt: Detecting semantic orientations in economic texts},
author={Malo, Pekka and Sinha, Ankur and Korhonen, Pekka and Wallenius, Jyrki and Takala, Pyry},
journal={Journal of the Association for Information Science and Technology},
year={2014}
}
finllm-sentiment-qlora huggingface.co is an AI model on huggingface.co that provides finllm-sentiment-qlora's model effect (), which can be used instantly with this afzal2003 finllm-sentiment-qlora model. huggingface.co supports a free trial of the finllm-sentiment-qlora model, and also provides paid use of the finllm-sentiment-qlora. Support call finllm-sentiment-qlora model through api, including Node.js, Python, http.
finllm-sentiment-qlora huggingface.co is an online trial and call api platform, which integrates finllm-sentiment-qlora's modeling effects, including api services, and provides a free online trial of finllm-sentiment-qlora, you can try finllm-sentiment-qlora online for free by clicking the link below.
finllm-sentiment-qlora is an open source model from GitHub that offers a free installation service, and any user can find finllm-sentiment-qlora on GitHub to install. At the same time, huggingface.co provides the effect of finllm-sentiment-qlora install, users can directly use finllm-sentiment-qlora installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
