This repository is a demonstrative snapshot of the infrastructure and architecture used in my bachelor’s thesis. It shows how the PHI extraction / anonymization pipeline is wired across three backends:
- Azure OpenAI / Azure AI (cloud models: GPT-5 family, GPT-OSS-120B, Llama 4, …)
- LM Studio (local OpenAI-compatible server)
- GPT-OSS-120B on AKS via vLLM (Kubernetes YAML deployment on a GPU node)
It is not a runnable end-to-end dataset release. Real medical letters, ground-truth annotations, and API credentials are intentionally omitted.
| Path | Role |
|---|---|
Code/anonymize.py |
Main pipeline: load letters → call LLM for PHI extraction → anonymize → optional ground-truth comparison / metrics |
Code/llm_prompt_config.py |
System/user prompts and JSON schema for German PHI categories |
Code/model_call.py |
Backend clients and call logic (Azure, LM Studio / OpenAI-compatible, cost helpers) |
Code/run_cluster_anonymize.py |
Thin cluster entrypoint; configures env vars then runs anonymize.main |
Code/normalize_documents.py |
Document normalization (.txt / .docx) |
Code/LM_STUDIO_SETUP.md |
Short guide for local LM Studio usage |
infra/gpt-oss-120b/ |
AKS manifests/templates: namespace, PVC, vLLM Deployment/Service, runner Job |
Dockerfile.cluster-runner |
Image that runs the anonymization job inside the cluster |
Medical letters (your data)
│
▼
anonymize.py ◄── prompts/schema from llm_prompt_config.py
│
├── Azure ──────────── model_call.call_azure_openai
├── LM Studio ──────── model_call.call_lm_studio (localhost or remote OpenAI-compatible URL)
└── AKS + vLLM ─────── same LM Studio path, pointed at in-cluster vLLM Service
(infra/gpt-oss-120b/*.yaml)
- Azure: keys and endpoints live as placeholders in
model_call.py— replace with your own (preferably via environment variables). - Local: start LM Studio (or any OpenAI-compatible server) and set
LM_STUDIO_BASE_URLif needed. - Cluster: render templates under
infra/gpt-oss-120b/, deploy vLLM on a GPU nodepool, then run the Job that executesrun_cluster_anonymize.py. Seeinfra/gpt-oss-120b/README.md.
- API keys / Azure endpoints / deployment names — placeholders only (
<your-api-key>,<your-endpoint>, …) - Medical evaluation data — e.g.
data/GLG_enhanced/, ground-truth JSON, renonymized case modules, annotation/log outputs - Cluster secrets — no kubeconfig, ACR credentials, or cloud login material
To reuse this pipeline: plug in your own keys, point paths at your own licensed data, and adjust model/deployment names to match your environment.
Provided for architecture demonstration and educational reuse of the pipeline layout. Do not commit real patient data or production credentials into a public fork of this repo.