Text Generation
Transformers
Safetensors
llm-pipeline
medical-ai
llm
report-generation
hallucination-detection
fhir
clinical-nlp
Instructions to use mou11/medical-report-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mou11/medical-report-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mou11/medical-report-generator")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mou11/medical-report-generator", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use mou11/medical-report-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mou11/medical-report-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mou11/medical-report-generator
- SGLang
How to use mou11/medical-report-generator with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mou11/medical-report-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mou11/medical-report-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mou11/medical-report-generator with Docker Model Runner:
docker model run hf.co/mou11/medical-report-generator
| tags: | |
| - medical-ai | |
| - llm | |
| - report-generation | |
| - hallucination-detection | |
| - fhir | |
| - clinical-nlp | |
| license: mit | |
| pipeline_tag: text-generation | |
| base_model: mistralai/Mistral-7B-v0.1 | |
| library_name: transformers | |
| # Medical Report Generator | |
|  | |
|  | |
|  | |
|  | |
| ## Live Demo | |
| π [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/medical-report-generator) | |
| ## Overview | |
| An end-to-end clinical report generation pipeline that generates structured medical reports from patient data, detects hallucinations using NLI, outputs FHIR R4 compliant JSON, and exports professional PDF reports. | |
| ## Results | |
| | Report Type | BERTScore F1 | Safety Score | | |
| |-------------|-------------|--------------| | |
| | Radiology | 0.8628 | 0.625 | | |
| | Discharge Summary | 0.9045 | 1.0 | | |
| | Lab Report | 0.8129 | 0.375 | | |
| ## Hallucination Detection | |
| | Report Type | Total Claims | Hallucination Rate | Safety Score | | |
| |-------------|-------------|-------------------|--------------| | |
| | Radiology | 4 | 0.375 | 0.625 | | |
| | Discharge | 1 | 0.0 | 1.0 | | |
| | Lab | 4 | 0.625 | 0.375 | | |
| ## Features | |
| - Generates 3 types of clinical reports: Radiology, Discharge Summary, Lab Report | |
| - Hallucination detection using NLI (cross-encoder/nli-deberta-v3-base) | |
| - FHIR R4 compliant JSON output (HL7 healthcare standard) | |
| - BERTScore and ROUGE evaluation metrics | |
| - Professional PDF export with quality assessment table | |
| - Gradio web interface | |
| ## Architecture | |
| Patient Data β Report Generation (LLaMA 3.3 70B via Groq) β Hallucination Detection (DeBERTa NLI) β Evaluation (BERTScore + ROUGE) β FHIR R4 JSON β PDF Export | |
| ## Tech Stack | |
| | Component | Tool | | |
| |-----------|------| | |
| | LLM | Groq β LLaMA 3.3 70B | | |
| | Hallucination Detection | cross-encoder/nli-deberta-v3-base | | |
| | Evaluation | BERTScore + ROUGE | | |
| | FHIR Output | HL7 R4 JSON | | |
| | PDF Export | ReportLab | | |
| | UI | Gradio | | |
| | Platform | Google Colab (T4 GPU) | | |
| ## How to Run | |
| 1. Get a free Groq API key at [console.groq.com](https://console.groq.com) | |
| 2. Open `app.py` in Google Colab | |
| 3. Add your key to Colab Secrets as `GROQ_KEY_1` | |
| 4. Run all cells in order | |
| ## Medical Disclaimer | |
| This system is for educational and research purposes only. It does not provide medical advice. Always consult a qualified healthcare professional for medical decisions. | |
| ## Project Status | |
| β Report generation pipeline complete | |
| β Hallucination detection implemented | |
| β FHIR R4 compliant output | |
| β PDF export working | |
| β Gradio demo deployed on Hugging Face Spaces |