Views
No views yet
pip install model-clinicStatus: v0.3.0 on PyPI. v0.4.0 (deep repair) in validation — not yet released. We're testing repair capabilities across 72+ real checkpoints from a 645-hour training failure. Early results are promising but not conclusive.
1# Examine any checkpoint
2model-clinic exam checkpoint.pt
3
4# HuggingFace model
5model-clinic exam Qwen/Qwen2.5-0.5B-Instruct --hf
6
7# Treat and save
8model-clinic treat checkpoint.pt --save treated.pt
9
10# Health score only
11model-health checkpoint.pt
12
13# HTML diagnostic report
14model-clinic report checkpoint.pt --output report.html
15
16# Compare two checkpoints
17model-clinic compare before.pt after.pt
18
19# Try with a synthetic broken model (no checkpoint needed)
20model-clinic demo everything-broken1from model_clinic import load_state_dict, diagnose, prescribe, apply_treatment
2
3# Load any checkpoint format
4state_dict, meta = load_state_dict("checkpoint.pt")
5
6# Diagnose
7findings = diagnose(state_dict)
8for f in findings:
9 print(f"[{f.severity}] {f.condition}: {f.param_name}")
10
11# Health score
12from model_clinic import compute_health_score
13health = compute_health_score(findings)
14print(f"Score: {health.overall}/100 ({health.grade})")
15
16# Training monitor
17from model_clinic import ClinicMonitor
18monitor = ClinicMonitor(check_every=500)
19# In training loop: alerts = monitor.check(model)| Checkpoint | Score | What Happened |
|---|---|---|
| Pretrain step 16K | 84/B | Healthy backbone |
| Growth enabled | 56/D | Neural foam growth destroyed it |
| Fine-tuning (GRPO/Rho-1) | 65/C | Partial recovery |
| After repair (L1+L2+L3) | 76/C | Spectral surgery + distillation |
| After gate opening | 82/B | Memory system activated |
| Command | What it does |
|---|---|
model-clinic exam | Diagnose model health |
model-clinic treat | Diagnose and apply fixes |
model-clinic validate | Verify checkpoint loads correctly |
model-clinic report | HTML diagnostic report |
model-clinic compare | Compare two checkpoints |
model-clinic demo | Synthetic broken model demos |
model-xray | Per-parameter weight stats |
model-diff | Param-by-param comparison |
model-health | Quick health check |
model-surgery | Direct parameter modification |
model-ablate | Systematic ablation |
model-neurons | Neuron activation profiling |
model-attention | Attention pattern analysis |
model-logit-lens | Layer-by-layer prediction tracking |
1pip install model-clinic # Core (static analysis)
2pip install model-clinic[hf] # + HuggingFace runtime analysis
3pip install model-clinic[all] # Everything.pt, .pth, .safetensors, or HuggingFace model