Text Generation
PEFT
Safetensors
Transformers
English
lora
sft
trl
automotive
diagnostics
obd2
dual-persona
conversational
Instructions to use Kungumapriyaa/DriveTwinLLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Kungumapriyaa/DriveTwinLLM with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "Kungumapriyaa/DriveTwinLLM") - Transformers
How to use Kungumapriyaa/DriveTwinLLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kungumapriyaa/DriveTwinLLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Kungumapriyaa/DriveTwinLLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kungumapriyaa/DriveTwinLLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kungumapriyaa/DriveTwinLLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kungumapriyaa/DriveTwinLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kungumapriyaa/DriveTwinLLM
- SGLang
How to use Kungumapriyaa/DriveTwinLLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kungumapriyaa/DriveTwinLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kungumapriyaa/DriveTwinLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kungumapriyaa/DriveTwinLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kungumapriyaa/DriveTwinLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kungumapriyaa/DriveTwinLLM with Docker Model Runner:
docker model run hf.co/Kungumapriyaa/DriveTwinLLM
ποΈ DriveTwinLLM: Dual-Persona Automotive Diagnostic AI
DriveTwinLLM is an instruction-tuned, physics-grounded automotive diagnostic language model built on top of Qwen/Qwen2.5-3B-Instruct. It was fine-tuned using LoRA on NVIDIA B200 GPU hardware (180 GB VRAM) to achieve 98.13% evaluation token accuracy on real-world vehicle trouble codes, live ECU telemetry, and OEM service manuals.
The model enforces strict zero-hallucination guardrails and features a specialized Dual-Persona Architecture:
π Dual-Persona Capabilities
1. π Driver Care Persona (ELI5 + Billing)
- Child-Friendly Physical Analogies: Translates mechanical issues into simple, intuitive concepts (e.g., comparing a 6-cylinder engine to 6 rowers in a boat where one stopped pulling).
- Approximate Repair Billing Breakdown: Generates 4-row estimated invoice tables containing:
- Diagnostic computer scan fee ($90 β $130)
- Replacement OEM part costs
- Certified shop labor ($120/hr flat-rate standard)
- Total estimated invoice range before taxes
- Shop Negotiation Questions: Generates 3 specific questions for drivers to ask technicians to prevent overcharging.
- Safe Driving Limits: Explicit recommendations on whether the car is drivable and maximum emergency limp-mode range.
2. π§ Master Mechanic Persona (OEM & Pinouts)
- Multimeter & Electrical Specs: Exact primary coil resistance ($0.8,\Omega - 1.2,\Omega$), piezo injector stack ($180,k\Omega - 220,k\Omega$, isolation $> 10,M\Omega$), 5.0V reference pinouts ($5.0\text{V} \pm 0.1\text{V}$), and loaded ground drop thresholds ($< 0.15\text{V}$).
- Oscilloscope Waveforms: Drive pulse voltages ($140 - 160\text{V}$) and peak-and-hold current ramps ($8\text{A}$) without clipped plateaus.
- Fastener Torque Specifications: Complete torque tables in both Metric ($Nm$) and Imperial ($ft\text{-}lbs$).
- Component Swap Defect Isolation: Systematic component swap logic with diagnostic trouble code migration rules.
3. π‘οΈ Zero-Hallucination Telemetry Grounding
- Strictly refuses unmonitored sensors (transmission fluid temperature, TPMS, cabin humidity) and invalid codes (
P9999), redirecting the user to monitored engine channels (Coolant Temp: 86.1Β°C, Oil Temp: 90.3Β°C, IAT: 28.3Β°C).
π Training Specifications & Evaluation
- Base Architecture:
Qwen/Qwen2.5-3B-Instruct - Fine-Tuning Method: LoRA (Low-Rank Adaptation) via PEFT & TRL
- LoRA Rank ($r$):
16 - LoRA Alpha ($\alpha$):
32 - Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj
- LoRA Rank ($r$):
- Compute Hardware: NVIDIA B200 GPU (180 GB VRAM)
- Dataset Size: 2,288 curated dual-persona instruction pairs (5.82 MB) + 287 MB ECU telemetry corpus
- Training Epochs: 3 (408 steps)
- Final Training Step Loss:
0.0432 - Validation Loss:
0.0705 - Evaluation Token Accuracy:
98.13%
π Quickstart Usage with PEFT
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Qwen/Qwen2.5-3B-Instruct"
lora_model_id = "Kungumapriyaa/DriveTwinLLM"
tokenizer = AutoTokenizer.from_pretrained(lora_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, lora_model_id)
messages = [
{
"role": "system",
"content": "You are Drive-Twin Driver Care AI. Explain simply like to a child, provide safe driving limits, and approximate billing breakdown."
},
{
"role": "user",
"content": "My check engine light is on for Cylinder 3 misfire (P0303). How much will this cost to fix?"
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.3)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
π Citation & License
- License: Apache-2.0
- Base Model: Qwen/Qwen2.5-3B-Instruct
- Downloads last month
- 4