adarrshDev/ornith-1.5-9b-sft-r16
043
Ornith-1.5-9B โ IEC 61131-3 Structured Text SFT (LoRA r=16)
A QLoRA fine-tuned LoRA adapter for `ornith-ai/Ornith-1.5-9B` (Qwen3.5 architecture) specialised in generating, refactoring, and reasoning about IEC 61131-3 Structured Text (ST) industrial control logic (OSCAT library standards, Siemens SCL dialects, and Plant-01 safety interlocks).
๐ฌ Model Details
๐ Training Convergence & Loss Curve
Trained for 3 full epochs (9 optimization steps with effective batch size 8):
- Initial Loss:
2.614 - Final Converged Loss:
1.105 - Mean Loss across Run:
1.806
๐ฆ Training Data Specification
- Domain: IEC 61131-3 Structured Text (ST) / Siemens SCL for PLC and DCS industrial automation.
- Corpus Structure: OSCAT basic automation library blocks, Plant-01 twin interlocks, and safety refusal prompts.
- Format: ChatML / OpenAI JSONL multi-turn format (
messagesschema).
๐ป How to Load and Use with Transformers & PEFT
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "ornith-ai/Ornith-1.5-9B"
adapter_id = "adarrshDev/ornith-1.5-9b-sft-r16"
# 1. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# 2. Attach the Fine-Tuned Ornith LoRA Adapter
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
# 3. Generate Structured Text logic
messages = [
{"role": "user", "content": "Write an IEC 61131-3 Structured Text FUNCTION_BLOCK for a debounced digital input with configurable ON/OFF delay timers."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))โ๏ธ License & Governance
This adapter is distributed under the MIT License, consistent with the `ornith-ai/Ornith-1.5-9B` upstream base model.
