This is a small study project to check whether I can fine-tune a LoRA adapter locally on an 8GB RTX 4060 laptop GPU.
It is not intended for production use. The banking terms-and-conditions dataset generation is just a convenient domain example for practicing the workflow.
The project has two scripts:
generate_dataset.pyreads a local plain-text terms-and-conditions file and uses DeepSeek's OpenAI-compatible API to generate instruction-tuning examples.train_qwen.pyfine-tunes a LoRA adapter locally with Unsloth usingunsloth/Qwen3.5-2B.
The training script is configured for standard LoRA, not QLoRA:
model_name = "unsloth/Qwen3.5-2B"
load_in_4bit = False
load_in_16bit = TrueCreate this input file before generating the dataset:
bank_raw_tc.txt
Generated files are ignored by git:
bank_tc_dataset.json
bank_tc_dataset.progress.json
outputs/
qwen3.5_2b_bank_tc_lora/
Set a DeepSeek API key:
$env:DEEPSEEK_API_KEY = "your_api_key_here"Then run:
python generate_dataset.pyThe generator saves progress after each chunk. If interrupted, it resumes from bank_tc_dataset.progress.json. If bank_raw_tc.txt changes, it starts a fresh dataset to avoid mixing examples from different source documents.
After bank_tc_dataset.json exists, run:
python train_qwen.pyThe script expects CUDA. It is tuned for a local 8GB GPU study run:
- Model:
unsloth/Qwen3.5-2B - LoRA rank:
16 - Sequence length:
2048 - Batch size:
1 - Gradient accumulation:
8 - Max steps:
100 - Optimizer:
adamw_8bit
If training runs out of VRAM, reduce max_seq_length to 1024 or 512 first.
The same study workflow is documented for Unsloth Studio GUI in UNSLOTH_GUI.md.
Easy smoke tests and example evaluation prompts are documented in TESTING.md.
This project is for learning PEFT/LoRA mechanics:
- generating a toy instruction dataset
- formatting chat-style examples
- attaching LoRA adapters
- running a short local SFT training loop
- saving the resulting adapter
It should not be treated as a reliable banking assistant, legal interpretation system, or production model.
The repository now includes the local study dataset source, dataset generation script, LoRA training script, and notes for using Unsloth Studio GUI.