ViLA (Virtual Library Assistant) is a fine-tuned version of Meta's Llama-3.2-1B-Instruct model, optimized to answer library-related questions accurately and concisely. It has been instruction-tuned on a curated dataset of library FAQs, making it a lightweight yet capable assistant for library information services.
📋 Model Details
Attribute
Details
Base Model
meta-llama/Llama-3.2-1B-Instruct
Model Size
1 Billion parameters
Context Length
128K tokens
Fine-tuning Method
LoRA (Low-Rank Adaptation)
Training Dataset
hungryfoxz/LibraryFAQ1000
Framework
Hugging Face Transformers + PEFT + TRL
License
Llama 3.2 Community License (inherited from base model)
🎯 Intended Uses
This model is designed for:
Library Information Services – Answering questions about memberships, policies, services, and general library operations
On-Device Chatbots – Lightweight enough to run on edge devices and mobile platforms
Educational Demonstrations – Showcasing fine-tuning of small language models for domain-specific tasks
If possible create a python environment for installing the packages. After activating the environment, create a file within the working directory,
paste the code from the two section into that file, save it and run.
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3from peft import PeftModel
4from huggingface_hub import login
56# login("your_hf_token_here")7# Create a token from hf hub and paste here, its ***free***. Uncomment the above line after pasting the token.89# Load tokenizer and base model10tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B-Instruct")11base_model = AutoModelForCausalLM.from_pretrained(12"meta-llama/Llama-3.2-1B-Instruct",13 torch_dtype=torch.float16
14)1516# Load the ViLA adapter17model = PeftModel.from_pretrained(base_model,"hungryfoxz/Llama-3.2-1B-ViLA")18model.eval()
1**User**: Who are you?
2**Assistant**: I am a Virtual Library Assistant.
📊 Evaluation
The model was evaluated on the test split of the LibraryFAQ1000 dataset. Training metrics:
Step
Training Loss
Validation Loss
Mean Token Accuracy
100
1.645
1.505
66.8%
200
1.111
1.340
69.0%
300
0.791
1.395
68.8%
🖥️ Hardware Requirements
Precision
Disk Size
RAM (Inference)
BF16
~2 GB
~2-3 GB
4-bit (Q4)
~800 MB
~1 GB
The model runs comfortably on:
Apple Silicon (M1/M2/M3) via MPS/ Intel i5 11th Gen / Ryzen 5 5000 series
Mid-range laptops
Edge devices (Raspberry Pi 5)
macOs/ Windows / Linux or Unix
⚠️ Limitations
Domain-Specific – Optimized for library FAQs; performance on out-of-domain questions may degrade
Small Model – As a 1B parameter model, it may lack the depth of larger models for complex reasoning
Hallucination – Like all LLMs, may occasionally generate incorrect or fabricated information
🤝 Acknowledgements
Meta for releasing the Llama 3.2 family of models
Hugging Face for the Transformers, PEFT, and TRL libraries
Dataset Contributors for the LibraryFAQ1000 dataset
Happy building! 📖✨
Facing any issues‼️ while running the code, feel free to send a 📸screenshot to 'kaustavkhanikar99@gmail.com'. I will try to get back to you as soon as possible ✌️.