Text Generation
PEFT
Safetensors
Transformers
Spanish
English
lora
banking
regulation
credit-risk
finance
spanish
conversational
Instructions to use kabesaml/regllm-qwen25-7b-banking-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kabesaml/regllm-qwen25-7b-banking-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "kabesaml/regllm-qwen25-7b-banking-lora") - Transformers
How to use kabesaml/regllm-qwen25-7b-banking-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kabesaml/regllm-qwen25-7b-banking-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kabesaml/regllm-qwen25-7b-banking-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kabesaml/regllm-qwen25-7b-banking-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kabesaml/regllm-qwen25-7b-banking-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kabesaml/regllm-qwen25-7b-banking-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kabesaml/regllm-qwen25-7b-banking-lora
- SGLang
How to use kabesaml/regllm-qwen25-7b-banking-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "kabesaml/regllm-qwen25-7b-banking-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kabesaml/regllm-qwen25-7b-banking-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "kabesaml/regllm-qwen25-7b-banking-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kabesaml/regllm-qwen25-7b-banking-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kabesaml/regllm-qwen25-7b-banking-lora with Docker Model Runner:
docker model run hf.co/kabesaml/regllm-qwen25-7b-banking-lora
RegLLM — Banking & Credit Risk Expert (LoRA adapter)
A LoRA adapter fine-tuned on top of Qwen/Qwen2.5-7B-Instruct for banking regulation and credit risk expertise.
What it does
This model specialises in:
- Spanish banking regulation: EBA Guidelines, CRR/CRD, Basel accords
- Credit risk methodology: PD/LGD/EAD estimation, IRB models, IFRS 9, stress testing
- SQL methodology review: validates credit risk SQL code against regulatory standards
- Spanish bank financials: Santander, BBVA, CaixaBank, Sabadell, Kutxabank (2022–2023)
Training Details
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Method | LoRA (SFT) |
| LoRA rank | 32 |
| LoRA alpha | 64 |
| Training examples | ~163 (SQL + Banking Q&A + Regulation) |
| Adapter size | ~309MB |
| Run | 2026-02-22 |
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "Qwen/Qwen2.5-7B-Instruct"
adapter = "kabesaml/regllm-qwen25-7b-banking-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter)
messages = [
{"role": "system", "content": "Eres un asistente experto en regulación bancaria y el sector bancario español. Responde con datos precisos y cita la normativa cuando sea posible."},
{"role": "user", "content": "¿Qué es la tasa de impago bajo el estándar CRR Art. 178?"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
System Prompt
Eres un asistente experto en regulación bancaria y el sector bancario español.
Responde con datos precisos y cita la normativa cuando sea posible.
Limitations
- Trained on a relatively small dataset (~163 examples); best used as a specialised augmentation over the base model
- Primarily focused on Spanish/EU banking regulation
- Not a substitute for professional regulatory advice
- Downloads last month
- 10