CoolFace
Modelpublic

bosaj/eniad-llama3.1-8b-assistant-lora

sourceHugging Faceapache-2.0updated 4d agoView on Hugging Face
0likes45downloads
Model Card

🎓 ENIAD Assistant — LLaMA-3.1-8B LoRA Adapter

🤝 Official Multi-Author Engineering Project • ENIAD AI Lab (May 2025)

![Base Model](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct) ![PEFT-orange?style=flat-square)](https://github.com/huggingface/peft) ![Interactive Space](https://huggingface.co/spaces/bosaj/chatmodel) [![Dataset](https://img.shields.io/badge/🤗%20Dataset-eniad--instruct-00D9FF?style=flat-square&logo=huggingface&logoColor=black)](https://huggingface.co/datasets/bosaj/eniad-assistant-instruct-dataset) [![Original Weights Repo](https://img.shields.io/badge/OriginalCheckpoint-ahmed--ouka-purple?style=flat-square&logo=huggingface)](https://huggingface.co/ahmed-ouka/my-llama3.1-8B-with-lora-Eniad-Assistant) ![GitHub Source](https://github.com/ennajari/ENIAD-ASSISTANT)


👥 The ENIAD AI Engineering Team

This model and its surrounding ecosystem were engineered as part of the Projet de Fin d'Année (PFA) at the National School of Artificial Intelligence and Digital (ENIAD), Mohammed First University, Oujda, Morocco:

AI EngineerOfficial RoleCore ContributionsProfile Links
Abdellah ENNAJARILead AI & MLOps EngineerMicroservice System Architecture, CI/CD Pipeline Automation, Multi-stage Docker Containerization@abdennajari • GitHub @ennajari
Ahmed OUKACHAAI Systems & Fine-Tuning SpecialistCustom Fine-Tuned LLaMA-3 8B Academic Checkpoint, Model Weights Optimization & Modal Platform API@ahmed-ouka
Oussama EL HADJIFull-Stack AI UI & SMA Multi-Agent EngineerReact 18 + Vite Conversational UI, Streaming Web Inference, SMA Multi-Agent Web Intelligence ServiceHF @bosaj • GitHub @Bosaj • Portfolio
Abdelilah OURTIVector DB & RAG Pipeline EngineerLanceDB / Qdrant Vector Store Indexing, Academic Document Embedding Pipelines, Fast Search Backend@abdelilahou

🏛️ The Complete ENIAD Chatbot Model Family (LLaMA & Qwen)

The ENIAD Chatbot ecosystem consists of collaborative LLaMA & Qwen checkpoints, quantization profiles, and LoRA adapters engineered for our institutional assistant:

Model & CheckpointBase ArchitecturePrecision / FormatTarget Environment & Use-CaseVerified Repository Link
LLaMA-3.1-8B Assistant LoRAmeta-llama/Llama-3.1-8B16-Bit PEFT LoRA (Rank 16, Alpha 32)Primary institutional conversational assistant (Bilingual FR/EN)bosaj/eniad-llama3.1-8b-assistant-lora
LLaMA-3-8B Merged 32-Bitmeta-llama/Meta-Llama-3-8BFull Float32 Merged WeightsStandalone backend inference server without runtime adapter loadingahmed-ouka/llama3-8b-eniad-merged-32bit
LLaMA-3.1-8B Team Milestonemeta-llama/Llama-3.1-8BPEFT LoRA Sharded SafetensorsOriginal PFA milestone model checkpoint (May 2025 team release)ahmed-ouka/my-llama3.1-8B-with-lora-Eniad-Assistant
Eniad LLaMA 8-Bit Quantizedmeta-llama/Meta-Llama-3-8B8-Bit bitsandbytes NF4/INT8High-efficiency local inference on edge GPUs (< 6GB VRAM)ahmed-ouka/Eniad-model-llama-Assistant
LLaMA-Factory 3.1 LoRA Adaptermeta-llama/Llama-3.1-8BModular PEFT Adapter (~50MB)Exported modular weights from the LLaMA-Factory training pipelineahmed-ouka/llama-lora-adapter-eniad
Qwen-2.5-1.5B ENIAD LoRAQwen/Qwen2.5-1.5B-Instruct16-Bit PEFT LoRA (Compact)Ultra-fast lightweight assistant for low-latency & edge devices (< 2GB VRAM)ahmed-ouka/lora-qwen-eniad

📌 Model Overview


🚀 How to Use (Inference Code)

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

base_model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
# Uses the original May 2025 team checkpoint
adapter_id = "ahmed-ouka/my-llama3.1-8B-with-lora-Eniad-Assistant"

bnb_config = BitsAndBytesConfig(
    load_in_8bit=True,
    torch_dtype=torch.bfloat16
)

tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    quantization_config=bnb_config,
    device_map="auto"
)

model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

messages = [
    {"role": "system", "content": "You are the official ENIAD AI Assistant. Provide structured, accurate academic guidance."},
    {"role": "user", "content": "Quelles sont les spécialités proposées à l'ENIAD en cycle ingénieur ?"}
]

input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(input_ids, max_new_tokens=512, temperature=0.7, top_p=0.9)
response = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=True)
print(response)

📊 Training Hyperparameters

HyperparameterValueDescription
LoRA Rank ($r$)16Rank dimension for low-rank adapter matrices
LoRA Alpha ($lpha$)32Scaling factor for adapter updates
LoRA Dropout0.05Regularization dropout rate
Target Modulesq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projFull attention & MLP projections
Optimizerpaged_adamw_8bitMemory-efficient 8-bit optimizer
Learning Rate2e-4Cosine decay with warmup

📈 Evaluation & Benchmark Results

Benchmark MetricScoreBaseline LLaMA-3.1-8BImprovement
ROUGE-152.438.2+14.2
ROUGE-228.116.5+11.6
ROUGE-L48.633.7+14.9
Institutional Accuracy94.8%61.2%+33.6%

📖 Citation

bibtex
@misc{ennajari_ouka_elhadji_ourti_2025,
  author = {Ennajari, Abdellah and Oukacha, Ahmed and El Hadji, Oussama and Ourti, Abdelilah},
  title = {ENIAD Assistant: Parameter-Efficient Fine-Tuning of LLaMA-3.1-8B for Academic Mentorship and Institutional Intelligence},
  year = {2025},
  month = {May},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/bosaj/eniad-llama3.1-8b-assistant-lora}}
}