--- license: cc-by-4.0 language: - en library_name: peft pipeline_tag: text-generation base_model: Qwen/Qwen3-1.7B-Base base_model_relation: finetune datasets: - luizaaca/symptoms-to-diseases-with-reasoning tags: - medical - clinical-screening - symptom-analysis - structured-output - json - lora - qlora - gguf - llama.cpp - ollama - unsloth - peft - transformers --- # Qwen3-1.7B Clinical Screening This repository packages the artifacts generated by the training notebook [`screening_robot_qwen3_1_7b_json.ipynb`](https://github.com/luizaaca/screening_robot/blob/main/screening_robot_qwen3_1_7b_json.ipynb) for the `symptom_analysis` specialist step of the Screening Robot workflow. ## Artifact layout - `lora/`: PEFT LoRA adapter weights and tokenizer/chat-template files. - `gguf/qwen3-1.7b-clinical-screening.Q4_K_M.gguf`: merged and quantized GGUF export (`Q4_K_M`) for llama.cpp and Ollama-style runtimes. - `gguf/config.json`, `gguf/tokenizer.json`, `gguf/tokenizer_config.json`, `gguf/chat_template.jinja`: support files exported alongside the GGUF build. - `Modelfile`: Ollama-oriented template aligned with the same JSON-focused system prompt used in the training notebook. ## Model details - **Repository**: `https://huggingface.co/luizaaca/qwen3-1.7b-clinical-screening` - **Base model**: `Qwen/Qwen3-1.7B-Base` - **Training runtime base**: `unsloth/qwen3-1.7b-base-unsloth-bnb-4bit` - **Training recipe**: QLoRA via Unsloth on a 4-bit loaded base model - **LoRA hyperparameters**: rank 16, alpha 32, dropout 0.0 - **Target modules**: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` - **Max sequence length used during training**: 1024 - **Training runtime**: Google Colab + Tesla T4 (16 GB VRAM) - **Kaggle Dataset**: [`luizaaca/symptoms-to-diseases-with-reasoning`](https://www.kaggle.com/datasets/luizaaca/symptoms-to-diseases-with-reasoning) ## Intended behavior The model was fine-tuned to emit a compact JSON object with exactly three keys: - `support_status` - `candidate_diseases` - `recommended_exams_tests` The fine-tuning notebook explicitly scoped the model to the dataset-aligned specialist contract used by the `symptom_analysis` node. It does **not** represent the full downstream production payload used elsewhere in the application. ## Prompt contract Training and validation were built around the following behavior: - a clinical screening system prompt focused on symptom analysis; - a user message formatted as `Clinical request` plus `Active patient context`; and - an assistant answer restricted to JSON only. The default `Modelfile` included in this repository mirrors that setup. ## Validation summary The notebook includes: - a held-out evaluation pass comparing the fine-tuned model against the base model; - an assertion that fine-tuned label accuracy matches or exceeds the base model on the evaluation split; and - GGUF smoke tests that require the exported model to emit valid schema-compliant JSON. No claim of clinical validation, diagnostic safety, or regulatory readiness is made. ## Notes about the GGUF filename The local GGUF export produced by the toolchain may inherit the original base model filename. In this repository the uploaded GGUF weight is renamed to `qwen3-1.7b-clinical-screening.Q4_K_M.gguf` to make it explicit that the file contains the fine-tuned clinical screening variant. ## Intended use This repository is suitable for: - research experiments on structured clinical-screening assistants; - integration prototypes for symptom-intake workflows; and - local inference with PEFT or GGUF-compatible runtimes. ## Out-of-scope use This repository is **not** intended for: - autonomous diagnosis or treatment decisions; - emergency or high-acuity triage without clinician oversight; - prescribing or medication guidance; or - use as a substitute for professional medical judgment. ## Safety notice This is a research artifact for screening-assistance workflows only. Always keep a qualified human clinician in the loop.