--- tags: - quality-management - iso-standards - unsloth - llama-3.2 - lora - gguf - ollama - auditing - continuous-improvement license: other language: - en base_model: unsloth/Llama-3.2-1B-Instruct --- # Quality Management / ISO Standards LoRA — Llama 3.2 1B This is a LoRA adapter fine-tuned on **500,000** synthetic instruction-style samples covering quality-management systems, ISO standards, auditing, risk-based thinking, CAPA, Six Sigma, Lean, SPC, FMEA, and related topics. **Completed by Aboutknowledge (Hong Kong) Limited — Alex Lee.** **License note:** the LoRA weights in this repository are released under the same terms as the base model, the Llama 3.2 Community License Agreement. Please review Meta's license before using or redistributing the merged weights. ## Model details | Item | Value | |------|-------| | Base model | `unsloth/Llama-3.2-1B-Instruct` | | Fine-tuning framework | Unsloth | | LoRA rank (r) | 16 | | LoRA alpha | 16 | | LoRA dropout | 0.0 | | Quantized training | 4-bit NF4 (bnb) | | Training records | 500,000 (subset of a 1,000,000 synthetic dataset) | | Training steps | 10,000 | | Final train loss | 0.1137 | | Sequence length | 2048 | ## Included files - `adapter_model.safetensors` / `adapter_config.json` — standard PEFT LoRA adapter. - `quality_lora_1m.q8_0.gguf` — Q8_0 GGUF file ready for Ollama. - `Modelfile` — example Ollama Modelfile (edit the `FROM` path after downloading). ## Use with transformers / Unsloth ```python from unsloth import FastLanguageModel model, tokenizer = FastLanguageModel.from_pretrained( model_name="unsloth/Llama-3.2-1B-Instruct", max_seq_length=2048, dtype=None, load_in_4bit=True, ) model = FastLanguageModel.get_peft_model(model, r=16, lora_alpha=16) model.load_adapter("alexlkc28/quality-lora-llama32-1b-1m", adapter_name="default") messages = [ {"role": "system", "content": "You are an expert in quality management systems and ISO standards."}, {"role": "user", "content": "What does ISO 9001:2015 clause 8.7 require?"}, ] inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", tokenize=True).to("cuda") outputs = model.generate(inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` ## Use with Ollama 1. Download the GGUF and `Modelfile` from this repo. 2. Update the `FROM` line in the `Modelfile` to point to the downloaded GGUF path. 3. Create the model: ```bash ollama create quality-lora-1m -f /path/to/Modelfile ollama run quality-lora-1m ``` ## Training data The data was generated synthetically from a compact ISO/quality-management knowledge base covering: - ISO 9001, 14001, 45001, 27001, 13485, 50001 - IATF 16949 (automotive), AS9100D (aerospace) - PDCA, risk-based thinking, process approach, CAPA, 8D, 5 Whys, FMEA, SPC, MSA, 5S, Lean, Six Sigma - Audit checklists, nonconformity reports, KPI suggestions, interview questions The full 1,000,000-record dataset is available locally in the project directory as `data/quality_1m.jsonl`. ## Limitations - Synthetic data can contain occasional grammar artifacts or mix standards in generic answers; always verify against the official standard text for compliance decisions. - This is a small 1B model; while useful for Q&A and drafting, it should not replace human auditors or regulatory review.