FlashML-org/FreeToken
FreeToken brings datacenter-scale model serving to your desktop. Run massive models locally, fast and efficiently.
Python★ 15,546+242 that day#8 on trending
C63.7/100
Duplication58
6.7% in python, c-header, c, cpp, bashDead code94
0.6%Complexity50
49.7% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
7.82%duplicated code · 10,928 of 139,719 lines
903clones in code
524code files of 749 scanned
6.63%duplicated over all files · 1,075 clones
Most complex files
- python/freetoken/kernel/csrc/ggml/src/ggml-quants.c1194 cx
- python/freetoken/server/function_call_parser.py881 cx
- python/freetoken/engine/engine.py548 cx
- scripts/ftw_hotfix.py464 cx
- scripts/checkpoint_diagnose/diagnose.py438 cx
- python/freetoken/kernel/csrc/ggml/ggml-cpu/vec.h349 cx
- python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c249 cx
- python/freetoken/launch.py238 cx
- python/freetoken/kernel/csrc/ggml/ggml-cpu/quants.c216 cx
- python/freetoken/moe/benchbw.py213 cx
Dead code 0.63% unused · 40 findings
- python/freetoken/layers/linear_attn/gdn_reference.pyunused-file
- python/freetoken/mm/processors/deepseek_v4.pyunused-file
- python/freetoken/mm/processors/gemma4.pyunused-file
- python/freetoken/mm/processors/qwen_vl.pyunused-file
- python/freetoken/mm/processors/minimax_m3.pyunused-file
- python/freetoken/mm/processors/deepseek_v41.pyunused-file
- python/freetoken/mm/processors/glm5_next.pyunused-file
- python/freetoken/mm/processors/muse_glimmer.pyunused-file
- python/freetoken/models/deepseek_v4/image_processor.pyunused-file
- python/freetoken/moe/fused.py:_torch_fused_topkunused-symbol
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 9 lines in 21 placesc73 tokenspython/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:1830–1838python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2102–2110python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2280–2288python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2490–2498python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2724–2732and 16 more
1830void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT vx, size_t bx, const void * GGML_RESTRICT vy, size_t by, int … 1831 assert(n % QK_K == 0); 1832 assert(nrc == 1); 1833 UNUSED(nrc); 1834 UNUSED(bx); 1835 UNUSED(by); 1836 UNUSED(bs); 1837 1838 const uint32_t kmask1 = 0x03030303;2102void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT vx, size_t bx, const void * GGML_RESTRICT vy, size_t by, int … 2103 assert(n % QK_K == 0); 2104 assert(nrc == 1); 2105 UNUSED(nrc); 2106 UNUSED(bx); 2107 UNUSED(by); 2108 UNUSED(bs); 2109 2110 const block_q4_K * GGML_RESTRICT x = vx; - 69 lines in 3 placespython497 tokenspython/freetoken/models/llama/attention.py:17–85python/freetoken/models/mistral/attention.py:17–85python/freetoken/models/qwen2/attention.py:17–85
17class LlamaAttention(BaseOP): 18 def __init__( 19 self, 20 config: ModelConfig, 21 layer_id: int, 22 *, 23 has_attn_bias: bool = False, 24 has_qk_norm: bool = False, 25 prefix: str = "", 26 ):First 10 of 69 lines.
- 59 lines in 4 placespython323 tokenspython/freetoken/models/llama/weight.py:1–59python/freetoken/models/mistral/weight.py:1–59python/freetoken/models/qwen2/weight.py:1–59python/freetoken/models/qwen3/weight.py:1–59
1from __future__ import annotations 2 3from typing import Iterator 4 5import safetensors 6import torch 7from freetoken.distributed import get_tp_info 8from freetoken.models.loader import MergeRule, iter_merged_tensors, iter_weight_files, shard_tensor 9from freetoken.utils import cached_load_hf_config 10from tqdm import tqdmFirst 10 of 59 lines.
7 more
- 69 lines in 2 placesc758 tokens
- 43 lines in 4 placespython230 tokens
- 38 lines in 2 placesc578 tokens
- 71 lines in 2 placesc-header555 tokens
- 9 lines in 11 placespython52 tokens
- 43 lines in 3 placespython255 tokens
- 54 lines in 2 placesc503 tokens
Largest clones over all files, tests and data included
- 9 lines in 21 placesc73 tokenspython/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:1830–1838python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2102–2110python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2280–2288python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2490–2498python/freetoken/kernel/csrc/ggml/ggml-cpu/arch/x86/quants.c:2724–2732and 16 more
1830void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT vx, size_t bx, const void * GGML_RESTRICT vy, size_t by, int … 1831 assert(n % QK_K == 0); 1832 assert(nrc == 1); 1833 UNUSED(nrc); 1834 UNUSED(bx); 1835 UNUSED(by); 1836 UNUSED(bs); 1837 1838 const uint32_t kmask1 = 0x03030303;2102void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT vx, size_t bx, const void * GGML_RESTRICT vy, size_t by, int … 2103 assert(n % QK_K == 0); 2104 assert(nrc == 1); 2105 UNUSED(nrc); 2106 UNUSED(bx); 2107 UNUSED(by); 2108 UNUSED(bs); 2109 2110 const block_q4_K * GGML_RESTRICT x = vx; - 69 lines in 3 placespython497 tokenspython/freetoken/models/llama/attention.py:17–85python/freetoken/models/mistral/attention.py:17–85python/freetoken/models/qwen2/attention.py:17–85
17class LlamaAttention(BaseOP): 18 def __init__( 19 self, 20 config: ModelConfig, 21 layer_id: int, 22 *, 23 has_attn_bias: bool = False, 24 has_qk_norm: bool = False, 25 prefix: str = "", 26 ):First 10 of 69 lines.
- 59 lines in 4 placespython323 tokenspython/freetoken/models/llama/weight.py:1–59python/freetoken/models/mistral/weight.py:1–59python/freetoken/models/qwen2/weight.py:1–59python/freetoken/models/qwen3/weight.py:1–59
1from __future__ import annotations 2 3from typing import Iterator 4 5import safetensors 6import torch 7from freetoken.distributed import get_tp_info 8from freetoken.models.loader import MergeRule, iter_merged_tensors, iter_weight_files, shard_tensor 9from freetoken.utils import cached_load_hf_config 10from tqdm import tqdmFirst 10 of 59 lines.
- 69 lines in 2 placesc758 tokens
- 43 lines in 4 placespython230 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 471 | 109,627 | 542 | 6,816 | 6.22% |
| c | 4 | 11,322 | 298 | 3,311 | 29.24% |
| c-header | 27 | 13,078 | 46 | 668 | 5.11% |
| cpp | 17 | 4,659 | 17 | 133 | 2.85% |
| bash | 5 | 1,033 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 643 | 155,092 | 697 | 8,320 | 5.36% |
| c | 4 | 11,322 | 298 | 3,311 | 29.24% |
| c-header | 30 | 13,580 | 46 | 668 | 4.92% |
| cpp | 18 | 4,734 | 17 | 133 | 2.81% |
| diff | 1 | 1,400 | 11 | 93 | 6.64% |
| yaml | 9 | 804 | 4 | 60 | 7.46% |
| markup | 4 | 47 | 2 | 21 | 44.68% |
| markdown | 18 | 1,718 | 0 | 0 | 0% |
| bash | 14 | 1,138 | 0 | 0 | 0% |
| toml | 2 | 167 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Nov 2, 2026 | #8 | 15,546 (+242) | 749 | 190,196 | 1,075 | 6.63% | 7.82% | C 63.7 | ee43b2a |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.