Skip to content

Getting Started

Sudhanshu Shukla edited this page Nov 23, 2026 · 2 revisions

Getting Started

Follow the repository README for supported dependencies. This page uses PowerShell for illustration; equivalent shell commands work elsewhere.

1. Clone and install

git clone https://github.com/su394611-del/MedSparse-Healthcare-LLM-From-Scratch.git
Set-Location MedSparse-Healthcare-LLM-From-Scratch
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e . --no-deps

If the system requires a platform-specific PyTorch distribution, follow the official PyTorch installation selector and confirm that the intended runtime is available. Do not assume that a generic dependency installation selects the appropriate runtime.

2. Confirm imports and available arguments

python -c "from mixtral_lab import MixtralLM, ModelConfig; print('Model import OK')"
python -m scripts.pretrain_healthcare --help
python -m scripts.finetune_medical --help
python -m pytest -q

3. Understand the build order

  1. Audit eligible healthcare corpus records.
  2. Train or load a healthcare-domain tokenizer, and validate its special-token IDs.
  3. Choose a model configuration whose vocab_size exactly matches the tokenizer.
  4. Run Stage 1: pretraining from random weights.
  5. Inspect the Stage 1 checkpoint and manifest.
  6. Run Stage 2: full-parameter medical SFT with the same tokenizer and architecture.
  7. Evaluate, review provenance, and record limitations.

See Tokenizer, Pretraining from Scratch, and Medical SFT for commands.

4. Verify configuration before a real run

python -c "from mixtral_lab.config import ModelConfig; c=ModelConfig.from_json('configs/healthcare_moe_1b.json'); print(c)"

The command above only inspects the example architecture. Do not substitute a different configuration when loading a pretrained checkpoint. Use the exact architecture and tokenizer associated with that checkpoint.

Clone this wiki locally