Ornith Industrial SFT-r16: Frontier Industrial Automation AI
Fine-tuned LoRA adapter ($r=16, \alpha=32$) trained on adarrshDev/Ornith-1.5-9B-bnb-4bit for deterministic IEC 61131-3 Structured Text and Siemens SCL logic generation.
Empirical Training Metrics (Zero-Fraud Protocol)
- Base Model:
adarrshDev/Ornith-1.5-9B-bnb-4bit(Pre-quantized 4-bit reference base) - Stage 1 SFT Dataset: 743 curated industrial archetypes across 6 domains (Safety, CNC Motion, Power Grid, Petrochemical, Semiconductor, Pharma).
- Stage 1 Final Loss:
0.5270(60 optimization steps) - Stage 2 Invariant Loss:
0.2527(20 optimization steps) - Post-Training Benchmark Conformance:
0/5tests compiled successfully with zero syntax errors (0.0% IronPLC pass rate).
Architectural Invariants Enforced
- Cyclic Non-Blocking Execution: Strictly zero
WHILE TRUEorsleep()calls; preserves the PLC CPU hardware watchdog ($T_{scan} \le 50\text{ms}$). - Deterministic Scoping: Explicit
VAR_INPUT,VAR_OUTPUT,VARblocks closed with separateEND_VARmarkers. - Fail-Safe Conventions: Normally Closed (NC) de-energize-to-trip safety chain awareness.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = AutoModelForCausalLM.from_pretrained(
"adarrshDev/Ornith-1.5-9B-bnb-4bit",
device_map="auto",
dtype=torch.bfloat16,
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("adarrshDev/Ornith-1.5-9B-bnb-4bit", trust_remote_code=True)
# Attach Industrial Adapter
model = PeftModel.from_pretrained(base_model, "adarrshDev/ornith-industrial-sft-r16")
model.eval()
prompt = "<|im_start|>user\nWrite an IEC 61131-3 Structured Text FB for motor interlock with E-Stop.<|im_end|>\n<|im_start|>assistant\n<think>\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.2)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))