Text Generation
llama-cpp-python
GGUF
llama.cpp
Mixture of Experts
ssd-offload
smallthinker
expert-paging
low-ram
Instructions to use HelloSun/SmallThinker4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use HelloSun/SmallThinker4b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="HelloSun/SmallThinker4b", filename="{{GGUF_FILE}}", )output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
Download validate/ab-test.json from HelloSun/SmallThinker4b: direct link, hf CLI and curl.
- Browser
- Download file 17.4 kB
-
https://huggingface.co/HelloSun/SmallThinker4b/resolve/main/validate/ab-test.json
- Command line
-
hf download hf://HelloSun/SmallThinker4b/validate/ab-test.json
-
curl -L -o ab-test.json https://huggingface.co/HelloSun/SmallThinker4b/resolve/main/validate/ab-test.json
17.4 kB
| { | |
| "when": "2026-10-07T16:47:19+0200", | |
| "model": "/root/work/models/SmallThinker-4B-A0.6B-Instruct.Q4_K.gguf", | |
| "model_size_mib": 2508, | |
| "prompt": "Hello, who are you?", | |
| "n_tokens": 32, | |
| "ctx": 1024, | |
| "threads": 8, | |
| "runs": { | |
| "baseline": { | |
| "env": { | |
| "ST_PAGER": "0" | |
| }, | |
| "rc": 0, | |
| "seconds": 9.06, | |
| "peak": { | |
| "total_rss_gb": 2.5648, | |
| "anon_rss_gb": 0.1033, | |
| "file_rss_gb": 2.559, | |
| "peak_swap_gb": 0.0, | |
| "hwm_rss_gb": 2.5648 | |
| }, | |
| "decode": { | |
| "total_rss_gb": 2.5648, | |
| "note": "prefill 後的峰值;prefill 會摸遍全部 expert,所以 peak 不代表 decode" | |
| }, | |
| "rss_timeline_mib": [ | |
| [ | |
| 0.0, | |
| 0.8 | |
| ], | |
| [ | |
| 0.205, | |
| 76.1 | |
| ], | |
| [ | |
| 0.41, | |
| 74.4 | |
| ], | |
| [ | |
| 0.619, | |
| 124.9 | |
| ], | |
| [ | |
| 0.825, | |
| 195.9 | |
| ], | |
| [ | |
| 1.032, | |
| 263.6 | |
| ], | |
| [ | |
| 1.239, | |
| 333.7 | |
| ], | |
| [ | |
| 1.454, | |
| 402.4 | |
| ], | |
| [ | |
| 1.664, | |
| 473.7 | |
| ], | |
| [ | |
| 1.873, | |
| 544.7 | |
| ], | |
| [ | |
| 2.088, | |
| 616.2 | |
| ], | |
| [ | |
| 2.299, | |
| 688.0 | |
| ], | |
| [ | |
| 2.511, | |
| 759.8 | |
| ], | |
| [ | |
| 2.724, | |
| 830.6 | |
| ], | |
| [ | |
| 2.938, | |
| 902.1 | |
| ], | |
| [ | |
| 3.152, | |
| 974.8 | |
| ], | |
| [ | |
| 3.366, | |
| 1045.4 | |
| ], | |
| [ | |
| 3.582, | |
| 1116.1 | |
| ], | |
| [ | |
| 3.803, | |
| 1190.9 | |
| ], | |
| [ | |
| 4.026, | |
| 1265.4 | |
| ], | |
| [ | |
| 4.245, | |
| 1338.0 | |
| ], | |
| [ | |
| 4.465, | |
| 1411.0 | |
| ], | |
| [ | |
| 4.686, | |
| 1485.0 | |
| ], | |
| [ | |
| 4.909, | |
| 1560.5 | |
| ], | |
| [ | |
| 5.135, | |
| 1634.3 | |
| ], | |
| [ | |
| 5.358, | |
| 1709.6 | |
| ], | |
| [ | |
| 5.581, | |
| 1784.6 | |
| ], | |
| [ | |
| 5.811, | |
| 1859.6 | |
| ], | |
| [ | |
| 6.047, | |
| 1937.9 | |
| ], | |
| [ | |
| 6.277, | |
| 2014.4 | |
| ], | |
| [ | |
| 6.506, | |
| 2090.7 | |
| ], | |
| [ | |
| 6.734, | |
| 2166.2 | |
| ], | |
| [ | |
| 6.964, | |
| 2243.7 | |
| ], | |
| [ | |
| 7.196, | |
| 2320.7 | |
| ], | |
| [ | |
| 7.433, | |
| 2399.8 | |
| ], | |
| [ | |
| 7.67, | |
| 2477.3 | |
| ], | |
| [ | |
| 7.907, | |
| 2556.6 | |
| ], | |
| [ | |
| 8.148, | |
| 2620.6 | |
| ], | |
| [ | |
| 8.385, | |
| 2626.3 | |
| ], | |
| [ | |
| 8.634, | |
| 2626.3 | |
| ], | |
| [ | |
| 8.901, | |
| 2626.3 | |
| ] | |
| ], | |
| "io_delta": {}, | |
| "timing_line": "[ Prompt: 178.7 t/s | Generation: 55.4 t/s ]", | |
| "output": "Hello! 😊 I'm DeepSeek-R1, your friendly AI assistant. I'm here to help with all kinds of questions, learning, and creative tasks", | |
| "output_matches_baseline": true, | |
| "swap_zero": true, | |
| "rc_ok": true | |
| }, | |
| "budget1024mb": { | |
| "env": { | |
| "ST_PAGER": "1", | |
| "ST_RAM_BUDGET_MB": "1024", | |
| "ST_RESERVE_MB": "200" | |
| }, | |
| "rc": 0, | |
| "seconds": 7.85, | |
| "peak": { | |
| "total_rss_gb": 1.3009, | |
| "anon_rss_gb": 0.103, | |
| "file_rss_gb": 1.2995, | |
| "peak_swap_gb": 0.0, | |
| "hwm_rss_gb": 1.3009 | |
| }, | |
| "decode": { | |
| "total_rss_gb": 1.3009, | |
| "note": "prefill 後的峰值;prefill 會摸遍全部 expert,所以 peak 不代表 decode" | |
| }, | |
| "rss_timeline_mib": [ | |
| [ | |
| 0.0, | |
| 0.5 | |
| ], | |
| [ | |
| 0.205, | |
| 72.8 | |
| ], | |
| [ | |
| 0.409, | |
| 71.1 | |
| ], | |
| [ | |
| 0.613, | |
| 115.4 | |
| ], | |
| [ | |
| 0.822, | |
| 172.7 | |
| ], | |
| [ | |
| 1.043, | |
| 229.1 | |
| ], | |
| [ | |
| 1.257, | |
| 289.1 | |
| ], | |
| [ | |
| 1.471, | |
| 348.1 | |
| ], | |
| [ | |
| 1.685, | |
| 405.3 | |
| ], | |
| [ | |
| 1.902, | |
| 465.1 | |
| ], | |
| [ | |
| 2.122, | |
| 557.5 | |
| ], | |
| [ | |
| 2.345, | |
| 688.3 | |
| ], | |
| [ | |
| 2.576, | |
| 742.5 | |
| ], | |
| [ | |
| 2.811, | |
| 825.9 | |
| ], | |
| [ | |
| 3.057, | |
| 912.6 | |
| ], | |
| [ | |
| 3.3, | |
| 996.3 | |
| ], | |
| [ | |
| 3.547, | |
| 1089.1 | |
| ], | |
| [ | |
| 3.797, | |
| 1180.5 | |
| ], | |
| [ | |
| 4.064, | |
| 1194.8 | |
| ], | |
| [ | |
| 4.315, | |
| 1209.3 | |
| ], | |
| [ | |
| 4.574, | |
| 1236.3 | |
| ], | |
| [ | |
| 4.83, | |
| 1246.3 | |
| ], | |
| [ | |
| 5.082, | |
| 1253.1 | |
| ], | |
| [ | |
| 5.338, | |
| 1213.9 | |
| ], | |
| [ | |
| 5.628, | |
| 1224.6 | |
| ], | |
| [ | |
| 5.887, | |
| 1226.6 | |
| ], | |
| [ | |
| 6.15, | |
| 1220.7 | |
| ], | |
| [ | |
| 6.413, | |
| 1252.2 | |
| ], | |
| [ | |
| 6.678, | |
| 1297.8 | |
| ], | |
| [ | |
| 6.942, | |
| 1322.2 | |
| ], | |
| [ | |
| 7.205, | |
| 1320.0 | |
| ], | |
| [ | |
| 7.474, | |
| 1320.2 | |
| ], | |
| [ | |
| 7.738, | |
| 1324.9 | |
| ] | |
| ], | |
| "io_delta": {}, | |
| "timing_line": "[ Prompt: 7.8 t/s | Generation: 22.9 t/s ]", | |
| "output": "Hello! 😊 I'm DeepSeek-R1, your friendly AI assistant. I'm here to help with all kinds of questions, learning, and creative tasks", | |
| "pager": { | |
| "routing_calls": 8448, | |
| "expert_touches": 64544, | |
| "hits": 37015, | |
| "misses": 2273, | |
| "evictions": 2894, | |
| "evicted_bytes": 6197382144, | |
| "sweeps": 864, | |
| "resident_bytes": 863972352, | |
| "budget_bytes": 864026624, | |
| "hit_rate": 0.5735, | |
| "proc_self_read_bytes": 2429124608, | |
| "proc_self_rchar": 11947223 | |
| }, | |
| "output_matches_baseline": true, | |
| "swap_zero": true, | |
| "rc_ok": true, | |
| "rss_vs_baseline": -1.2639, | |
| "decode_rss_vs_baseline": -1.2639, | |
| "decode_rss_lower_than_baseline": true, | |
| "rss_lower_than_baseline": true, | |
| "ssd_reads_mib": 2316.6, | |
| "cold_weights_really_read_from_ssd": true, | |
| "pager_hit_rate": 0.5735, | |
| "pager_evictions": 2894, | |
| "pager_misses": 2273, | |
| "pager_resident_mib": 823.9, | |
| "pager_budget_mib": 824.0 | |
| }, | |
| "budget512mb": { | |
| "env": { | |
| "ST_PAGER": "1", | |
| "ST_RAM_BUDGET_MB": "512", | |
| "ST_RESERVE_MB": "200" | |
| }, | |
| "rc": 0, | |
| "seconds": 7.67, | |
| "peak": { | |
| "total_rss_gb": 0.8327, | |
| "anon_rss_gb": 0.103, | |
| "file_rss_gb": 0.8363, | |
| "peak_swap_gb": 0.0, | |
| "hwm_rss_gb": 0.8327 | |
| }, | |
| "decode": { | |
| "total_rss_gb": 0.8327, | |
| "note": "prefill 後的峰值;prefill 會摸遍全部 expert,所以 peak 不代表 decode" | |
| }, | |
| "rss_timeline_mib": [ | |
| [ | |
| 0.0, | |
| 0.9 | |
| ], | |
| [ | |
| 0.206, | |
| 75.8 | |
| ], | |
| [ | |
| 0.413, | |
| 72.4 | |
| ], | |
| [ | |
| 0.62, | |
| 136.1 | |
| ], | |
| [ | |
| 0.828, | |
| 193.1 | |
| ], | |
| [ | |
| 1.041, | |
| 253.0 | |
| ], | |
| [ | |
| 1.257, | |
| 312.0 | |
| ], | |
| [ | |
| 1.472, | |
| 375.3 | |
| ], | |
| [ | |
| 1.687, | |
| 436.7 | |
| ], | |
| [ | |
| 1.904, | |
| 507.1 | |
| ], | |
| [ | |
| 2.127, | |
| 638.1 | |
| ], | |
| [ | |
| 2.352, | |
| 726.1 | |
| ], | |
| [ | |
| 2.576, | |
| 699.4 | |
| ], | |
| [ | |
| 2.803, | |
| 739.9 | |
| ], | |
| [ | |
| 3.041, | |
| 727.5 | |
| ], | |
| [ | |
| 3.263, | |
| 714.7 | |
| ], | |
| [ | |
| 3.487, | |
| 703.7 | |
| ], | |
| [ | |
| 3.71, | |
| 744.8 | |
| ], | |
| [ | |
| 3.941, | |
| 726.0 | |
| ], | |
| [ | |
| 4.161, | |
| 725.3 | |
| ], | |
| [ | |
| 4.383, | |
| 733.5 | |
| ], | |
| [ | |
| 4.606, | |
| 733.0 | |
| ], | |
| [ | |
| 4.827, | |
| 736.0 | |
| ], | |
| [ | |
| 5.048, | |
| 725.0 | |
| ], | |
| [ | |
| 5.271, | |
| 719.1 | |
| ], | |
| [ | |
| 5.494, | |
| 717.1 | |
| ], | |
| [ | |
| 5.722, | |
| 694.0 | |
| ], | |
| [ | |
| 5.945, | |
| 736.3 | |
| ], | |
| [ | |
| 6.18, | |
| 761.5 | |
| ], | |
| [ | |
| 6.422, | |
| 815.8 | |
| ], | |
| [ | |
| 6.663, | |
| 836.8 | |
| ], | |
| [ | |
| 6.93, | |
| 840.2 | |
| ], | |
| [ | |
| 7.184, | |
| 844.3 | |
| ], | |
| [ | |
| 7.443, | |
| 852.4 | |
| ] | |
| ], | |
| "io_delta": {}, | |
| "timing_line": "[ Prompt: 7.9 t/s | Generation: 21.6 t/s ]", | |
| "output": "Hello! 😊 I'm DeepSeek-R1, your friendly AI assistant. I'm here to help with all kinds of questions, learning, and creative tasks", | |
| "pager": { | |
| "routing_calls": 8448, | |
| "expert_touches": 64544, | |
| "hits": 35587, | |
| "misses": 3701, | |
| "evictions": 4572, | |
| "evicted_bytes": 9822062592, | |
| "sweeps": 1046, | |
| "resident_bytes": 327075840, | |
| "budget_bytes": 327155712, | |
| "hit_rate": 0.5514, | |
| "proc_self_read_bytes": 2428149760, | |
| "proc_self_rchar": 11947223 | |
| }, | |
| "output_matches_baseline": true, | |
| "swap_zero": true, | |
| "rc_ok": true, | |
| "rss_vs_baseline": -1.7321, | |
| "decode_rss_vs_baseline": -1.7321, | |
| "decode_rss_lower_than_baseline": true, | |
| "rss_lower_than_baseline": true, | |
| "ssd_reads_mib": 2315.7, | |
| "cold_weights_really_read_from_ssd": true, | |
| "pager_hit_rate": 0.5514, | |
| "pager_evictions": 4572, | |
| "pager_misses": 3701, | |
| "pager_resident_mib": 311.9, | |
| "pager_budget_mib": 312.0 | |
| }, | |
| "budget256mb": { | |
| "env": { | |
| "ST_PAGER": "1", | |
| "ST_RAM_BUDGET_MB": "256", | |
| "ST_RESERVE_MB": "200" | |
| }, | |
| "rc": 0, | |
| "seconds": 7.88, | |
| "peak": { | |
| "total_rss_gb": 0.5956, | |
| "anon_rss_gb": 0.1029, | |
| "file_rss_gb": 0.5922, | |
| "peak_swap_gb": 0.0, | |
| "hwm_rss_gb": 0.5956 | |
| }, | |
| "decode": { | |
| "total_rss_gb": 0.5956, | |
| "note": "prefill 後的峰值;prefill 會摸遍全部 expert,所以 peak 不代表 decode" | |
| }, | |
| "rss_timeline_mib": [ | |
| [ | |
| 0.0, | |
| 0.4 | |
| ], | |
| [ | |
| 0.207, | |
| 72.9 | |
| ], | |
| [ | |
| 0.413, | |
| 71.1 | |
| ], | |
| [ | |
| 0.624, | |
| 128.7 | |
| ], | |
| [ | |
| 0.835, | |
| 189.3 | |
| ], | |
| [ | |
| 1.047, | |
| 212.1 | |
| ], | |
| [ | |
| 1.259, | |
| 228.5 | |
| ], | |
| [ | |
| 1.474, | |
| 246.9 | |
| ], | |
| [ | |
| 1.69, | |
| 267.0 | |
| ], | |
| [ | |
| 1.907, | |
| 291.7 | |
| ], | |
| [ | |
| 2.128, | |
| 388.4 | |
| ], | |
| [ | |
| 2.352, | |
| 482.7 | |
| ], | |
| [ | |
| 2.577, | |
| 490.7 | |
| ], | |
| [ | |
| 2.802, | |
| 467.5 | |
| ], | |
| [ | |
| 3.024, | |
| 448.6 | |
| ], | |
| [ | |
| 3.25, | |
| 437.3 | |
| ], | |
| [ | |
| 3.489, | |
| 482.6 | |
| ], | |
| [ | |
| 3.719, | |
| 491.9 | |
| ], | |
| [ | |
| 3.952, | |
| 489.6 | |
| ], | |
| [ | |
| 4.184, | |
| 481.9 | |
| ], | |
| [ | |
| 4.417, | |
| 451.6 | |
| ], | |
| [ | |
| 4.652, | |
| 458.8 | |
| ], | |
| [ | |
| 4.887, | |
| 455.6 | |
| ], | |
| [ | |
| 5.122, | |
| 453.0 | |
| ], | |
| [ | |
| 5.36, | |
| 450.3 | |
| ], | |
| [ | |
| 5.6, | |
| 459.5 | |
| ], | |
| [ | |
| 5.834, | |
| 447.4 | |
| ], | |
| [ | |
| 6.068, | |
| 496.0 | |
| ], | |
| [ | |
| 6.301, | |
| 517.2 | |
| ], | |
| [ | |
| 6.543, | |
| 560.1 | |
| ], | |
| [ | |
| 6.785, | |
| 580.2 | |
| ], | |
| [ | |
| 7.024, | |
| 593.8 | |
| ], | |
| [ | |
| 7.263, | |
| 593.4 | |
| ], | |
| [ | |
| 7.504, | |
| 603.1 | |
| ], | |
| [ | |
| 7.743, | |
| 606.7 | |
| ] | |
| ], | |
| "io_delta": {}, | |
| "timing_line": "[ Prompt: 8.1 t/s | Generation: 19.7 t/s ]", | |
| "output": "Hello! 😊 I'm DeepSeek-R1, your friendly AI assistant. I'm here to help with all kinds of questions, learning, and creative tasks", | |
| "pager": { | |
| "routing_calls": 8448, | |
| "expert_touches": 64544, | |
| "hits": 34660, | |
| "misses": 4628, | |
| "evictions": 5625, | |
| "evicted_bytes": 12070591488, | |
| "sweeps": 1280, | |
| "resident_bytes": 57701376, | |
| "budget_bytes": 58720256, | |
| "hit_rate": 0.537, | |
| "proc_self_read_bytes": 2433163264, | |
| "proc_self_rchar": 11947223 | |
| }, | |
| "output_matches_baseline": true, | |
| "swap_zero": true, | |
| "rc_ok": true, | |
| "rss_vs_baseline": -1.9692, | |
| "decode_rss_vs_baseline": -1.9692, | |
| "decode_rss_lower_than_baseline": true, | |
| "rss_lower_than_baseline": true, | |
| "ssd_reads_mib": 2320.4, | |
| "cold_weights_really_read_from_ssd": true, | |
| "pager_hit_rate": 0.537, | |
| "pager_evictions": 5625, | |
| "pager_misses": 4628, | |
| "pager_resident_mib": 55.0, | |
| "pager_budget_mib": 56.0 | |
| }, | |
| "budget128mb": { | |
| "env": { | |
| "ST_PAGER": "1", | |
| "ST_RAM_BUDGET_MB": "128", | |
| "ST_RESERVE_MB": "200" | |
| }, | |
| "rc": 0, | |
| "seconds": 8.13, | |
| "peak": { | |
| "total_rss_gb": 0.6614, | |
| "anon_rss_gb": 0.103, | |
| "file_rss_gb": 0.657, | |
| "peak_swap_gb": 0.0, | |
| "hwm_rss_gb": 0.6614 | |
| }, | |
| "decode": { | |
| "total_rss_gb": 0.6614, | |
| "note": "prefill 後的峰值;prefill 會摸遍全部 expert,所以 peak 不代表 decode" | |
| }, | |
| "rss_timeline_mib": [ | |
| [ | |
| 0.0, | |
| 0.4 | |
| ], | |
| [ | |
| 0.207, | |
| 65.7 | |
| ], | |
| [ | |
| 0.415, | |
| 71.2 | |
| ], | |
| [ | |
| 0.624, | |
| 76.7 | |
| ], | |
| [ | |
| 0.834, | |
| 137.4 | |
| ], | |
| [ | |
| 1.048, | |
| 194.3 | |
| ], | |
| [ | |
| 1.264, | |
| 251.2 | |
| ], | |
| [ | |
| 1.482, | |
| 300.9 | |
| ], | |
| [ | |
| 1.703, | |
| 322.4 | |
| ], | |
| [ | |
| 1.928, | |
| 340.0 | |
| ], | |
| [ | |
| 2.151, | |
| 363.3 | |
| ], | |
| [ | |
| 2.383, | |
| 508.0 | |
| ], | |
| [ | |
| 2.619, | |
| 553.7 | |
| ], | |
| [ | |
| 2.857, | |
| 519.9 | |
| ], | |
| [ | |
| 3.112, | |
| 507.3 | |
| ], | |
| [ | |
| 3.361, | |
| 553.1 | |
| ], | |
| [ | |
| 3.608, | |
| 541.7 | |
| ], | |
| [ | |
| 3.856, | |
| 547.3 | |
| ], | |
| [ | |
| 4.107, | |
| 542.7 | |
| ], | |
| [ | |
| 4.358, | |
| 544.0 | |
| ], | |
| [ | |
| 4.599, | |
| 548.5 | |
| ], | |
| [ | |
| 4.839, | |
| 562.8 | |
| ], | |
| [ | |
| 5.082, | |
| 518.0 | |
| ], | |
| [ | |
| 5.32, | |
| 519.3 | |
| ], | |
| [ | |
| 5.556, | |
| 529.6 | |
| ], | |
| [ | |
| 5.794, | |
| 524.4 | |
| ], | |
| [ | |
| 6.033, | |
| 521.3 | |
| ], | |
| [ | |
| 6.271, | |
| 564.9 | |
| ], | |
| [ | |
| 6.509, | |
| 547.8 | |
| ], | |
| [ | |
| 6.746, | |
| 623.4 | |
| ], | |
| [ | |
| 6.992, | |
| 643.7 | |
| ], | |
| [ | |
| 7.234, | |
| 656.7 | |
| ], | |
| [ | |
| 7.475, | |
| 667.5 | |
| ], | |
| [ | |
| 7.716, | |
| 670.3 | |
| ], | |
| [ | |
| 7.955, | |
| 675.6 | |
| ] | |
| ], | |
| "io_delta": {}, | |
| "timing_line": "[ Prompt: 7.9 t/s | Generation: 20.9 t/s ]", | |
| "output": "Hello! 😊 I'm DeepSeek-R1, your friendly AI assistant. I'm here to help with all kinds of questions, learning, and creative tasks", | |
| "pager": { | |
| "routing_calls": 8448, | |
| "expert_touches": 64544, | |
| "hits": 34952, | |
| "misses": 4336, | |
| "evictions": 5298, | |
| "evicted_bytes": 11377677312, | |
| "sweeps": 1054, | |
| "resident_bytes": 132240384, | |
| "budget_bytes": 134217728, | |
| "hit_rate": 0.5415, | |
| "proc_self_read_bytes": 2429915136, | |
| "proc_self_rchar": 11947223 | |
| }, | |
| "output_matches_baseline": true, | |
| "swap_zero": true, | |
| "rc_ok": true, | |
| "rss_vs_baseline": -1.9034, | |
| "decode_rss_vs_baseline": -1.9034, | |
| "decode_rss_lower_than_baseline": true, | |
| "rss_lower_than_baseline": true, | |
| "ssd_reads_mib": 2317.3, | |
| "cold_weights_really_read_from_ssd": true, | |
| "pager_hit_rate": 0.5415, | |
| "pager_evictions": 5298, | |
| "pager_misses": 4336, | |
| "pager_resident_mib": 126.1, | |
| "pager_budget_mib": 128.0 | |
| } | |
| }, | |
| "all_passed": true | |
| } | |