171 MB
7 files
Updated 2 months ago
Name
Size
.gitattributes1.52 kB
xet
README.md3.22 kB
xet
adapter_config.json1.11 kB
xet
adapter_model.safetensors168 MB
xet
chat_template.jinja1.06 kB
xet
tokenizer.json3.51 MB
xet
tokenizer_config.json492 Bytes
xet
README.md

🚗 Automotive Diagnostics AI — Fine-Tuned LLM

Capstone Project: GenAI Application with LLMs & RAG
Author: RRK1987
Created: 2026-06-15
Base Model: mistralai/Mistral-7B-Instruct-v0.2
Technique: QLoRA (4-bit NF4 quantization + LoRA r=16)


Model Description

This model is a fine-tuned version of Mistral-7B-Instruct-v0.2, specialised for automotive vehicle diagnostics using OBD-II and UDS fault code protocols.

The model acts as an expert automotive diagnostics assistant that:

  • Interprets DTC (Diagnostic Trouble Code) fault codes
  • Identifies the most likely root causes
  • Recommends step-by-step repair procedures
  • Issues safety warnings for critical faults
  • Advises consulting a certified mechanic when uncertain

Training Details

Parameter Value
Base model Mistral-7B-Instruct-v0.2
Technique QLoRA — 4-bit NF4 quantization
LoRA rank (r) 16
LoRA alpha 32
Training examples 119
Validation examples 21
Epochs 3
Final loss 0.4590
Optimizer paged_adamw_8bit
Precision bf16
Hardware Tesla T4 GPU (15.6GB)

DTC Code Coverage

  • P codes — Powertrain (engine, fuel, transmission, timing)
  • B codes — Body (airbags, HVAC)
  • C codes — Chassis (ABS, brakes, wheel speed sensors)
  • U codes — Network (CAN bus, ECU communication)

Usage

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

base_model = "mistralai/Mistral-7B-Instruct-v0.2"
peft_model = "RRK1987/automotive-diagnostics-llm"

tokenizer = AutoTokenizer.from_pretrained(peft_model)
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    load_in_4bit=True,
    device_map="auto",
)
model = PeftModel.from_pretrained(model, peft_model)

prompt = "<s>[INST] You are an expert automotive diagnostics assistant. My 2019 Toyota Camry is showing fault code P0300. I am experiencing rough idle and engine shaking. Can you diagnose this? [/INST]"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Safety

This model includes safety guardrails that refuse requests to:

  • Disable airbag systems
  • Bypass ABS braking systems
  • Deactivate any safety-critical vehicle systems

Disclaimer

This model is for educational purposes only. Always consult a certified mechanic for actual vehicle repairs, especially for safety-critical systems.

Dataset

Training data available at: https://huggingface.co/datasets/RRK1987/automotive-dtc-finetune

Project Pipeline

This model is part of a 5-phase GenAI capstone project:

  • Phase 1 ✅ Data preparation (119 DTC instruction pairs)
  • Phase 2 ✅ ChromaDB vector store (35 documents embedded)
  • Phase 3 ✅ QLoRA fine-tuning (this model)
  • Phase 4 ⏳ RAG pipeline integration
  • Phase 5 ⏳ Evaluation + HuggingFace Spaces deployment
Total size
171 MB
Files
7
Last updated
Sep 17
Pre-warmed CDN
US EU US EU

Contributors