Hero
Generative & Agentic AI
LLM Integration & Fine-Tuning
Life Sciences & Med Devices

Fine-Tuned LLM Drafting Assistant for a Device Manufacturer's Quality Documentation


Let's Connect

Overview

What we built

A medical-device manufacturer with 10 production facilities had engineers drafting SOPs, CAPA reports and change-control documents entirely by hand, and formats drifted between sites. We fine-tuned a self-hosted LLM on the manufacturer's own approved documents so it generates structured first drafts that engineers edit rather than write from a blank page.

In plain terms: every quality document started from nothing. Engineers across 10 production facilities drafted SOPs, CAPA reports and change-control documents entirely by hand, and because there was no shared starting point, formats drifted between facilities even when the documents covered the same kind of work. First drafts took most of a working day to produce, and internal audits repeatedly flagged inconsistent structure and missing template sections, which dragged review cycles out across multiple rounds of correction before a document was finally approved.

We fine-tuned a self-hosted open-weight LLM on the manufacturer's corpus of approved quality documents and paired it with retrieval over current QMS templates and procedures, so the assistant drafts from the manufacturer's own approved style rather than a generic template. The drafting assistant sits inside the existing document workflow, generating structured first drafts that engineers edit and route through the unchanged review and approval chain, and no document is ever released without human sign-off. First-draft time for CAPA reports fell from roughly 6 hours to under 2, and average review rounds per document dropped from 3.4 to 1.8.

The Problem

Slow hand-written quality documents

Quality documentation at the manufacturer started from a blank page every time. Engineers across 10 production facilities drafted SOPs, CAPA reports and change-control documents entirely by hand, each one built up from memory and habit rather than a shared, current template. First drafts took most of a working day to produce, time that came directly out of engineering hours that could otherwise have gone to the work the documentation was describing.

Without a shared starting point, formats drifted between facilities. Two sites could produce a CAPA report that covered the same kind of issue in structurally different ways, and internal audits repeatedly flagged inconsistent structure and missing template sections as a result. Each flagged finding meant another round of correction, so review cycles stretched across multiple rounds before a document was finally approved.

The manufacturer already had the answer to consistent formatting, its own corpus of approved quality documents, it just was not being used as a starting point for new ones. Every engineer effectively reinvented structure and phrasing that had already been solved and approved somewhere else in the organisation, and the resulting rework across 10 facilities added up to a steady drag on review cycles.

Entirely manual drafting

Engineers drafted SOPs, CAPA reports and change-control documents entirely by hand across all 10 production facilities, with no shared starting point for a new document.

Format drift between facilities

Formats drifted between facilities because there was no common template being followed, so similar documents ended up structured in different ways.

Slow first drafts

First drafts took most of a working day to produce, time that came directly out of engineering hours across every facility.

Audit findings and rework

Internal audits repeatedly flagged inconsistent structure and missing template sections, dragging review cycles out across multiple rounds of correction.

What it was costing them

Every hand-written first draft cost most of a working day, and every audit finding on structure or missing sections meant another round of correction before a document could be approved. Across 10 production facilities, that added up to engineering time spent reinventing formats the manufacturer's own approved documents had already solved, and review cycles that stretched longer than the underlying quality work required.

The Solution

Fine-tuned drafting assistant

We fine-tuned a self-hosted open-weight LLM on the manufacturer's corpus of approved quality documents, so the model learns this manufacturer's actual approved structure and phrasing rather than a generic document format. Keeping the model self-hosted and open-weight mattered given the sensitivity of quality documentation in a regulated environment.

We paired the fine-tuned model with retrieval over current QMS templates and procedures, so a draft reflects whichever template and procedure actually apply to that document, not just whatever the model learned in training. The drafting assistant sits inside the existing document workflow, generating structured first drafts that engineers edit rather than starting from a blank page.

The review and approval chain did not change. Engineers edit every generated draft and route it through the unchanged review and approval chain, and no document is ever released without human sign-off. That meant adopting the assistant did not require renegotiating how quality documentation gets approved, only changing how a first draft comes to exist.

Key decisions

01

Fine-tune on the manufacturer's own corpus

The model was fine-tuned on the manufacturer's corpus of approved quality documents, so its drafts already reflect this organisation's approved structure and phrasing.

02

Pair fine-tuning with template retrieval

Retrieval over current QMS templates and procedures runs alongside the fine-tuned model, so each draft reflects the specific template that document actually requires.

03

Self-host an open-weight model

The LLM runs self-hosted and open-weight rather than through an external API, keeping regulated quality documentation inside the manufacturer's own environment.

04

Sit inside the existing workflow

The drafting assistant sits inside the existing document workflow rather than a separate tool, so engineers encounter it at the point where drafting already happens.

05

Keep the approval chain unchanged

Engineers edit and route every draft through the unchanged review and approval chain, so no document is ever released without human sign-off.

Measurable Impact

What changed after launch

Drafting got faster first. First-draft time for CAPA reports fell from roughly 6 hours to under 2, freeing engineering time that used to go into building a document's structure from scratch before the actual content could even begin.

Quality and speed improved together rather than trading off. Template-conformance findings in internal audits fell 63% over two audit cycles, and average review rounds per document dropped from 3.4 to 1.8, since drafts arrived already following the manufacturer's approved structure. All 10 facilities were onboarded to the assistant within 4 months, so the improvement reached the whole organisation rather than a single site.

First-draft time

Roughly 6 hours for a CAPA report

Under 2 hours for a first draft

Audit findings

Frequent template-conformance findings

Down 63% over two audit cycles

Review rounds

3.4 review rounds per document

1.8 review rounds per document

Facility rollout

Manual drafting at all 10 facilities

All 10 facilities onboarded within 4 months

Headline results

First-draft time for CAPA reports cut from roughly 6 hours to under 2

Template-conformance findings in internal audits down 63% over two audit cycles

Average review rounds per document reduced from 3.4 to 1.8

All 10 facilities onboarded to the assistant within 4 months

Tech & Tools Used

What powered the build

Every tool below earned its place in this engagement. Here is the part each one played.

Python (FastAPI) logo

Python (FastAPI)

Serves the drafting API that receives a document request and returns a structured first draft into the existing document workflow.

PyTorch logo

PyTorch

Runs the fine-tuning process on the manufacturer's corpus of approved quality documents, producing the model weights the drafting assistant runs on.

Hugging Face Transformers logo

Hugging Face Transformers

Provides the model architecture and tooling used to fine-tune and serve the open-weight LLM on the manufacturer's own approved documents.

LoRA (PEFT)

Fine-tunes the model efficiently on the manufacturer's document corpus without retraining the full model from scratch for each update.

vLLM

Serves the fine-tuned model's inference requests, generating structured first drafts quickly enough to fit inside engineers' existing drafting workflow.

pgvector logo

pgvector

Indexes current QMS templates and procedures so the retrieval step can pull the specific template a document actually needs to follow.

PostgreSQL logo

PostgreSQL

Stores document drafts, template metadata and review history, tracking each document from generated first draft through to signed-off approval.

React logo

React

Builds the drafting interface where engineers review, edit and submit generated drafts into the unchanged review and approval chain.

Keycloak logo

Keycloak

Manages authentication and access control for the drafting assistant, keeping regulated quality documentation restricted to authorised engineers.

Docker logo

Docker

Packages the fine-tuned model and drafting services so the same environment runs consistently across all 10 production facilities.

Ready to Build your Life Sciences & Med Devices Business with LLM Integration & Fine-Tuning

Ask Byte

Ask Byte

Typically replies instantly

just Now

Hi! I'm OrganByte's assistant. How can I help you today?

AI-generated content may be incorrect


OrganByte

Building innovative software solutions that transform businesses and drive digital success.

© 2026 YourCompany. All rights reserved.