- Status
- Fertig
- Zeitraum
- 03/2026 to 11/2026, Berlin
- Technik
- Python
- SQLCipher
- GGUF models
- PDF/A
- pytest
100%
offline
5
kinds of fact checked
2
editions
Problem
A private clinic writes referral letters and medical reports every day. The content already exists as the doctor's short notes. Turning those notes into a formal letter takes time, and a cloud tool would mean patient data leaves the practice.
Approach
Keep everything on one computer, and do not trust the language model with facts.
- The doctor types bullet points in their own shorthand. Klindok writes the letter.
- A language model is optional. In template mode the bullet points are joined into sentences with no model at all. A model only improves the wording.
- After the draft, a fact check compares the letter with what the doctor typed: numbers with units, dates, lab values, drugs with their doses, and left or right.
- A mismatch is an error. The Release button stays switched off until a doctor resolves it.
Implementation
- A desktop program with no network access. Patient data sits in an encrypted local database with a separate key file.
- A model is a single GGUF file that is copied in by hand. Klindok never downloads anything. Before a model is activated, its checksum is compared with the one pinned in a registry, so a swapped or damaged file cannot be used.
- Releasing is the signature. Only a doctor can release, the text is then frozen, and every earlier version is kept.
- The export is PDF/A, the archive format, with the clinic letterhead.
- The audit log records every sign-in, draft, release and export as a hash chain, and can verify that nothing in it was altered.
- A privacy tab produces the data access report a patient may ask for, sets the retention period, and can erase one patient or the whole installation.
- Two editions: a German one for the Arztbrief, and a Malaysian one for referral letters and medical reports.
What I measured
- In testing, the model once wrote 620 mg where the doctor had typed 625 mg. The check caught it every time.
- With a model, a letter takes a minute or two on a laptop without a graphics card.
Current status
Finished as a working desktop build in both editions. It is a portfolio project and has not been deployed in a clinic.
Klindok is a writing aid. It makes no diagnosis and gives no medical advice. The doctor decides and signs.
What I learned
Privacy is part of the build, not a later checklist. Encryption, separate roles and an audit log have to exist before a letter is useful to a clinic.
The language model turned out to be the optional part. The checks around it are what make a letter safe to sign.