πŸš— 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
Downloads last month
19
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for RRK1987/automotive-diagnostics-llm

Adapter
(1252)
this model

Space using RRK1987/automotive-diagnostics-llm 1