初始化项目,由ModelHub XC社区提供模型

Model: qvac/MedPsy-4B-GGUF
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-14 15:10:17 +08:00
commit 7c40c2a3af
12 changed files with 1921 additions and 0 deletions

43
.gitattributes vendored Normal file
View File

@@ -0,0 +1,43 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
medpsy-4b-iq3_m-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-iq3_xxs-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-iq4_nl-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-iq4_xs-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-q4_k_m-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-q5_k_m-imat.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
medpsy-4b-bf16.gguf filter=lfs diff=lfs merge=lfs -text

1294
ATTRIBUTIONS.md Normal file

File diff suppressed because it is too large Load Diff

178
LICENSE Normal file
View File

@@ -0,0 +1,178 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

382
README.md Normal file
View File

@@ -0,0 +1,382 @@
---
language:
- en
license: apache-2.0
license_link: https://huggingface.co/qvac/MedPsy-4B-GGUF/blob/main/LICENSE
library_name: gguf
base_model:
- qvac/MedPsy-4B
tags:
- medical
- healthcare
- clinical
- edge
- qwen3
- tether-ai
- text-generation
- on-device
- gguf
- quantized
- llama.cpp
pipeline_tag: text-generation
---
# MedPsy-4B-GGUF
**MedPsy-4B-GGUF** provides GGUF weights of [MedPsy-4B](https://huggingface.co/qvac/MedPsy-4B) for fast, fully on-device inference via [llama.cpp](https://github.com/ggml-org/llama.cpp) and the [QVAC SDK](https://qvac.tether.io/dev/sdk/). An unquantized **BF16 GGUF** file (about 8.83 GB) is included alongside seven quantization formats, ranging from near-lossless 8-bit (about 4.69 GB) through a high-quality 5-bit option (about 3.16 GB) down to ultra-compact 3-bit (about 1.84 GB), making the same model deployable across everything from workstations to high-end mobile devices.
| | |
|:---|:---|
| **Developed by** | [Tether AI Research](https://tether.io/) |
| **Model type** | Text-only causal language model (decoder-only transformer), GGUF quantized |
| **Base (BF16) model** | [MedPsy-4B](https://huggingface.co/qvac/MedPsy-4B) |
| **Backbone** | [Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507) |
| **Language** | English |
| **License** | [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) |
| **Quantization tool** | [llama.cpp](https://github.com/ggml-org/llama.cpp) |
| **Technical report** | [MedPsy Technical Report](https://huggingface.co/blog/qvac/medpsy) |
| **Collection** | [MedPsy on Hugging Face](https://huggingface.co/collections/qvac/medpsy) |
| **All MedPsy variants** | [MedPsy-4B](https://huggingface.co/qvac/MedPsy-4B) · [MedPsy-1.7B](https://huggingface.co/qvac/MedPsy-1.7B) · [MedPsy-4B-GGUF](https://huggingface.co/qvac/MedPsy-4B-GGUF) · [MedPsy-1.7B-GGUF](https://huggingface.co/qvac/MedPsy-1.7B-GGUF) |
## Available Files
All published files are produced with [llama.cpp](https://github.com/ggml-org/llama.cpp). The **BF16 GGUF file is unquantized**: no quantization is applied. We have not separately re-evaluated the BF16 GGUF with llama.cpp; because it preserves the same BF16 tensor precision as the source checkpoint, performance is expected to match the BF16 source model evaluated with vLLM, aside from small backend or runtime differences. **Q8_0 does not use imatrix calibration** (we verified that imatrix provided no measurable benefit at 8-bit). All sub-8-bit variants use **importance-matrix (imatrix) calibration**, which consistently reduces quality degradation. See the [MedPsy Technical Report (Section 4.7)](https://huggingface.co/blog/qvac/medpsy) for the full quantization methodology, including the K-quants vs I-quants comparison and the per-bit-count imatrix ablation.
| File | Format | Imatrix | Size | Δ Size | Δ AVG (pts) | Δ AVG (rel %) | Recommended For |
|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---|
| `medpsy-4b-bf16.gguf` | BF16 | n/a | 8.83 GB | 0% | **≈0.00** | **≈0.00%** | **Unquantized GGUF** (same performance expected) |
| `medpsy-4b-q8_0.gguf` | Q8_0 | no (not needed) | 4.69 GB | -47% | **-0.15** | **-0.20%** | **Best quality, near-lossless** |
| `medpsy-4b-q5_k_m-imat.gguf` | Q5_K_M | yes | 3.16 GB | -64% | **-0.29** | **-0.40%** | **Recommended high-quality 5-bit option** |
| `medpsy-4b-q4_k_m-imat.gguf` | Q4_K_M | yes | 2.72 GB | -69% | -0.81 | -1.12% | **Recommended for mobile/laptop** (best size/quality trade-off) |
| `medpsy-4b-iq4_nl-imat.gguf` | IQ4_NL | yes | 2.60 GB | -71% | -1.02 | -1.41% | Alternative 4-bit (slightly worse than Q4_K_M) |
| `medpsy-4b-iq4_xs-imat.gguf` | IQ4_XS | yes | 2.48 GB | -72% | -1.08 | -1.49% | Smaller 4-bit alternative |
| `medpsy-4b-iq3_m-imat.gguf` | IQ3_M | yes | 2.13 GB | -76% | -1.50 | -2.07% | **Strong compact option** for tight memory budgets |
| `medpsy-4b-iq3_xxs-imat.gguf` | IQ3_XXS | yes | 1.84 GB | -79% | -5.56 | -7.69% | ⚠ Significant degradation - **not recommended** |
> **Two ways to read quality loss.** *Δ AVG (pts)* is the **absolute** change in AVG Score vs the BF16/vLLM source-model baseline - the raw points lost. *Δ AVG (rel %)* is the **relative** change as a fraction of the baseline (`(baseline variant) / baseline`). They convey complementary information: the absolute delta is the easiest "how much score did I actually lose?" reading, while the relative delta normalizes by baseline so quality degradation is comparable across models with different starting scores. AVG Score = mean of HealthBench Overall and Closed-Ended Average.
## Quick Recommendation
| Your constraint | Choose |
|:---|:---|
| You want a llama.cpp-native unquantized file | **BF16** - no quantization applied; same quality as the source BF16 checkpoint expected, GGUF format (8.83 GB) |
| You want the best possible quality at smaller size | **Q8_0** - statistically indistinguishable from BF16, half the size |
| You want extra quality headroom over 4-bit | **Q5_K_M (imatrix)** - 64% smaller than BF16, only -0.29 pts (-0.40% rel) on AVG Score |
| You want the best size/quality trade-off (most users) | **Q4_K_M (imatrix)** - 69% smaller, only -0.81 pts (-1.12% rel) on AVG Score |
| You need the smallest recommended 4B file | **IQ3_M (imatrix)** - 76% smaller, only -1.50 pts (-2.07% rel) (excellent) |
| You want maximum compression and can tolerate quality loss | IQ4_XS or IQ3_M (avoid IQ3_XXS) |
## Benchmark Results
The comparison uses the **BF16 source model evaluated with vLLM** as the reference baseline. Quantized GGUF variants were evaluated on the full closed-ended benchmark suite (7 medical benchmarks, averaged) and HealthBench (CompassJudger-2-32B-Instruct as judge), using the same benchmark protocol. The BF16 GGUF file is the unquantized GGUF export and has not been separately re-run with llama.cpp; since no quantization is applied, its performance is expected to match the BF16 source model aside from small backend or runtime differences. **AVG Score** is the average of HealthBench Overall and Closed-Ended Average.
<table style="width:100%; border-collapse:collapse; font-size:14px; table-layout:fixed;">
<colgroup>
<col style="width:24%;">
<col style="width:7%;">
<col style="width:9%;">
<col style="width:8%;">
<col style="width:8%;">
<col style="width:10%;">
<col style="width:11%;">
<col style="width:12%;">
<col style="width:8%;">
</colgroup>
<thead>
<tr>
<th style="padding:10px 6px; text-align:left; border-bottom:2px solid #ddd;">Variant</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd;">Size (GB)</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd;">HealthBench</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd;">HB Hard</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd;">CE Avg</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd; color:#009393; font-weight:bold;">AVG Score</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd; color:#009393; font-weight:bold;">Δ AVG (pts)</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd; color:#009393; font-weight:bold;">Δ AVG (rel %)</th>
<th style="padding:10px 6px; text-align:center; border-bottom:2px solid #ddd;">Δ Size</th>
</tr>
</thead>
<tbody>
<tr style="background:rgba(0,147,147,0.08);">
<td style="padding:8px 6px; font-weight:bold;">MedPsy-4B (BF16, vLLM baseline)</td>
<td style="padding:8px 6px; text-align:center;">8.83</td>
<td style="padding:8px 6px; text-align:center;">74</td>
<td style="padding:8px 6px; text-align:center;">58</td>
<td style="padding:8px 6px; text-align:center;">70.54</td>
<td style="padding:8px 6px; text-align:center; font-weight:bold;">72.27</td>
<td style="padding:8px 6px; text-align:center;">0.00</td>
<td style="padding:8px 6px; text-align:center;">0.00%</td>
<td style="padding:8px 6px; text-align:center;">0%</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px 6px; font-weight:bold;">Q8_0 ★</td>
<td style="padding:8px 6px; text-align:center;">4.69</td>
<td style="padding:8px 6px; text-align:center;">74</td>
<td style="padding:8px 6px; text-align:center;">57</td>
<td style="padding:8px 6px; text-align:center;">70.25</td>
<td style="padding:8px 6px; text-align:center; font-weight:bold;">72.13</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-0.15</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-0.20%</td>
<td style="padding:8px 6px; text-align:center;">-47%</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px 6px; font-weight:bold;">Q5_K_M ★</td>
<td style="padding:8px 6px; text-align:center;">3.16</td>
<td style="padding:8px 6px; text-align:center;">74</td>
<td style="padding:8px 6px; text-align:center;">58</td>
<td style="padding:8px 6px; text-align:center;">69.96</td>
<td style="padding:8px 6px; text-align:center; font-weight:bold;">71.98</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-0.29</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-0.40%</td>
<td style="padding:8px 6px; text-align:center;">-64%</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px 6px; font-weight:bold;">Q4_K_M ★</td>
<td style="padding:8px 6px; text-align:center;">2.72</td>
<td style="padding:8px 6px; text-align:center;">73</td>
<td style="padding:8px 6px; text-align:center;">56</td>
<td style="padding:8px 6px; text-align:center;">69.92</td>
<td style="padding:8px 6px; text-align:center; font-weight:bold;">71.46</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-0.81</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-1.12%</td>
<td style="padding:8px 6px; text-align:center;">-69%</td>
</tr>
<tr>
<td style="padding:8px 6px;">IQ4_NL</td>
<td style="padding:8px 6px; text-align:center;">2.60</td>
<td style="padding:8px 6px; text-align:center;">73</td>
<td style="padding:8px 6px; text-align:center;">57</td>
<td style="padding:8px 6px; text-align:center;">69.50</td>
<td style="padding:8px 6px; text-align:center;">71.25</td>
<td style="padding:8px 6px; text-align:center;">-1.02</td>
<td style="padding:8px 6px; text-align:center;">-1.41%</td>
<td style="padding:8px 6px; text-align:center;">-71%</td>
</tr>
<tr>
<td style="padding:8px 6px;">IQ4_XS</td>
<td style="padding:8px 6px; text-align:center;">2.48</td>
<td style="padding:8px 6px; text-align:center;">73</td>
<td style="padding:8px 6px; text-align:center;">57</td>
<td style="padding:8px 6px; text-align:center;">69.39</td>
<td style="padding:8px 6px; text-align:center;">71.20</td>
<td style="padding:8px 6px; text-align:center;">-1.08</td>
<td style="padding:8px 6px; text-align:center;">-1.49%</td>
<td style="padding:8px 6px; text-align:center;">-72%</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px 6px; font-weight:bold;">IQ3_M ★</td>
<td style="padding:8px 6px; text-align:center;">2.13</td>
<td style="padding:8px 6px; text-align:center;">73</td>
<td style="padding:8px 6px; text-align:center;">58</td>
<td style="padding:8px 6px; text-align:center;">68.55</td>
<td style="padding:8px 6px; text-align:center; font-weight:bold;">70.78</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-1.50</td>
<td style="padding:8px 6px; text-align:center; color:#009393; font-weight:bold;">-2.07%</td>
<td style="padding:8px 6px; text-align:center;">-76%</td>
</tr>
<tr style="background:rgba(255,140,0,0.10);">
<td style="padding:8px 6px;">IQ3_XXS ⚠</td>
<td style="padding:8px 6px; text-align:center;">1.84</td>
<td style="padding:8px 6px; text-align:center;">69</td>
<td style="padding:8px 6px; text-align:center;">51</td>
<td style="padding:8px 6px; text-align:center;">64.42</td>
<td style="padding:8px 6px; text-align:center;">66.71</td>
<td style="padding:8px 6px; text-align:center; color:#cc5500; font-weight:bold;">-5.56</td>
<td style="padding:8px 6px; text-align:center; color:#cc5500; font-weight:bold;">-7.69%</td>
<td style="padding:8px 6px; text-align:center;">-79%</td>
</tr>
</tbody>
</table>
<p style="font-size:11px; color:#888; margin-top:8px; line-height:1.6;">
HB = HealthBench; CE = Closed-Ended Average (7 medical benchmarks). <b>Δ AVG (pts)</b> is the <b>absolute</b> point change in AVG Score vs the BF16/vLLM source-model baseline (e.g. 72.27 - 71.46 = -0.81). <b>Δ AVG (rel %)</b> is the <b>relative</b> change as a fraction of the baseline (e.g. -0.81 / 72.27 = -1.12%). Δ Size is the relative file-size change vs BF16. ★ Recommended variants (best of class). ⚠ Not recommended due to significant quality degradation. AVG Score = (HealthBench Overall + Closed-Ended Average) / 2. Results averaged over 3 runs with generation parameters: temperature=0.6, top_k=20, top_p=0.95, max_output_tokens=16384. Quantized GGUF variants were evaluated with llama.cpp; the BF16 baseline was evaluated with vLLM. HealthBench evaluated using CompassJudger-2-32B-Instruct.
</p>
## Key Findings
- **Q8_0 is effectively lossless**: -0.15 pts (-0.20% relative) AVG Score (72.13 vs 72.27) at 47% smaller (4.69 GB vs 8.83 GB), with no need for imatrix calibration.
- **Q5_K_M is a recommended high-quality option**: -0.29 pts (-0.40% relative) AVG Score at 64% smaller (3.16 GB), while matching BF16 on HealthBench and HealthBench Hard.
- **Q4_K_M is the sweet spot**: only -0.81 pts (-1.12% relative) AVG Score loss for a 69% size reduction (2.72 GB), comfortably fitting on high-end mobile and laptop devices.
- **IQ3_M is exceptionally efficient at this scale**: -1.50 pts (-2.07% relative) at 76% size reduction (2.13 GB). It even matches the BF16 HealthBench Hard score (58) - a remarkably strong compact result.
- **IQ3_XXS is too aggressive**: HealthBench Hard drops from 58 to 51 and AVG Score by -5.56 pts (-7.69% relative). Avoid this variant for medical use cases unless extreme size constraints leave no alternative.
- **Even the worst quantization beats unquantized peers**: IQ3_XXS still scores **64.42 closed-ended / 69 HealthBench**, well above the unquantized Qwen3-4B-Thinking-2507 backbone (63.10 / 63.00) and unquantized MedGemma-1.5-4B-it (51.20 / 54.00).
## How Quantized Variants Compare to Other Models
Even the most aggressive *recommended* quantization (IQ3_M at 2.13 GB) retains a **substantial accuracy lead** over the unquantized open-weight baselines in this size class:
<table style="width:100%; border-collapse:collapse; font-size:14px;">
<thead>
<tr>
<th style="padding:10px 14px; text-align:left; border-bottom:2px solid #ddd;">Model</th>
<th style="padding:10px 14px; text-align:center; border-bottom:2px solid #ddd;">Size (GB)</th>
<th style="padding:10px 14px; text-align:center; border-bottom:2px solid #ddd;">Closed-Ended Avg</th>
<th style="padding:10px 14px; text-align:center; border-bottom:2px solid #ddd;">HealthBench</th>
</tr>
</thead>
<tbody>
<tr style="background:rgba(0,147,147,0.08);">
<td style="padding:8px; font-weight:bold;">MedPsy-4B (BF16)</td>
<td style="padding:8px; text-align:center;">8.83</td>
<td style="padding:8px; text-align:center; font-weight:bold;">70.54</td>
<td style="padding:8px; text-align:center; font-weight:bold;">74</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px; font-weight:bold;">MedPsy-4B Q8_0 ★</td>
<td style="padding:8px; text-align:center;">4.69</td>
<td style="padding:8px; text-align:center; font-weight:bold;">70.25</td>
<td style="padding:8px; text-align:center; font-weight:bold;">74</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px; font-weight:bold;">MedPsy-4B Q5_K_M ★</td>
<td style="padding:8px; text-align:center;">3.16</td>
<td style="padding:8px; text-align:center; font-weight:bold;">69.96</td>
<td style="padding:8px; text-align:center; font-weight:bold;">74</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px; font-weight:bold;">MedPsy-4B Q4_K_M ★</td>
<td style="padding:8px; text-align:center;">2.72</td>
<td style="padding:8px; text-align:center; font-weight:bold;">69.92</td>
<td style="padding:8px; text-align:center; font-weight:bold;">73</td>
</tr>
<tr style="background:rgba(0,147,147,0.04);">
<td style="padding:8px; font-weight:bold;">MedPsy-4B IQ3_M ★</td>
<td style="padding:8px; text-align:center;">2.13</td>
<td style="padding:8px; text-align:center; font-weight:bold;">68.55</td>
<td style="padding:8px; text-align:center; font-weight:bold;">73</td>
</tr>
<tr>
<td style="padding:8px;">Qwen3-4B-Thinking-2507 (BF16, backbone)</td>
<td style="padding:8px; text-align:center;">8.83</td>
<td style="padding:8px; text-align:center;">63.10</td>
<td style="padding:8px; text-align:center;">63</td>
</tr>
<tr>
<td style="padding:8px;">MedGemma-1.5-4B-it (BF16)</td>
<td style="padding:8px; text-align:center;">8.0</td>
<td style="padding:8px; text-align:center;">51.20</td>
<td style="padding:8px; text-align:center;">54</td>
</tr>
</tbody>
</table>
## Usage
### llama.cpp
```bash
# Download the recommended file (Q4_K_M with imatrix - best size/quality for mobile/laptop)
huggingface-cli download qvac/MedPsy-4B-GGUF medpsy-4b-q4_k_m-imat.gguf --local-dir .
# Run interactively
./llama-cli -m medpsy-4b-q4_k_m-imat.gguf \
-p "What are the common symptoms and first-line treatments for community-acquired pneumonia?" \
--temp 0.6 --top-k 20 --top-p 0.95 -n 1024
```
### QVAC SDK
These GGUF files are designed for deployment through the [QVAC SDK](https://qvac.tether.io/dev/sdk/), enabling fully private on-device inference on smartphones, tablets, and edge devices. See the [QVAC documentation](https://docs.qvac.tether.io/sdk/getting-started/quickstart/) for integration guides.
```js
# 1. Project setup
mkdir medpsy && cd medpsy
npm init -y && npm pkg set type=module
# 2. Install SDK + matching Bare runtime binary
# (swap linux-x64 for: linux-arm64 | darwin-arm64 | darwin-x64 | win32-x64 | win32-arm64)
npm i @qvac/sdk bare-runtime-linux-x64
# 3. Authenticate with Hugging Face (one-time) and download the recommended quant
hf auth login
hf download qvac/MedPsy-4B-GGUF medpsy-4b-q4_k_m-imat.gguf --local-dir ./models
# 4. Run inference (streamed, GPU)
node --input-type=module -e '
import { loadModel, completion, unloadModel, VERBOSITY } from "@qvac/sdk";
import { resolve } from "node:path";
const id = await loadModel({
modelSrc: resolve("./models/medpsy-4b-q4_k_m-imat.gguf"),
modelType: "llamacpp-completion",
modelConfig: { device: "gpu", ctx_size: 4096, verbosity: VERBOSITY.ERROR },
});
const r = completion({
modelId: id,
history: [{ role: "user", content: "First-line treatment for community-acquired pneumonia in 2 sentences." }],
stream: true,
generationParams: { temp: 0.6, top_p: 0.95, top_k: 20, predict: 2048 },
});
for await (const t of r.tokenStream) process.stdout.write(t);
const s = await r.stats;
console.log(`\n[${s.tokensPerSecond.toFixed(2)} tok/s, TTFT ${s.timeToFirstToken.toFixed(0)}ms, ${s.backendDevice}]`);
await unloadModel({ modelId: id });
'
```
## Use and Limitations
### Intended Use
MedPsy-4B-GGUF is intended as a **starting point for developers and researchers** building downstream healthcare applications involving medical text on-device. Developers are expected to validate, adapt, and make meaningful modifications to the model for their specific use cases.
Appropriate use cases include:
- On-device medical information retrieval for privacy-sensitive environments
- Building developer tools and prototypes for health-related applications running on edge devices
- Research on medical language understanding and reasoning under quantization
Always with appropriate disclaimers.
### Limitations
> [!WARNING]
> This model is **NOT a substitute for professional medical judgment** and the model outputs are **NOT a substitute for proper clinical diagnosis**. Always consult with a certified physician. Despite strong benchmark performance, MedPsy-4B is a compact 4B-parameter language model that **will make errors**. Quantization may further amplify rare-case failure modes that are not captured by aggregate benchmark numbers. Medical AI systems can produce outputs that appear confident and authoritative while being factually incorrect, incomplete, or clinically inappropriate.
**Known limitations include:**
- **Hallucinations**: The model may generate plausible-sounding but incorrect medical information.
- **Quantization artifacts**: Quantized models can occasionally produce subtly degraded outputs (rare-token drops, less stable formatting on long generations) that aggregate benchmarks may not capture. Effects grow at lower bit counts; we strongly recommend Q4_K_M or higher for production deployment, and avoid IQ3_XXS for any medical use case.
- **English only**: The model was trained and evaluated primarily in English. Performance in other languages is not validated.
- **Text only**: This model processes text inputs only. It cannot interpret medical images, lab results in non-text formats, or other modalities.
- **No real-time knowledge**: The model's knowledge has a training data cutoff and does not reflect the latest medical guidelines, drug approvals, or clinical evidence.
- **Bias in training data**: As with any model trained on synthetic and public medical data, biases in the source material may propagate to model outputs. Developers should validate performance across diverse patient populations, demographics, and clinical contexts.
- **Not designed for emergencies**: This model should never be used as the sole decision-making tool in emergency or life-threatening situations.
### Safety Recommendations
When integrating this model into any application:
1. **Always include visible disclaimers** informing users that outputs are AI-generated and not a substitute for professional medical advice
2. **Do not use for direct clinical diagnosis or treatment** without oversight by qualified healthcare professionals
3. **Monitor for harmful outputs** and implement appropriate safety filters in production systems
## Related Resources
- [MedPsy Collection](https://huggingface.co/collections/qvac/medpsy): All MedPsy models, datasets, and resources in one place
- [MedPsy-4B (BF16)](https://huggingface.co/qvac/MedPsy-4B): Full-precision source model
- [MedPsy-1.7B-GGUF](https://huggingface.co/qvac/MedPsy-1.7B-GGUF): Smaller GGUF sibling for smartphone-class deployment
- [MedPsy Technical Report](https://huggingface.co/blog/qvac/medpsy): Full quantization methodology and results (Section 4.7)
- [QVAC SDK](https://qvac.tether.io/dev/sdk/): On-device AI deployment framework
- [llama.cpp](https://github.com/ggml-org/llama.cpp): Inference engine and quantization toolchain
## Citation
```bibtex
@article{medpsy2026,
title={MedPsy: State-of-the-Art Medical and Healthcare Language Models for Edge Devices},
author={Vitabile, Davide and Buffa, Alexandro and Nambiar, Akshay and Nazir, Amril},
year={2026},
url={https://huggingface.co/blog/qvac/medpsy},
institution={Tether AI Research}
}
```
## Copyright
We will take appropriate actions in response to notices of copyright infringement. If you believe your work has been used or copied in a manner that infringes upon your intellectual property rights, please email [data-apps@tether.io](mailto:data-apps@tether.io) identifying and describing both the copyrighted work and alleged infringing content.
## Licensing
This model, which was trained as described in the [MedPsy Technical Report](https://huggingface.co/blog/qvac/medpsy), is licensed by Tether Data, S.A. de C.V. under the [Apache 2.0 license](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md) for research and educational purposes. As described above, this model is a version of [Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507), which is also under the [Apache 2.0 license](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md).
As described above, a subset of the Genesis I and Genesis II datasets was used by the [Baichuan-M3-235B](https://huggingface.co/baichuan-inc/Baichuan-M3-235B) model—which itself is also available under the [Apache 2.0 license](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md) to generate synthetic data for training this model. The [Genesis I](https://huggingface.co/datasets/qvac/GenesisI) dataset is made available under the [CC-BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode.en) (Creative Commons Attribution-NonCommercial 4.0) license. The [Genesis II](https://huggingface.co/datasets/qvac/GenesisII) dataset is also made available under the [CC-BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode.en) license.

3
medpsy-4b-bf16.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ca2678e1fea2547fabe6c9859605e69425942538f5cc190e12dcffeebfa78c4
size 8829197344

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4bb000febb07d70342be8964aa02fd747b8574617526f8a9abdeadc38c287b9
size 2130025760

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00358ed1f556b4c6801986c10f81e142095c69b3e94997b878dd3604560ed6c5
size 1837317920

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7deecba2614a1e8bd8b549f57f4e507be90d88dbea704fda2a355373fbb781df
size 2600131360

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0098a76248d769b6e8e041d8fced2270c66962e257c5da4d4008cedd45ef051c
size 2477384480

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ecbf622a2856f631001f20f593669aa03acba39977f521bef80cd8600864980
size 2716068640

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68bd5e14cd87ff40bba5d08fbef2da9a6088b11aacab8466ef3f13a602e2d868
size 3156921120

3
medpsy-4b-q8_0.gguf Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b754795a8415d4ba56952da3cb3b994e69c04d61111eec6239938c80aebe93a7
size 4693670944