An AI-powered automotive diagnostic assistant built using Microsoft Phi-2, LoRA (Low-Rank Adaptation) fine-tuning, and Gradio. The system assists users by analyzing vehicle symptoms and OBD-II fault codes to generate structured diagnostic recommendations.
Car owners often struggle to interpret vehicle symptoms and OBD-II trouble codes without consulting a mechanic. This project aims to bridge that gap by providing an intelligent diagnostic assistant capable of:
- Understanding vehicle symptoms described in natural language.
- Interpreting OBD-II fault codes.
- Suggesting likely causes.
- Assessing risk levels.
- Recommending safe checks and next actions.
The assistant combines a fine-tuned Large Language Model with curated automotive diagnostic knowledge to provide practical and easy-to-understand diagnostic guidance.
Analyze user-reported vehicle issues such as:
- Rough idling
- Engine vibration
- Hard starting
- Overheating
- Brake issues
- Electrical problems
- Transmission concerns
Supports automotive fault code analysis including:
- P0300 โ Random Misfire
- P0301 โ Cylinder 1 Misfire
- P0302 โ Cylinder 2 Misfire
- P0303 โ Cylinder 3 Misfire
- P0304 โ Cylinder 4 Misfire
and other diagnostic codes available through the integrated OBD database.
Generates outputs in a mechanic-friendly format:
- Symptom Summary
- OBD-II Interpretation
- Likely Causes
- Risk Level
- Safe Checks
- Do Not Do
- Next Action
Built using:
- Microsoft Phi-2
- PEFT LoRA fine-tuning
- Hugging Face Transformers
- PyTorch
Interactive web application powered by Gradio.
User Symptoms
+
OBD Codes
โ
โผ
OBD Interpreter
โ
โผ
Prompt Builder
โ
โผ
Microsoft Phi-2
+
LoRA Adapter
โ
โผ
Output Validation
โ
โผ
Diagnostic Report
| Component | Details |
|---|---|
| Base Model | Microsoft Phi-2 |
| Fine-Tuning Method | LoRA (PEFT) |
| Framework | Hugging Face Transformers |
| Training Dataset | Custom Automotive Diagnostic Dataset |
| Inference Engine | PyTorch |
| Interface | Gradio |
| Platform | macOS Apple Silicon / Local Deployment |
CAR_ASSISTANT/
โโโ assets/
โ โโโ icons/
โ โโโ screenshots/
โ
โโโ data/
โ โโโ train.jsonl
โ โโโ obd-trouble-codes.csv
โ
โโโ models/
โ โโโ car-assistant-qlora/
โ
โโโ notebooks/
โ โโโ finetuning.ipynb
โ
โโโ scripts/
โ โโโ test_load.py
โ โโโ colab_parity_test.py
โ
โโโ src/
โ โโโ config.py
โ โโโ model_loader.py
โ โโโ obd_utils.py
โ โโโ diagnosis.py
โ โโโ ui.py
โ
โโโ app.py
โโโ requirements.txt
โโโ README.md
โโโ LICENSE
git clone https://github.com/YOUR_USERNAME/Car_Assistant_LLM.git
cd Car_Assistant_LLMpython -m venv venv
source venv/bin/activateWindows:
venv\Scripts\activatepip install -r requirements.txtLaunch the Gradio application:
python app.pyThe application will be available locally at:
http://127.0.0.1:7860
To verify that:
- Phi-2 loads correctly
- LoRA adapter loads correctly
- Tokenizer is configured correctly
- Inference works successfully
run:
python scripts/test_load.pySymptom Summary:
- Strong fuel smell and engine vibration
OBD-II Interpretation:
- P0302: Cylinder 2 Misfire Detected
Likely Causes:
1. Faulty spark plug
2. Ignition coil issue
3. Fuel injector problem
Risk Level:
High
Safe Checks:
- Inspect spark plugs
- Check ignition connections
Do Not Do:
- Avoid prolonged driving
Next Action:
- Schedule engine diagnostic service
This project is intended for educational and research purposes.
- Not a substitute for professional vehicle diagnostics.
- Diagnostic recommendations are AI-generated and may not always be accurate.
- Supports a limited set of training scenarios and OBD fault patterns.
- Performance depends on the quality and completeness of user-provided information.
- Expanded OBD-II code coverage
- Larger automotive training dataset
- Retrieval-Augmented Generation (RAG)
- Multi-turn conversational diagnostics
- Vehicle-specific recommendations
- Enhanced confidence scoring
- Pranav M Nair
- Aadil Sandeep
- Advaith S Vinod
- Thejas Baiju
This project was developed as an academic and research-oriented exploration of:
- Automotive Artificial Intelligence
- Large Language Models
- Parameter-Efficient Fine-Tuning (PEFT)
- OBD-II Diagnostic Systems
- Intelligent Vehicle Assistance Systems
This project is licensed under the MIT License.
See the LICENSE file for details.
- Microsoft Research for the Phi-2 model
- Hugging Face Transformers
- PEFT (Parameter-Efficient Fine-Tuning)
- PyTorch
- Gradio
Built with AI, Machine Learning, and Automotive Diagnostics in mind.

