saladday1 commited on
Commit
af4699d
·
verified ·
1 Parent(s): e453f0b

code: sync from git

Browse files
code/.claude/skills/eco-release/SKILL.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: eco-release
3
+ description: MiniMax 官方在 Hugging Face 上发了新模型(新版本如 M3-Pro / M4,新的视频、图像、语音模型,或全新模态)时,把它接进 MiniMax Ecosystem 看板的完整流程:写下游生态的收集规则(分类器),把发布加进落地页(必要时新增模态的颜色和背景视频),本地验收,然后部署上线。Use when the user says 官方发了新模型、新增一个模型、加一个品类、新发布接入看板、add a new MiniMax release / model family to the ecosystem dashboard。已跟踪模型的社区新派生每天会自动抓到,不需要这个 skill。
4
+ ---
5
+
6
+ # eco-release:把一次官方新发布接进 MiniMax Ecosystem
7
+
8
+ 项目在 `~/dev/hf-h3`。各部分:
9
+ - **公开看板**:Space `MiniMaxAI/ecosystem`,https://minimaxai-ecosystem.static.hf.space/index.html
10
+ - **私有数据集**:`MiniMaxAI/oss-ecosystem-data`
11
+ - **每日定时任务**:HF Jobs `6afda8a6545f95df1c063466`,每天 00:30 UTC 跑。它每次从数据集的 `code/` 拉代码运行。
12
+
13
+ 本文件是主流程。细节在三份参考里,第一次走到对应步骤时再读:
14
+ - `reference/rules.md`:分类器怎么判、每个字段干什么、各类发布的配方
15
+ - `reference/page.md`:页面哪些自动、新模态要改哪几处、背景视频怎么取、预览截图
16
+ - `reference/deploy.md`:本地试跑、验收门槛、上线顺序、回退、常见坑
17
+
18
+ 脚本在 `scripts/`。都从仓库根目录用 `python3` 运行,联网的命令前加 `env -u ALL_PROXY -u all_proxy`:
19
+
20
+ | 脚本 | 用途 |
21
+ |---|---|
22
+ | `inspect_official.py <官方仓库…>` | 读出新模型的结构事实:model_type、尺寸、张量名模式、GGUF 架构、Hub 上同标签的仓库数、卡片里的叫法 |
23
+ | `try_repo.py <家族> <仓库…>` | 用当前规则现场分类几个仓库,打印证据。写规则时边写边试 |
24
+ | `label_diff.py <家族> <旧标签>` | 改规则前后每个发布的计数,以及每个变动的仓库 |
25
+ | `sample.py <家族> <lineage> [N] [--uncounted]` | 随机抽样出链接,人工核对 |
26
+ | `preview.sh [--live-data]` | 用本地或线上数据构建页面,在 Mac 上开 18767 端口 |
27
+ | `shots.mjs`(在 Mac 上运行) | 桌面和手机截图,报告报错、404、溢出,以及顶部视频是否在播 |
28
+ | `site_media.mjs`(在 Mac 上运行) | 列出 minimax.io 页面上的全部视频素材地址 |
29
+ | `run_job.py [--wait]` | 按定时任务的配置立刻跑一次,当天刷新线上数据 |
30
+ | `check_live.py [发布key…]` | 线上页面现在有哪些发布、各自的数字 |
31
+
32
+ ## 什么时候用
33
+
34
+ - **用**:MiniMax 官方新发布了模型,Hub 上出现了 `MiniMaxAI/<新仓库>`,比如 M3-Pro、M4、H4、Speech-3、某个 Embedding。
35
+ - **不用**:已跟踪模型的社区派生。它们每天自动被发现和分类。
36
+ - **什么都不做的后果**有两种,都不对:
37
+ - **被旧发布悄悄吞掉**:名字落在已有发布的宽模式里的,例如 MiniMax-M3-Pro 会被 `MiniMax-M3(-.+)?` 收进 M3。日志里什么都没有,页面上 M3 的数字凭空变大。它的派生也会被 M3 的规则(共用架构、名字里的 "m3")算给 M3。
38
+ - **自成一个发布**:匹配不上任何模式的(例如 MiniMax-M3.1-Flash 对 `MiniMax-M3(-.+)?`),日志里有 `matches no release rule`,模态按 pipeline tag 猜。它的社区只按声明的 base_model 统计,没声明的派生会漏;如果和兄弟版本共用结构,还会被兄弟的家族规则抢走。
39
+
40
+ ## 流程
41
+
42
+ ### 1. 确认事实
43
+
44
+ - 新发布有哪些官方仓库:主仓库、-hf 版、官方量化、草稿模型等;
45
+ - 它们是否已经公开:`private is False` 才会出现,没公开就先写规则,不上线;
46
+ - 发布日期、属于哪个模态、页面上显示什么名字。
47
+
48
+ 能从 Hub 查到的不要问用户。下面几种情况再问:
49
+ - 要不要展示(像 H3-Image-PE 那样只分类、不展示);
50
+ - 新模态在页面上叫什么;
51
+ - 有没有官方的背景素材。
52
+
53
+ ### 2. 摸底
54
+
55
+ ```bash
56
+ env -u ALL_PROXY -u all_proxy python3 .claude/skills/eco-release/scripts/inspect_official.py MiniMaxAI/<新仓库> [MiniMaxAI/<兄弟版本仓库>]
57
+ ```
58
+
59
+ 把新模型和最像它的已有成员放在一起看:
60
+ - model_type 和 architectures 是否相同;
61
+ - hidden、vocab、层数、专家数;
62
+ - 有没有独有的层名;
63
+ - GGUF 架构名;
64
+ - 卡片里怎么称呼自己。
65
+
66
+ ### 3. 归类,选配方
67
+
68
+ | 新发布的情况 | 配方(`rules.md` 第 4 节) | 页面 |
69
+ |---|---|---|
70
+ | 现有系列的新版本,沿用已有架构(M3-Pro、M3.5) | A:在 `m.py` 的 RELEASES 加一行,Arch.members 加上它,排除兄弟 token | 自动 |
71
+ | 现有系列换了新架构(M4) | B:A 的基础上新增 Arch 和 tag_filters | 自动 |
72
+ | 视频或图像 DiT 家族的新成员 | C:形状相同就加进 `h3.py`,用 marker、meta、probe 区分;形状不同就建新家族 | 自动 |
73
+ | 全新的系列或模态(语音��3D、Embedding…) | D:新建 `families/<key>.py` 并注册;org 加 CATEGORY_NAME | **要改**:`page.md` 第 2 节 |
74
+ | 只认声明的小发布(数据集式、研究模型) | E:只在 org.RELEASES 加一行,最后一项为 None | 自动 |
75
+ | 公开但不展示 | F:`org.HIDDEN` 或 `tracked=False` | — |
76
+
77
+ 拿不准时,宁可建新家族,也不要往不相干的家族里硬塞。区分靠的是"同结构内谁是谁",不同结构本来就能分开。
78
+
79
+ ### 4. 写规则
80
+
81
+ - **改家族文件**:按 `rules.md` 改 `hfeco/families/<key>.py`,文件顶部 "Facts these rules rely on (checked <日期>)" 写上这次核对的事实。
82
+ - **改兄弟版本**:回头检查已有版本的 token、`card_rules`、`header_rules`,确保不会抢新版本的仓库。
83
+ - **改 org**:在 `hfeco/org.py` 的 `RELEASES` 加一行。**放在比它宽的模式之前**,因为先匹配先赢。
84
+ - **改版本号**:`hfeco/classify.py` 的 `VERSION`,改成今天的日期加序号。
85
+ - **生成参考数据**:`python3 scripts/build_reference.py --family <key>`。成员有任何增删改名都要重跑。
86
+ - **当场试**:用 `try_repo.py` 试官方仓库(应为 official)、几个已知派生、几个已知不是的仓库,改到证据都说得通为止。
87
+
88
+ ### 5. 页面
89
+
90
+ - 新发布落在已有模态时,页面代码一般不用改,只在预览里检查新名字的标记(`page.md` 第 4 节)。
91
+ - 新模态按 `page.md` 第 2 节逐项改:org 的显示名、`CAT_ORDER`、颜色(用 dataviz 验证器检查)、`media.tsx`、背景和卡片视频。
92
+ - 页面风格跟 minimax.io 一致:亮色、会动的官方素材背景、白色卡片。
93
+ - 文案用英文,不加小字说明,不说 open source。
94
+
95
+ ### 6. 本地试跑和验收
96
+
97
+ ```bash
98
+ env -u ALL_PROXY -u all_proxy python3 -c "from hfeco import store; store.pull()" # 和线上对齐(先 git stash 规则改动也行,这步不碰代码)
99
+ cp -r data/raw/org /tmp/org_backup # org 那一步会重写本地当天的快照
100
+ # 规则(只跑这个家族,不推送):已有家族改规则用 --skip-snapshot;新家族或新搜索词去掉它,先拍快照
101
+ cp data/labels/<key>/latest.parquet /tmp/<key>_before.parquet # 改规则之前做;新家族没有,跳过
102
+ env -u ALL_PROXY -u all_proxy python3 scripts/daily.py --family <key> --skip-snapshot --skip-org
103
+ python3 .claude/skills/eco-release/scripts/label_diff.py <key> /tmp/<key>_before.parquet
104
+ python3 .claude/skills/eco-release/scripts/sample.py <key> <新lineage> 25
105
+ python3 .claude/skills/eco-release/scripts/sample.py <key> <新lineage> 15 --uncounted
106
+ # 页面数据:一定要全部家族一起跑(org 那一步要读每个家族的 dashboard/family/<key>.json)
107
+ env -u ALL_PROXY -u all_proxy python3 scripts/daily.py --skip-snapshot
108
+ bash .claude/skills/eco-release/scripts/preview.sh && ssh parsar-mac 'cd ~/mm-shots && /opt/homebrew/bin/node shots.mjs new "home:/,rel:/<模态>/<发布key>"'
109
+ ```
110
+
111
+ `deploy.md` 第 2 节的七条门槛全部满足才往下走:
112
+ 1. 官方仓库判为 official;
113
+ 2. 已知派生分对;
114
+ 3. 已知不是的被排除;
115
+ 4. 前后差异都能解释;
116
+ 5. 抽样错误率不超过 5%;
117
+ 6. 日志没有异常;
118
+ 7. 截图没有 problems。
119
+
120
+ 抽样核对里有拿不准的仓库,列出来问用户,不要自己拍板。
121
+
122
+ ### 7. 提交和上线
123
+
124
+ 上线对外可见。用户没明确说"上线"或"部署"前,先把验收结果给用户看,再问。
125
+
126
+ 1. `git add`(新文件一定要 add),然后 `git commit`。
127
+ 2. `python3 scripts/push_code.py`:每日任务从这里取代码。
128
+ 3. 页面有改动时:`python3 scripts/deploy_space.py`。Space 的说明改了要单独上传 README,见 `deploy.md` 第 4 节。
129
+ 4. `python3 .claude/skills/eco-release/scripts/run_job.py --wait`:当天刷新数据。不跑的话,明天 00:30 UTC 会自动带上。
130
+ 5. `python3 .claude/skills/eco-release/scripts/check_live.py <发布key>`,再截一张线上首页和新发布的页面。
131
+
132
+ ### 8. 收尾
133
+
134
+ - **文档**:更新 `README.md` 的家族列表、`hfeco/families/__init__.py` 的文件头、`dataset/README.md` 的取值示例。
135
+ - **飞书文档**:"匹配规则"一章补一段,改之前问用户,链接和注意事项见 `deploy.md` 第 5 节。
136
+ - **记忆**:在 `h3-ecosystem-dashboard.md` 记一笔。
137
+ - **告诉用户**:
138
+ - 新发布有多少社区模型、多少下载;
139
+ - 有没有分类页 tab(满 10 个才有);
140
+ - 哪些地方是猜的或合成的,例如没有官方素材时用了替代视频;
141
+ - 有没有遗留问题。
142
+
143
+ ## 不能破的规矩
144
+
145
+ - **私有仓库永远不上页面**:只取 `private is False`;`check_public` 和 `check_owned_public` 拦下来时,查清原因,不要绕过。
146
+ - **不说 "open source"**:只说 open models / open-weight。站名是 MiniMax Ecosystem。
147
+ - **网页英文、聊天中文、不加小字说明**:每个元素都要带信息。
148
+ - **`raw/` 只追加**:标���可以随时重算。不要本地带 `--push` 覆盖当天线上快照,用 `run_job.py`。
149
+ - **token 只用这台机器上已经同意过的**:saladday1 的 token 只用于这个任务。换账号或往别处存 token 前先问用户。
150
+ - **在别人的仓库上提 PR、改飞书文档或分享权限前,先问用户。**
code/.claude/skills/eco-release/reference/deploy.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 验证与上线参考
2
+
3
+ ## 1. 本地试跑
4
+
5
+ 本地数据目录是 `data/`,是私有数据集 `MiniMaxAI/oss-ecosystem-data` 的镜像。先和线上对齐,因为每日任务已经在数据集里写了最新的 raw、labels 和 cache:
6
+
7
+ ```bash
8
+ env -u ALL_PROXY -u all_proxy python3 -c "from hfeco import store; store.pull()" # 约 90 MB,变化的文件才下载;本机约 100 KB/s,要几分钟
9
+ cp data/labels/<key>/latest.parquet /tmp/<key>_before.parquet # 留一份改规则前的标签
10
+ ```
11
+
12
+ 然后按改动的范围选一种跑法。都**不加 `--push`**,只写本地,不会上传任何东西。
13
+
14
+ | 情况 | 命令 | 说明 |
15
+ |---|---|---|
16
+ | 只改了规则,新成员的派生已经在候选里(共用的 tag_filter 早就把它们找来了) | `python3 scripts/daily.py --family <key> --skip-snapshot --skip-org` | 最快。用最新那天的快照,缓存里有的不重探 |
17
+ | 新加了搜索词、标签或新家族,需要重新发现 | `python3 scripts/daily.py --family <key> --skip-org` | 重新拍一份本地快照,新候选会被探测。新家族第一次必须这样跑 |
18
+ | 要看页面数据(site.json 和各模态页) | `python3 scripts/daily.py --skip-snapshot` | **全部家族一起跑**:org 那一步要读每个家族的 `data/dashboard/family/<key>.json`,只跑一个家族就会缺文件退出。新家族先用上一行拍过快照,再跑这一行 |
19
+
20
+ 参考耗时(2026-11-23 在这台机器上实测):
21
+ - pull 约 1–2 分钟;
22
+ - 只重新分类 m 家族(`--skip-snapshot --skip-org`)约 5 秒;
23
+ - `build_reference.py --family m` 约 10 秒;
24
+ - 全部家族加 org(`--skip-snapshot`)约 6 分钟,大头是探测 h3 当天新出现的仓库。
25
+
26
+ 注意:
27
+ - `--skip-snapshot` 的意思是"用最新那天的快照"。新家族没有快照,不能跳过。
28
+ - 本地跑会写 `data/raw/<key>/<今天>.parquet`(不加 `--skip-snapshot` 时),org 那一步还会重写 `data/raw/org/<今天>.parquet`。先备份 `data/raw/org`。不要在本地跑带 `--push` 的全量任务去覆盖线上快照,上线用第 4 节的一次性任务。
29
+ - 文件布局:`data/dashboard/family/<家族>.json` 是家族看板,只在本地,org 那一步要用;`data/dashboard/site.json` 和 `data/dashboard/<模态>.json` 是页面数据,会传到 Space。
30
+ - 用 `python3`(这台机器没有 `python`)。网络命令前加 `env -u ALL_PROXY -u all_proxy`,SOCKS 代理变量会让 npm 和部分请求出错。
31
+
32
+ ## 2. 验收门槛(全部过了才上线)
33
+
34
+ 1. **官方仓库本身**:
35
+ - `try_repo.py <key> <官方仓库>` 应得到 `relation=official`;
36
+ - 官方的 also 仓库(量化版、-hf 版)也应该是 official。
37
+ 2. **已知派生**:
38
+ - 挑 5–10 个确定是新模型派生的仓库试分类,覆盖各种形态:GGUF(unsloth、bartowski、lmstudio-community)、MLX(mlx-community)、AWQ / GPTQ / FP8、LoRA、微调、合并、官方仓库的整仓搬运;
39
+ - 每个的 lineage 和 relation 都要对,证据要说得通。
40
+ 3. **已知不是的**:
41
+ - 同系列旧版本的派生不能被拉到新成员上,例如 M3 的 GGUF 不能变成 M3-Pro;
42
+ - 别家模型只在卡片里提了一句的不算;
43
+ - 早于官方发布日创建的仓库不算。
44
+ 4. **前后对比** `label_diff.py <key> /tmp/<key>_before.parquet`:
45
+ - 旧版本的计数不应莫名下降;
46
+ - 每一条 MOVED / DROPPED 都要能解释,例如原来误归 M3、现在正确归到 M3-Pro;
47
+ - 解释不了的就是规则写错了。
48
+ 5. **抽样核对**:
49
+ - `sample.py <key> <新lineage> 25`:逐个打开链接核对,错误率不超过 5%;
50
+ - `sample.py <key> <新lineage> 15 --uncounted`:看被排除的仓库里有没有漏掉的。
51
+ 6. **日志**:
52
+ - `claimed by more than one family` 里,新成员的仓库应该留在正确的家族;
53
+ - `family but release unknown` 不应该暴涨;
54
+ - org 那一步不应出现新的 `matches no release rule`,除非是有意的。
55
+ 7. **页面**:预览截图(见 `page.md` 第 5 节)没有 problems;新发布的卡片、标记、发布钉、模态都正确。
56
+
57
+ ## 3. 提交
58
+
59
+ ```bash
60
+ git add hfeco/ scripts/ web/src web/public/media space/ README.md dataset/README.md .claude/skills # 新文件必须 add
61
+ git status --short # 确认没有漏掉新文件:push_code 只上传 git 跟踪的文件,漏了的话每日任务会在 import 时失败
62
+ git -c user.name=x -c user.email=x@x commit -m "<发布名>: 收集规则 + 页面"
63
+ ```
64
+
65
+ `hfeco/families/<key>_reference.json` 也要提交,它就在 git 里。
66
+
67
+ ## 4. 上线(对外可见,用户没明确说"上线"前先确认)
68
+
69
+ 按顺序:
70
+
71
+ 1. **代码给每日任务**:`env -u ALL_PROXY -u all_proxy python3 scripts/push_code.py`。每日任务从数据集的 `code/` 拉代码,所以不用改定时任务本身。
72
+ 2. **页面代码有改动时**(颜色、CAT_ORDER、素材、标记):`env -u ALL_PROXY -u all_proxy python3 scripts/deploy_space.py`。它会构建 `web/` 并上传 dist,不碰 Space 的 `data/` 和 `README.md`。
73
+ 3. **Space 说明有改动时**:`deploy_space.py` 不传 README,要单独上传:
74
+
75
+ ```python
76
+ from huggingface_hub import HfApi
77
+ HfApi().upload_file(path_or_fileobj="space/README.md", path_in_repo="README.md", repo_id="MiniMaxAI/ecosystem",
78
+ repo_type="space", commit_message="card: …")
79
+ ```
80
+
81
+ 4. **当天刷新线上数据**:
82
+ - `python3 .claude/skills/eco-release/scripts/run_job.py --wait`。它按定时任务的同一套配置马上跑一次,要跑几十分钟(定时任务的超时是 2 小时),新候选越多越久。
83
+ - 不跑的话,每天 00:30 UTC 的定时任务会自动带上新规则。
84
+ - 同一天重跑会替换当天的快照,这是正常的。
85
+ 5. **核对线上**:
86
+ - `python3 .claude/skills/eco-release/scripts/check_live.py <发布key>`:确认新发布在线上数据里,看社区数和是否已有分类页;
87
+ - `bash .claude/skills/eco-release/scripts/preview.sh --live-data` 后再截图,或者直接用 shots.mjs 截线上地址(改 `U`)。
88
+ 6. **隐私闸门**:`org.check_public` 和 `check_owned_public` 会在写出前拦下任何私有的 MiniMaxAI 仓库。被拦时任务会报错退出,**不要绕过**,先查清是哪个仓库还没公开。
89
+
90
+ ## 5. 文档与记忆
91
+
92
+ - `README.md`:"目录"里的家族列表、"加一个模型家族"的说明。
93
+ - 家族文件顶部的 "Facts these rules rely on (checked <日期>)"。
94
+ - `hfeco/families/__init__.py` 的文件头列表。
95
+ - `dataset/README.md`:`release` 和 `modality` 的取值示例。
96
+ - **飞书文档**《MiniMax Ecosystem:我们的模型在HF的生态》(https://vrfi1sk8a0.feishu.cn/docx/PtRmdS30qoJVCbxopFscRt4AnCd):
97
+ - "匹配规则"一章按模态写了每个系列怎么认;
98
+ - 新系列或新模态要补一段,口吻和现有段落一致:讲认的依据,不讲代码;
99
+ - 改之前问用户,用 lark-doc skill 的 `docs +update --as user`;
100
+ - 不改分享权限,不写 token、私有仓库名和账号信息。
101
+ - **记忆**:`~/.claude/projects/-home-fanjingluo-dev-hf-h3/memory/h3-ecosystem-dashboard.md` 记一笔:什么时候加了哪个发布,有没有遗留问题。
102
+
103
+ ## 6. 出问题怎么回退
104
+
105
+ - **代码**:`git revert <commit>`,然后 `push_code.py`;页面有改动的再跑 `deploy_space.py`;最后 `run_job.py` 重新生成数据。
106
+ - **Space 某次提交**:`HfApi().list_repo_commits("MiniMaxAI/ecosystem", repo_type="space")` 找到上一版。页面文件重新 `deploy_space.py` 即可;数据文件等下一次任务覆盖,或者用上一版的 `data/*.json` 重新上传。
107
+ - **标签**:`labels/<key>/latest.parquet` 随时可以重算,不用回退。`raw/` 只追加,不要手动改。
108
+
109
+ ## 7. 常见坑
110
+
111
+ - **新仓库被旧版本吃掉**:`org.RELEASES` 是先匹配先赢,`MiniMax-M3(-.+)?` 会吃掉 MiniMax-M3-Pro。新行要放在更宽的模式之前。
112
+ - **兄弟版本的 token 没排除新版本**:M3 的 `text_hint`、`card_rules`、`header_rules` 会给 M3-Pro 的仓库加分。
113
+ - **新架构没加 `tag_filters`**:名字里不带 MiniMax 的派生就找不到。
114
+ - **加了 `marker_rules` 或 `meta_rules` 但没重探**:缓存里没有对应证据,规则形同虚设。
115
+ - **没跑 `build_reference.py`**:新成员的整仓搬运认不出来,会被当成普通 finetune 或认不出。删除或改名成员后没重建,更糟:参考数据里的旧 lineage 会让分类直接报 `KeyError: '<旧名>'`(2026-11-23 演练时遇到过)。
116
+ - **新模态没加进 `CAT_ORDER`**:首页曲线里整个消失。
117
+ - **新文件没 `git add`**:每日任务 import 失败,当天数据断档。
118
+ - **官方模型还没公开**:`private` 不是 False 的仓库永远不会出现,这是对的。等公开了再上线页面,规则可以提前写好。
119
+ - **发布头几天社区模型少于 10 个**:没有分类页 tab,卡片指向 HF。这是设计如此,不是 bug。
code/.claude/skills/eco-release/reference/page.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 页面参考(web/)
2
+
3
+ 页面是静态的:Vite、React 19、Tailwind v4、shadcn、Recharts、d3。数据全部来自 `data/site.json` 和 `data/<模态>.json`,由每日任务的 `org.build` 生成。**发布、tab、菜单、曲线上的发布钉、发布卡片、模态块都由数据驱动**,新发布落在已有模态里时,页面代码一般不用改。
4
+
5
+ 视觉基准是 https://www.minimax.io/ :
6
+ - 亮色,顶部是官方的柔焦循环视频,往下渐隐成白色;
7
+ - 白字只放在视频上,其余内容都在白色圆角卡片里;
8
+ - 标题用 Outfit,口号和数字用 Libre Baskerville,模型标记用 Abhaya Libre ExtraBold,正文用 DM Sans。
9
+
10
+ 用户的硬性要求:
11
+ - 网页文案用英文;
12
+ - 不要小字说明、副标题和注释,每个元素都要带信息;
13
+ - 不说 "open source",只说 open models / open-weight;
14
+ - 好看、有格调,不花哨。
15
+
16
+ ## 1. 自动的部分(无需改代码)
17
+
18
+ - **新发布的卡片**(Every release):小视频按模态取;标记由 `lockup.tsx` 按名字拆,见第 4 节。
19
+ - **首页曲线**:发布钉、模态 chip 的数字都自动。
20
+ - **Models 下拉菜单、模态块、分类页 tab**:分类页 tab 要等社区模型满 `org.PAGE_MIN = 10` 个才出现。不到 10 个时,卡片点开去 HF;数据每天都在算,满了自动出 tab。
21
+ - **首页模态顺序**:video 固定第一,其余按社区规模排(`org.build` 里的 `cats`)。
22
+ - **Downloads 视图和标题总下载数**:按 `site.dl_total` 自动加进去。
23
+
24
+ ## 2. 新模态要改的地方(缺一处就会出错)
25
+
26
+ | 位置 | 改什么 | 漏了的后果 |
27
+ |---|---|---|
28
+ | `hfeco/org.py` `CATEGORY_NAME` | 显示名,英文 | 显示成 key 的 title case |
29
+ | `hfeco/org.py` `PIPELINE_CATEGORY` | 新 pipeline tag 归到哪个模态 | 没写进 RELEASES 的仓库被归为 language |
30
+ | `web/src/lib/category.ts` `CAT_ORDER` | 加上新 key,位置就是首页堆叠图从下往上的顺序 | **这个模态在首页曲线、chip 和下载视图里整个消失**(`useSeries` 只取 CAT_ORDER 里的模态) |
31
+ | `web/src/index.css` `:root` | `--cat-<key>`、`--cat-<key>-from`、`--cat-<key>-to` | 用中性灰 |
32
+ | `web/src/index.css` `.dark` | `--cat-<key>` 的深色版(只有 Galaxy 舞台用 .dark) | Galaxy 光晕色不对 |
33
+ | `web/src/components/media.tsx` `media()` | 把新 key 加进认得的列表 | 顶部视频和卡片视频退回语言的那朵花 |
34
+ | `web/public/media/` | `hero-<key>.mp4/.jpg`、`tile-<key>.mp4/.jpg` | 404,视频区空白 |
35
+ | `dataset/README.md` | `modality` 列的取值说明 | 数据集说明过时 |
36
+
37
+ ### 颜色
38
+
39
+ - 从品牌色里取:橙红 `#FF3763→#FF7038`、紫 `#7A27FF→#A36AFF`、蓝 `#1BA4FF→#38CDFF`、珊瑚 `#FF6452`、酒红 `#9A0010`。
40
+ - 现有模态色:language `#ff3763`、video `#7a27ff`、music `#a8102e`、image `#0a8ae6`。深色版依次是 `#ff4558`、`#8b4dff`、`#b01a44`、`#1a93ec`。
41
+ - 新颜色必须用 dataviz skill 的验证器检查。先加载 dataviz skill,再按 CAT_ORDER 的顺序把全部模态色一起测:
42
+
43
+ ```bash
44
+ python3 <dataviz skill>/scripts/validate_palette.py "#ff3763,#7a27ff,#a8102e,#0a8ae6,<新色>" --mode light --surface "#ffffff"
45
+ python3 <dataviz skill>/scripts/validate_palette.py "<深色版…>" --mode dark --surface "#000000"
46
+ ```
47
+
48
+ 相邻的模态要过 CVD(色盲)检查。紫色系已经被 video 占了,新的多模态线不要再用相近的紫。
49
+ - `-from/-to` 是模型数字的渐变(模态块的大数字)。白底上 `-to` 太浅会看不清,参考 image 把 `#1BA4FF` 压暗成 `#1494ee` 的做法。
50
+
51
+ ### 素材(会动的背景)
52
+
53
+ 背景和卡片视频都来自官网,打包在 `web/public/media/` 一起部署,不外链官网 CDN,因为官网换图就会失效。
54
+
55
+ 1. **找官网的素材**:在 Mac 上跑 `scripts/site_media.mjs`,列出官网首页和对应模型页的全部 `<video>`。文件在 `file.cdn.minimax.io`,允许跨域。
56
+ - `minimax-home-hero-*-preview.mp4` 是首屏背景,1920×1080,约 1.2 MB,主体在上方、底部已渐隐成白色。
57
+ - `minimax-home-model-card-*-bg.mp4` 是卡片背景,约 246×234。
58
+ 2. **下载并转码**:
59
+
60
+ ```bash
61
+ M=web/public/media
62
+ curl -s -o $M/hero-<key>.mp4 https://file.cdn.minimax.io/public/<hero>-preview.mp4
63
+ ffmpeg -v error -y -ss 2 -i $M/hero-<key>.mp4 -frames:v 1 -q:v 4 -vf scale=1280:-1 $M/hero-<key>.jpg # 海报帧
64
+ curl -s -o $M/tile-<key>.mp4 https://file.cdn.minimax.io/public/<card>-bg.mp4
65
+ ffmpeg -v error -y -i $M/tile-<key>.mp4 -frames:v 1 -q:v 4 $M/tile-<key>.jpg
66
+ # 官网只有大视频、没有卡片视频时,从大视频裁主体(坐标按主体位置调):
67
+ ffmpeg -v error -y -i $M/hero-<key>.mp4 -t 6.5 -vf "crop=760:724:580:0,scale=320:-2,fps=24" -an \
68
+ -c:v libx264 -crf 30 -preset slow -pix_fmt yuv420p -movflags +faststart $M/tile-<key>.mp4
69
+ ```
70
+
71
+ 3. **官网没有这个模态的大视频时**,用它的卡片小视频合成一段同样��图的:
72
+ - 纯色渐变底,颜色取小视频的底色;
73
+ - 主体放大到约 660 px,放在顶部居中,边缘羽化;
74
+ - 底部渐隐成白色。
75
+
76
+ Music 的背景就是这样用 Speech 的蝠鲼合成的,命令见下。合成的素材要告诉用户,问有没有正式素材。
77
+
78
+ ```bash
79
+ ffmpeg -v error -y -stream_loop 1 -i tile.mp4 -f lavfi -i "color=black:s=1920x1080:r=30,format=rgb24,geq=r='clip(R0+(255-R0)*clip((Y-H*0.4)/(H*0.57)\,0\,1)\,0\,255)':g='…':b='…'" \
80
+ -filter_complex "[0:v]scale=660:-2:flags=lanczos,gblur=sigma=1.2,format=rgba,geq=r='r(X\,Y)':g='g(X\,Y)':b='b(X\,Y)':a='255*clip((1-hypot(X-W/2\,Y-H/2)/(W*0.5))*2.4\,0\,1)'[fg];[1:v][fg]overlay=x=630:y=-30:shortest=1,format=yuv420p" \
81
+ -t 10.3 -an -c:v libx264 -crf 28 -preset slow -movflags +faststart hero-<key>.mp4
82
+ ```
83
+
84
+ R0/G0/B0 是小视频的底色,用 PIL 取角上的像素。
85
+
86
+ 4. **大小**:每个模态的大视频控制在约 1.5 MB 以内,卡片视频在约 150 KB 以内。
87
+
88
+ ### 某个发布想用自己的素材(可选)
89
+
90
+ 现在素材只按模态取。某次大发布要用官网给它做的专属视频,就在 `media.tsx` 加一张 `{发布 key: 文件名}` 表,`HeroVideo` 和 `Tile` 先查这张表。分类页的 `HeroVideo` 要把发布 key 传进去。这是代码改动,按页面改动走部署流程。
91
+
92
+ ## 3. 首页标题的口径
93
+
94
+ 首页大字是**总下载量**:全部官方模型加全部社区模型的累计下载,等于 `site.releases` 的 `dlall` 加 `official.dlall` 之和,也就是 Downloads 曲线的终点。图表默认打开 Downloads 视图。新发布会自动计入,不用改。
95
+
96
+ ## 4. 模型标记(lockup.tsx)
97
+
98
+ 名字按 `^MiniMax-(.+?)(?:-([A-Za-z]{3,}))?$` 拆。
99
+
100
+ | 名字 | 卡片(MarkLockup) | 顶部标题(TitleLockup) |
101
+ |---|---|---|
102
+ | MiniMax-M3.1-Flash | MiniMax / **M3.1** / *flash* | MiniMax M3.1 *flash* |
103
+ | MiniMax-H3-Image | MiniMax / **H3** / *image* | MiniMax H3 *image* |
104
+ | MiniMax-Music3 | MiniMax / Music / **3** | MiniMax Music3 |
105
+ | MiniMax-M3-Pro(新) | MiniMax / **M3** / *pro* | MiniMax M3 *pro* |
106
+ | SynLogic、VTP | 名字本身(Abhaya) | 名字本身 |
107
+
108
+ - 新名字一定要在预览里看一眼卡片和标题。
109
+ - 名字很长时(如 `M3.1-Flash-Lite`),字号可能把 240 px 宽的卡片撑破。`MarkLockup` 现在的规则是标记超过 4 个字符就从 80 px 降到 62 px,不够就再加一档。
110
+ - 标题在 360 px 宽的手机上不能横向溢出,`shots.mjs` 会报告。
111
+
112
+ ## 5. 预览和截图
113
+
114
+ ```bash
115
+ python3 scripts/daily.py --skip-snapshot # 不加 --push;全部家族一起跑,生成 data/dashboard/site.json 和各模态页
116
+ bash .claude/skills/eco-release/scripts/preview.sh # 用本地数据构建,在 Mac 上开 18767 端口
117
+ ssh parsar-mac 'cd ~/mm-shots && /opt/homebrew/bin/node shots.mjs new "home:/,rel:/<模态>/<发布key>"'
118
+ scp 'parsar-mac:mm-shots/out/new_*' /tmp/shots/ # 拉回来看
119
+ ```
120
+
121
+ - 只改了页面、不需要新数据时,用 `preview.sh --live-data`,直接拿线上的数据。
122
+ - Mac(`ssh parsar-mac`)连不上时,`preview.sh` 会在本机用 `vite preview` 起 18767 端口,让用户自己在浏览器里打开。
123
+ - Mac 第一次使用前装一次:`ssh parsar-mac 'mkdir -p ~/mm-shots && cd ~/mm-shots && npm init -y && npm i playwright-core@1'`。macOS 会清理 /tmp,所以不要放在 /tmp。
124
+
125
+ 截图要看:
126
+ - 新发布卡片的标记;
127
+ - 首页曲线上的发布钉和名字;
128
+ - 模态 chip;
129
+ - 分类页顶部(标题、视频、tab);
130
+ - 手机宽度;
131
+ - `problems: none`(没有报错、没有 404、没有溢出,顶部视频在播放)。
code/.claude/skills/eco-release/reference/rules.md ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 收集规则(分类器)参考
2
+
3
+ 新官方模型要被正确统计,靠的是 `hfeco/families/<key>.py` 里的规则。引擎在 `hfeco/classify.py`,所有家族共用,**一般不改引擎,只改家族文件**。
4
+
5
+ ## 1. 一个仓库是怎么被判定的
6
+
7
+ 每天每个家族:
8
+
9
+ 1. `discover.discover(fam)`:故意放宽去找候选,宁多勿漏(漏掉的那天的下载快照补不回来)。
10
+ - 官方仓库的 Model tree 逐层往下
11
+ - `name_queries`:仓库名子串搜索。"h3" 也会命中 MiniLM-H384,后面会过滤
12
+ - `tag_filters`:Hub 按 config 的 `model_type` 给仓库打的标签,名字里没有 MiniMax 也能找到
13
+ - `fulltext_queries`:README 全文搜索
14
+ - 加载了官方模型的 Space
15
+ - 名字像本家族的候选的子仓库
16
+ 2. `pipeline.worth_probing`:名字里只是碰巧含关键词的仓库不探测。
17
+ 3. `enrich.enrich_model`:只读文件头和少量字节,不下载权重。
18
+ - 总是读:文件列表和 sha256、README(前 12 KB)、config.json(主权重所在文件夹的优先),以及 hidden_size、vocab_size、model_type、architectures。
19
+ - GGUF 文件头:家族有 `archs` 且没有 `marker_rules` 时只读 512 KB,只拿元数据;否则读 8 MB,连张量形状一起拿。
20
+ - safetensors:读文件头,得到张量名、形状、`__metadata__`。
21
+ - 只有家族有 `marker_rules` 才去读分片的 index。
22
+ - 只有有 `meta_rules` 才去读兄弟文件的元数据。
23
+ - 有 `probe_names` 时,再抽查一个张量的几百个数值。
24
+ - 结果按仓库 sha 缓存在 `cache/<key>/enrich.jsonl`,仓库没变就不重读。
25
+ 4. `classify.classify_model`:三档证据。
26
+ - **第 1 档(结构)**:
27
+ - 文件 sha256 与官方逐字节相同;
28
+ - `marker_rules` 独有张量名;
29
+ - `extra_structural`;
30
+ - 抽查数值与官方相同或接近;
31
+ - `index_rules`(model_index.json);
32
+ - `archs`:config 或 GGUF 的架构名和尺寸。只属于一个成员的 Arch 算第 1 档命中;多成员共用的 Arch 只排除其他成员(每个减 20 分);
33
+ - `meta_rules`:训练元数据。
34
+ - **第 2 档(声明)**:声明的 base_model +5;`header_rules`(GGUF 头写的来源)+3;`card_rules` 按权重加分;视频样例;pipeline tag;创建日期早于某成员发布的,该成员 −20。
35
+ - **第 3 档(名字)**:`Member.text_hint` 命中仓库名 +1.5;家族词 +1。
36
+ - **门槛**:没有声明、没有结构证据、名字和卡片也不提家族的,判 unrelated。结构是别的模型的(`other_dit` / `other_arch`)、名字又不提家族的,也判 unrelated。
37
+ - **定成员**:
38
+ - 第 1 档只命中一个成员时,置信度 high;
39
+ - 共用架构下发布日期只允许一个成员时,medium;
40
+ - 其余按分数:领先 3 分以上且自身 ≥ 4 分为 medium,领先 ≥ 1 分为 low,否则 unknown。
41
+ - **关系** `relation()`:adapter / finetune / quantized / repackage / merge / mirror / component,或 tool / no-weights / other。看板只算 `metrics.REL_ORDER` 里的七种。
42
+ 5. `classify.resolve_overlaps`:同一个仓库被几个家族同时认领时,只算在一个家族里:先比置信度,再按 `families.FAMILIES` 的注册顺序(现在是 h3、m、music)。
43
+
44
+ **发布日期的排除(cutoff)**:`classify_all` 用当天快照里官方仓库的 `created_at` 算每个成员的发布日(默认成员除外)。创建得比它早的仓库不可能基于它。所以官方仓库必须出现在候选里:用 `name_queries` 或 `tag_filters` 能搜到它。
45
+
46
+ ## 2. 字段速查(`hfeco/family.py`)
47
+
48
+ ### Member
49
+
50
+ | 字段 | 作用 | 什么时候要写 |
51
+ |---|---|---|
52
+ | `lineage` | 短名,到处用("M3.1-Flash") | 必填,同一家族内唯一 |
53
+ | `base` | 官方主仓库 | 必填 |
54
+ | `modality` | video / image / text / audio | 必填。会影响打分:video、audio 对 pipeline tag 加分;非 text 的成员对 DiT 形状加分 |
55
+ | `text_hint` | 名字和卡片里怎么指这个成员 | 有兄弟成员时必写,要把兄弟排除掉 |
56
+ | `tracked=False` | 照常分类,但不上看板、不进 PR 候选 | 只用来把它的衍生品从别的成员里分出去(H3-Image-PE) |
57
+ | `also` | 同一次发布的其他官方仓库(-hf、官方量化、40k/80k) | 官方一次发多个仓库时 |
58
+
59
+ ### Arch(结构指纹,第 1 档里最常用的)
60
+
61
+ | 字段 | 作用 |
62
+ |---|---|
63
+ | `members` | 用这套结构的成员。只有一个时算第 1 档命中,多个时只排除其他成员 |
64
+ | `names` | 正则,同时匹配 config 的 `model_type`、`architectures` 和 GGUF 的 `general.architecture` |
65
+ | `hidden` | hidden_size 或 GGUF 的 `<arch>.embedding_length`。尺寸对不上的玩具测试模型会被排除;剪专家(REAP)不改 hidden,照样算 |
66
+ | `vocab` | 词表大小。适合"别人的结构 + 自己的词表"(Music3 的 LM 是 Qwen3 结构、20 万词表) |
67
+ | `strict=True` | 尺寸必须写明才算,不能只是"不矛盾"。名字和别家共用时必须开(`qwen3`) |
68
+
69
+ ### Family
70
+
71
+ | 字段 | 作用 | 备注 |
72
+ |---|---|---|
73
+ | `key` | 存储和 URL 的键(raw/<key>/、labels/<key>/) | 一旦上线不要改 |
74
+ | `title` | 日志里的名字 | |
75
+ | `default_member` | 只说"家族名"时指哪个成员;`None` 表示没有这种成员 | 语言系列是 None(只写"MiniMax"说明不了是哪个版本) |
76
+ | `name_queries` | 仓库名子串搜索 | 短词误伤多,靠后面的门槛过滤;太宽会让候选暴涨,探测变慢 |
77
+ | `fulltext_queries` | README 全文搜索 | 评测表格里到处出现的名字(M2、M3)别加,噪声太大 |
78
+ | `tag_filters` | Hub 标签(`model_type`),最可靠的发现渠道 | 新架构一定要加它的 model_type |
79
+ | `family_text` | 名字或卡片提到这个家族 | 门槛用它判断"是否提到家族" |
80
+ | `name_hint` | 值得探测的名字 | `worth_probing` 用 |
81
+ | `archs` | 见上 | 带 config 的 LLM 和管线首选 |
82
+ | `own_llm` | 家族自己发语言模型 | M 系列、Music3 为 True;否则 LLM 形状的权重会被当成"别家模型做的工具" |
83
+ | `sig_dims` + `sig_names` | DiT 指纹:块张量名加独有的宽度 | 适合没有 config 的 ComfyUI / safetensors 权重 |
84
+ | `marker_rules` | (张量名正则, 成员, 理由, 只认完整权重) | 成员间独有的层(H3 的音频分支、H3-Image 的 PDD 头)。**加了它 enrich 会多读 index** |
85
+ | `meta_rules` | (safetensors `__metadata__` 正则, 成员, 理由) | LoRA 训练信息(ss_base_model 之类)。**加了它 enrich 会多读兄弟文件** |
86
+ | `index_rules` | (model_index.json 子串, 成员) | diffusers 管线类名 |
87
+ | `extra_structural` | fn(ev, ctx) -> [(成员, 理由)] | 规则表达不了的结构判断 |
88
+ | `probe_names` / `probe_sources` | 抽查张量名 / 官方取参考值的位置 | 同形状的成员之间区分"原样搬运"和"改过"(H3 和 H3-Image) |
89
+ | `card_rules` | (README 正则, 成员, 分值, 理由, 遇到文本 LLM 时跳过) | 分值 1–5;成员特有的说法给高分 |
90
+ | `header_rules` | (GGUF 头 general.name、basename、base_model、source 的正则, 成员, 理由) | 量化版常写明"转自 X",+3 |
91
+ | `text_member` / `text_member_hint` / `text_member_name` | 家族里官方的文本成员(PE) | 只按权重、声明或名字认,"能扩写提示词"不算 |
92
+ | `text_component` / `text_component_why` | 家族自带或配套的文本部件(文本编码器、草稿模型) | 算 component |
93
+ | `component_names` | 部件名(vae、vocoder、mmproj…) | 算 component |
94
+ | `native_quant` | 成员官方自带的量化格式 | 别把官方格式当成社区量化 |
95
+ | `nsfw_author_exempt` | 大发布者的个别成人仓库逐个隐藏 | |
96
+
97
+ ## 3. 写正则的约定
98
+
99
+ - **名字里的版本号**用 `m.py` 的 `in_name(tok)`:前面必须是非字母数字或紧跟 "minimax",后面不能接数字或小数(`END`)。这样 "M2" 不会匹配 "M2.5" 和 "M25"。
100
+ - **正文和 GGUF 头里**用 `in_text(tok)`:前面必须有 "MiniMax",否则 "runs on an M3 Max" 也会命中。
101
+ - **加兄弟版本时,回头改旧版本的 token**。例如加 M3-Pro:
102
+ - `M3` 的 token 要从 `m3(?![-_ ]?flash|-1(?!\d))` 改成 `m3(?![-_ ]?(?:flash|pro)|-1(?!\d))`,否则 "MiniMax-M3-Pro-GGUF" 也会给 M3 加分;
103
+ - `org.RELEASES` 里 `MiniMax-M3(-.+)?` 会吃掉 "MiniMax-M3-Pro",新行必须放在它前面(先匹配先赢)。
104
+ - 分隔符写全:`[-_. ]?`。社区常写 `M3_Pro`、`m3pro`、`M3 Pro`、`m3-pro`。
105
+ - 大小写一律 `re.I`。
106
+ - 写完用真实仓库名当场测。2026-11-23 用现有规则跑,这三个名字**都**命中 M3,这正是要修的情况:
107
+
108
+ ```bash
109
+ python3 -c "import sys; sys.path.insert(0,'.'); from hfeco.families import m; [print(n, [x.lineage for x in m.FAMILY.members if x.text_hint.search(n)]) for n in ['unsloth/MiniMax-M3-Pro-GGUF','x/MiniMax-M3-GGUF','x/m3pro-awq']]"
110
+ ```
111
+
112
+ 按上面的写法改完以后,应该是:
113
+ - `MiniMax-M3-Pro-GGUF`、`m3pro-awq`、`MiniMax_M3_Pro-MLX-4bit` 只命中 M3-Pro;
114
+ - `MiniMax-M3-GGUF` 只命中 M3;
115
+ - `MiniMax-M3.1-Flash-GGUF` 两个都不命中。
116
+
117
+ 名字只是第 3 档证据,分量最轻;但仓库没有别的证据时,就靠它定成员。
118
+
119
+ ## 4. 各类新发布的配方
120
+
121
+ 先跑 `scripts/inspect_official.py <官方仓库>`,拿到 model_type、尺寸、张量名、Hub 标签数和卡片写法,再对号入座。
122
+
123
+ ### A. 现有语言系列的新版本,沿用已有架构(M3-Pro、M3.5、M2.8)
124
+
125
+ `hfeco/families/m.py`:
126
+
127
+ 1. `RELEASES` 加一行 `("M3-Pro", ["MiniMax-M3-Pro", <同批的其他官方仓库>], r"m3[-_. ]?pro")`。成员、`card_rules`、`header_rules` 会自动从这张表生成。
128
+ 2. 对应的 `Arch(...)` 的 `members` 加上 "M3-Pro"。如果 hidden 不同,单独写一个 Arch,hidden 写它自己的。
129
+ 3. 按第 3 节改兄弟版本的 token 和 `FAMILY_TEXT`(`m[123]` 这类字符集要覆盖新版本号)。
130
+ 4. 文件顶���的 "Facts these rules rely on" 加一条,写明核对日期。
131
+
132
+ 然后在 `hfeco/org.py` 的 `RELEASES` 合适位置(比它宽的模式之前)加:
133
+
134
+ ```python
135
+ ("m3-pro", "MiniMax-M3-Pro", "language", r"MiniMax-M3-Pro(-.+)?", ("m", "M3-Pro")),
136
+ ```
137
+
138
+ ### B. 现有系列换了新架构(M4:`minimax_m4`)
139
+
140
+ 在 A 的基础上再做三件事:
141
+
142
+ 1. 新增 `Arch(("M4",), re.compile(r"minimax[-_]?m4", re.I), <hidden>)`。
143
+ 2. `tag_filters` 加上它的 model_type。注意 model_type 是 config 里的原样,例如 `minimax_m4`。
144
+ 3. `FAMILY_TEXT` 和 `ADD_ON` 看要不要扩展:新发布有没有自己的草稿模型或视觉塔叫法。
145
+
146
+ ### C. 视频或图像 DiT 家族的新成员(H3 家族里再加一个)
147
+
148
+ 先比较新成员和已有成员的张量形状(inspect 打印的 index 模式):
149
+
150
+ - **形状相同**(像 H3 和 H3-Image):
151
+ - 在 `h3.py` 加 Member,写好 `text_hint`;
152
+ - 找出独有的层写 `marker_rules`;
153
+ - `probe_sources` 加上它的 transformer 文件夹,用抽查数值区分;
154
+ - LoRA 的训练元数据写进 `meta_rules`;
155
+ - diffusers 管线类名写进 `index_rules`;
156
+ - `card_rules` 给它的特有说法较高分值。
157
+ - **形状不同**(H4 换了宽度):建一个新家族 `h4.py` 更干净,`sig_dims` 写它的宽度。不要和 H3 混在一个家族里。
158
+
159
+ ### D. 全新家族或新模态(Speech、Embedding、3D、Agent 专用模型……)
160
+
161
+ 1. 复制最接近的家族文件改:
162
+ - 带 config 的 LLM 类:抄 `m.py`;
163
+ - 一个成员的管线:抄 `music.py`;
164
+ - DiT:抄 `h3.py`。
165
+ 2. 在 `hfeco/families/__init__.py` 注册,并更新文件头的列表。注册顺序就是 `resolve_overlaps` 的优先级,新家族放最后,除非有理由。
166
+ 3. `org.py`:
167
+ - `RELEASES` 加一行,category 用新模态的 key;
168
+ - `CATEGORY_NAME` 加显示名(英文,例如 "Speech & Audio");
169
+ - 如果官方仓库的 pipeline tag 不在 `PIPELINE_CATEGORY` 里,也补上。
170
+ 4. 页面要配颜色、顺序和素材,见 `page.md`。
171
+ 5. 检查引擎里两张写死的表,非生成式模型尤其要看:
172
+ - `hfeco/pipeline.py` 的 `NLP_TAGS`:只靠名字搜到、pipeline tag 在这张表里的候选**不会被探测**,直接判 unrelated。表里有 automatic-speech-recognition、feature-extraction、sentence-similarity、robotics、text-classification 等。新家族是语音识别、Embedding、Reranker 或机器人模型时,把相应的 tag 移出这张表。也可以给 `worth_probing` 加个家族级的例外,影响面更小。
173
+ - `hfeco/classify.py` 的 `TEXT_LLM_TYPES`:认定"这是一个文本大模型"的 model_type 前缀(qwen、llama、mistral、gemma、phi、glm、deepseek、minimax_m)。新的 MiniMax 语言架构不以 `minimax_m` 开头时(比如 `minimax_agent`),要加进去,否则 LLM 形状的判断和 `own_llm` 的逻辑会失灵。
174
+ - 改这两处属于引擎改动,改完对**所有家族**跑一遍 `label_diff.py`,确认没有连带变化。
175
+ 6. 家族 key 和模态 key 可以同名(music 两者都是)。家族看板写在 `dashboard/family/` 下,页面数据写在 `dashboard/` 下,不会冲突。
176
+
177
+ ### E. 只认声明的发布(数据集式、研究小模型、工具;SynLogic、VTP 那种)
178
+
179
+ 不写家族文件。只在 `org.RELEASES` 加一行,最后一项写 `None`。它的社区只沿 HF 的 base_model 标签逐层往下找,和 Model tree 一样。什么都不加的话,`org.group` 会把匹配不上的公开仓库自成一个发布,并在日志打印 `matches no release rule`;它的模态按 pipeline tag 猜,猜不到就算 language。
180
+
181
+ ### F. 公开但不该展示的官方仓库
182
+
183
+ - 加进 `org.HIDDEN`:页面和统计都不出现。
184
+ - 或者 `Member(tracked=False)`:照常分类,好把它的衍生品从兄弟成员里分出去,但不展示。
185
+
186
+ ### G. 官方一次发多个仓库(-hf、官方 MXFP8 / GGUF、多个上下文长度)
187
+
188
+ - 家族里写进 `Member.also`;
189
+ - `org.RELEASES` 的模式用 `(-.+)?` 收进同一个发布;
190
+ - 页面上的发布中心是和发布同名的那个仓库(`org.group` 选 `base`)。
191
+
192
+ ## 5. 规则改完必须做的事
193
+
194
+ - **改版本号**:`hfeco/classify.py` 的 `VERSION = "YYYY-MM-DD.n"`。标签带版本号,日后才能分清是哪套规则的结果。
195
+ - **重建参考数据**:`python scripts/build_reference.py --family <key>`。这一步记下所有官方 LFS 文件(> 1 MB)的 sha256 和抽查数值。不做的话,新成员的整仓搬运认不出来。生成的 `<key>_reference.json` 要提交进 git。
196
+ - **缓存里缺证据时重探**:给家族新增了 `marker_rules`、`meta_rules`,或者 GGUF 要从 512 KB 改读 8 MB,旧缓存里就没有这些证据,要重探:
197
+
198
+ ```python
199
+ from hfeco import families, pipeline, store
200
+ fam = families.get("<key>"); raw = store.read_raw(fam.key); today = raw[raw.day == raw.day.max()]
201
+ cache = pipeline.load_cache(fam)
202
+ pipeline.reprobe(today, fam, cache, lambda ev: bool(ev.get("main_weight"))) # 按需收窄条件
203
+ ```
204
+
205
+ 本机到 HF 只有约 100 KB/s,重探几百个仓库很慢。大批量的放到 HF Job 里跑:推代码后用 `run_job.py`。
code/.claude/skills/eco-release/scripts/_root.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ """Puts the repository root on sys.path so the skill's scripts can import hfeco."""
2
+ import sys
3
+ from pathlib import Path
4
+
5
+ ROOT = Path(__file__).resolve().parents[4]
6
+ sys.path.insert(0, str(ROOT))
code/.claude/skills/eco-release/scripts/check_live.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """What the public page serves right now: every release with its category, community size,
2
+ whether it has its own page, and the totals the headline shows.
3
+
4
+ python .claude/skills/eco-release/scripts/check_live.py [release-key ...]
5
+
6
+ With release keys, exits non-zero unless each is present (and says whether it has a page).
7
+ """
8
+ import json
9
+ import sys
10
+ import urllib.request
11
+
12
+ URL = "https://minimaxai-ecosystem.static.hf.space/data/site.json"
13
+ site = json.load(urllib.request.urlopen(f"{URL}?t={__import__('time').time():.0f}", timeout=60))
14
+ print(f"data as of {site['today']}; builders {site['builders']}")
15
+ comm = sum(r["dlall"] for r in site["releases"])
16
+ off = sum(r["official"].get("dlall") or 0 for r in site["releases"])
17
+ print(f"headline downloads {comm + off:,} (community {comm:,} + official {off:,}); "
18
+ f"community models {sum(r['n'] for r in site['releases']):,}")
19
+ for c in site["categories"]:
20
+ print(f"\n{c['name']} ({c['key']})")
21
+ for k in c["releases"]:
22
+ r = next(x for x in site["releases"] if x["key"] == k)
23
+ print(f" {r['key']:14s} {r['name']:22s} {r['date']} community {r['n']:5d} page={r['page']} "
24
+ f"repos={len(r['models'])}")
25
+ missing = [k for k in sys.argv[1:] if k not in {r["key"] for r in site["releases"]}]
26
+ if missing:
27
+ sys.exit(f"\nnot on the live page: {missing}")
code/.claude/skills/eco-release/scripts/inspect_official.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """What a classifier needs to know about a new official release, read from the Hub without
2
+ downloading weights.
3
+
4
+ python .claude/skills/eco-release/scripts/inspect_official.py MiniMaxAI/MiniMax-M3-Pro [more repos]
5
+
6
+ Prints, per repo: dates, pipeline tag, Hub tags; the layout its config.json names (model_type,
7
+ architectures, hidden / vocab size, layers, experts, nested text/vision configs); the weight
8
+ files (formats, folders, total size); tensor-name patterns from every safetensors index (digits
9
+ folded to N), so names only this model has stand out; the GGUF architecture if it ships GGUFs;
10
+ how many Hub repos already carry its model_type tag; and the lines of its card that name it.
11
+ """
12
+ import json
13
+ import re
14
+ from collections import Counter
15
+
16
+ import _root # noqa: F401
17
+ from hfeco import enrich
18
+ from hfeco.hub import api, retry
19
+
20
+
21
+ def cfg_summary(c, depth=0):
22
+ keys = ["model_type", "architectures", "hidden_size", "vocab_size", "num_hidden_layers", "num_layers",
23
+ "n_routed_experts", "num_local_experts", "num_experts", "intermediate_size", "d_model",
24
+ "num_attention_heads", "torch_dtype", "_class_name", "_diffusers_version"]
25
+ out = {k: c[k] for k in keys if k in c}
26
+ for sub in ("text_config", "vision_config", "audio_config", "llm_config", "transformer"):
27
+ if isinstance(c.get(sub), dict) and depth < 1:
28
+ out[sub] = cfg_summary(c[sub], depth + 1)
29
+ return out
30
+
31
+
32
+ def fold(name):
33
+ return re.sub(r"\.\d+\.", ".N.", re.sub(r"\.\d+$", ".N", name))
34
+
35
+
36
+ def inspect(repo):
37
+ i = retry(api.model_info, repo, files_metadata=True)
38
+ print(f"\n==== {repo}")
39
+ print(f"created {str(i.created_at)[:10]} private={i.private} gated={i.gated} pipeline={i.pipeline_tag} "
40
+ f"library={i.library_name}")
41
+ print("tags:", ", ".join(t for t in (i.tags or []) if not t.startswith(("region:", "license:", "arxiv:"))))
42
+ files = [(s.rfilename, s.size or 0) for s in i.siblings or []]
43
+ names = [f for f, _ in files]
44
+ w = [(f, s) for f, s in files if enrich.is_weight(f.lower())]
45
+ fmt = Counter(re.sub(r"^.*?\.(safetensors|gguf|bin|pt|pth|ckpt|onnx|npz|sft)(\.part\d+of\d+)?$", r"\1", f.lower())
46
+ for f, _ in w)
47
+ folders = Counter(f.rsplit("/", 1)[0] if "/" in f else "." for f, _ in w)
48
+ print(f"weights: {len(w)} files, {sum(s for _, s in w) / 1e9:.1f} GB, formats {dict(fmt)}, folders {dict(folders)}")
49
+
50
+ noise = re.compile(r"(tokenizer|processor|preprocessor|generation|scheduler)_config\.json$|pdd_config")
51
+ cfgs = sorted((n for n in names if n.endswith("config.json") and n.count("/") <= 2 and not noise.search(n)),
52
+ key=lambda n: (n.count("/"), n))
53
+ for cfg in cfgs[:10]:
54
+ try:
55
+ c = json.loads(enrich._range(repo, cfg, 0, 400_000))
56
+ print(f"{cfg}: {json.dumps(cfg_summary(c), ensure_ascii=False)}")
57
+ except Exception as e:
58
+ print(f"{cfg}: unreadable ({e})")
59
+
60
+ idx = [n for n in names if n.endswith(".safetensors.index.json")]
61
+ for n in idx[:4]:
62
+ try:
63
+ wm = json.loads(enrich._range(repo, n, 0, 30_000_000))["weight_map"]
64
+ pats = Counter(fold(k) for k in wm)
65
+ print(f"{n}: {len(wm)} tensors, {len(pats)} patterns")
66
+ for p, k in sorted(pats.items())[:80]:
67
+ print(f" {k:5d} {p}")
68
+ except Exception as e:
69
+ print(f"{n}: unreadable ({e})")
70
+ if not idx:
71
+ st = [f for f, _ in sorted(w, key=lambda x: -x[1]) if f.endswith(".safetensors")][:1]
72
+ for f in st:
73
+ n_h, h = enrich.st_header(repo, f)
74
+ pats = Counter(fold(k) for k in h if k != "__metadata__")
75
+ print(f"{f} (header): {len(h)} entries; metadata keys {list((h.get('__metadata__') or {}))[:12]}")
76
+ for p, k in sorted(pats.items())[:80]:
77
+ print(f" {k:5d} {p}")
78
+ gg = [f for f, _ in w if ".gguf" in f.lower()]
79
+ if gg:
80
+ g = enrich.gguf_header(repo, sorted(gg)[0], limit=512_000)
81
+ kv = (g or {}).get("kv", {})
82
+ print("gguf:", {k: v for k, v in kv.items() if k.startswith("general.") or k.endswith((".embedding_length", ".block_count"))})
83
+
84
+ mt = (i.config or {}).get("model_type")
85
+ if mt:
86
+ n = len(retry(lambda: list(api.list_models(filter=mt, limit=2000))))
87
+ print(f"Hub repos tagged {mt!r}: {n}{'+' if n >= 2000 else ''}")
88
+ if "README.md" in names:
89
+ card = enrich._range(repo, "README.md", 0, 40_000).decode("utf-8", "replace")
90
+ hits = [ln.strip() for ln in card.splitlines() if re.search(r"minimax", ln, re.I) and len(ln.strip()) < 220
91
+ and not re.search(r"<a |<img|badge|https?://", ln)]
92
+ print("card lines naming it:")
93
+ for ln in hits[:15]:
94
+ print(" ", ln)
95
+
96
+
97
+ if __name__ == "__main__":
98
+ import sys
99
+ for r in sys.argv[1:]:
100
+ inspect(r)
code/.claude/skills/eco-release/scripts/label_diff.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """What a rule change did to a family's labels: counts per release before and after, and every
2
+ repo that changed release, type or in/out of the count.
3
+
4
+ cp data/labels/m/latest.parquet /tmp/m_before.parquet # before changing the rules
5
+ python scripts/daily.py --family m --skip-snapshot --skip-org # re-label (cache reused)
6
+ python .claude/skills/eco-release/scripts/label_diff.py m /tmp/m_before.parquet [--all]
7
+
8
+ Counted = a model repo with family=True and a relation the dashboard shows. Without --all the
9
+ list of changed repos stops at 80 lines.
10
+ """
11
+ import json
12
+ import sys
13
+
14
+ import pandas as pd
15
+
16
+ import _root # noqa: F401
17
+ from hfeco import metrics, store
18
+
19
+ key, before = sys.argv[1], sys.argv[2]
20
+ show_all = "--all" in sys.argv
21
+ new = pd.read_parquet(store.LOCAL / "labels" / key / "latest.parquet")
22
+ old = pd.read_parquet(before)
23
+
24
+
25
+ def counted(df):
26
+ df = df[df.kind == "model"].copy()
27
+ df["counted"] = df.family.astype(bool) & df.relation.isin(metrics.REL_ORDER)
28
+ return df.set_index("repo_id")
29
+
30
+
31
+ a, b = counted(old), counted(new)
32
+ print(f"classifier version {old.classifier_version.iloc[0]} -> {new.classifier_version.iloc[0]}")
33
+ ca = a[a.counted].groupby("lineage").size()
34
+ cb = b[b.counted].groupby("lineage").size()
35
+ t = pd.DataFrame({"before": ca, "after": cb}).fillna(0).astype(int)
36
+ t["change"] = t.after - t.before
37
+ print(t.to_string())
38
+ print(f"total counted: {int(ca.sum())} -> {int(cb.sum())}")
39
+
40
+ ids = sorted(set(a.index) | set(b.index))
41
+ rows = []
42
+ for rid in ids:
43
+ x = a.loc[rid] if rid in a.index else None
44
+ y = b.loc[rid] if rid in b.index else None
45
+ sx = (x.lineage, x.relation, bool(x.counted)) if x is not None else (None, None, False)
46
+ sy = (y.lineage, y.relation, bool(y.counted)) if y is not None else (None, None, False)
47
+ if sx != sy and (sx[2] or sy[2]):
48
+ ev = json.loads(y.evidence) if y is not None and isinstance(y.evidence, str) else []
49
+ rows.append((rid, sx, sy, ev[:3]))
50
+ print(f"\n{len(rows)} counted repos changed (release, type, counted):")
51
+ for rid, sx, sy, ev in rows if show_all else rows[:80]:
52
+ tag = "ADDED " if not sx[2] else "DROPPED" if not sy[2] else "MOVED "
53
+ print(f" {tag} {rid:60s} {sx[0]}/{sx[1]} -> {sy[0]}/{sy[1]} {' | '.join(ev)}")
code/.claude/skills/eco-release/scripts/preview.sh ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Build the page with local data and serve it for a look before deploying.
3
+ #
4
+ # bash .claude/skills/eco-release/scripts/preview.sh [--live-data]
5
+ #
6
+ # Data: data/dashboard/site.json and one file per category, from a full local daily.py run,
7
+ # or with --live-data the files the public Space serves now. They go to web/public/data/
8
+ # (git-ignored, never deployed: deploy_space.py skips data/).
9
+ # Serving: on the Mac (ssh parsar-mac, port 18767) when reachable, where shots.mjs can take
10
+ # screenshots with Chrome; otherwise locally with vite preview on port 18767.
11
+ set -euo pipefail
12
+ ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)"
13
+ HERE="$(cd "$(dirname "$0")" && pwd)"
14
+ cd "$ROOT/web"
15
+ mkdir -p public/data
16
+ if [[ "${1:-}" == "--live-data" ]]; then
17
+ for f in site video language image music audio; do
18
+ env -u ALL_PROXY -u all_proxy curl -sf "https://minimaxai-ecosystem.static.hf.space/data/$f.json" -o "public/data/$f.json" \
19
+ || rm -f "public/data/$f.json"
20
+ done
21
+ else
22
+ # site.json and the category pages it lists (family dashboards live in dashboard/family/)
23
+ D="$ROOT/data/dashboard"
24
+ rm -f public/data/*.json
25
+ cp "$D/site.json" public/data/
26
+ for c in $(python3 -c "import json,sys; print(' '.join(c['key'] for c in json.load(open(sys.argv[1]))['categories']))" "$D/site.json"); do
27
+ [[ -f "$D/$c.json" ]] && cp "$D/$c.json" public/data/
28
+ done
29
+ fi
30
+ env -u ALL_PROXY -u all_proxy npm run build >/dev/null 2>&1 || { env -u ALL_PROXY -u all_proxy npm run build 2>&1 | tail -20; exit 1; }
31
+ if ssh -o ConnectTimeout=5 parsar-mac true 2>/dev/null; then
32
+ # ~/mm-shots holds playwright-core (macOS purges /tmp): set up once with
33
+ # ssh parsar-mac 'mkdir -p ~/mm-shots && cd ~/mm-shots && npm init -y && npm i playwright-core@1'
34
+ ssh parsar-mac 'rm -rf /tmp/mmlanding; mkdir -p /tmp/mmlanding ~/mm-shots'
35
+ scp -q -r dist/* parsar-mac:/tmp/mmlanding/
36
+ scp -q "$HERE/shots.mjs" parsar-mac:mm-shots/shots.mjs
37
+ ssh parsar-mac 'cd /tmp/mmlanding; lsof -ti tcp:18767 | xargs kill 2>/dev/null; (nohup python3 -m http.server 18767 >/tmp/mmlanding.log 2>&1 &); sleep 1'
38
+ echo "served on the Mac: http://localhost:18767/index.html"
39
+ echo "screenshots: ssh parsar-mac 'cd ~/mm-shots && /opt/homebrew/bin/node shots.mjs <tag> \"home:/,new:/<cat>/<release>\"' (images land in ~/mm-shots/out/)"
40
+ else
41
+ echo "Mac not reachable; serving here: http://localhost:18767/index.html (Ctrl-C to stop)"
42
+ env -u ALL_PROXY -u all_proxy npx vite preview --port 18767 --strictPort
43
+ fi
code/.claude/skills/eco-release/scripts/run_job.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Run the daily job once now, exactly as scheduled (same image, command, hardware, timeout),
2
+ so the live page picks up a code change today instead of at 00:30 UTC tomorrow.
3
+
4
+ python .claude/skills/eco-release/scripts/run_job.py [--wait]
5
+
6
+ Push the code first (scripts/push_code.py): the job runs whatever is in the dataset's code/.
7
+ The run gets this machine's HF token as its HF_TOKEN secret, as the scheduled job does (the
8
+ user agreed to saladday1's token for this job); ask before using a different account's token.
9
+ With --wait it polls until the run ends and prints the tail of its log.
10
+ """
11
+ import sys
12
+ import time
13
+
14
+ import _root # noqa: F401
15
+ from huggingface_hub import get_token
16
+ from hfeco.hub import api
17
+
18
+ NS, SCHEDULED = "MiniMaxAI", "6afda8a6545f95df1c063466"
19
+
20
+ spec = api.inspect_scheduled_job(scheduled_job_id=SCHEDULED, namespace=NS).job_spec
21
+ job = api.run_job(image=spec.docker_image, command=spec.command, flavor=spec.flavor, timeout=spec.timeout,
22
+ secrets={"HF_TOKEN": get_token()}, namespace=NS)
23
+ print(f"started {job.id} {getattr(job, 'url', '')}")
24
+ if "--wait" not in sys.argv:
25
+ sys.exit(0)
26
+ while True:
27
+ time.sleep(60)
28
+ st = api.inspect_job(job_id=job.id, namespace=NS).status
29
+ stage = getattr(st, "stage", st)
30
+ print(time.strftime("%H:%M:%S"), stage, flush=True)
31
+ if str(stage).upper() not in ("RUNNING", "PENDING"):
32
+ break
33
+ print("\n".join(str(x) for x in api.fetch_job_logs(job_id=job.id, namespace=NS, tail=40)))
code/.claude/skills/eco-release/scripts/sample.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """A random sample of a family's labels for checking by hand: open each link and decide
2
+ whether the release and type are right. Note the disagreements; above ~5% wrong, fix the rules.
3
+
4
+ python .claude/skills/eco-release/scripts/sample.py m M3-Pro [N=25] [--uncounted]
5
+
6
+ --uncounted samples the repos left out instead (family=False or a relation that is not
7
+ shown), which is where a too-strict rule hides its misses.
8
+ """
9
+ import json
10
+ import sys
11
+
12
+ import pandas as pd
13
+
14
+ import _root # noqa: F401
15
+ from hfeco import metrics, store
16
+
17
+ key, lineage = sys.argv[1], sys.argv[2]
18
+ n = next((int(a) for a in sys.argv[3:] if a.isdigit()), 25)
19
+ lab = pd.read_parquet(store.LOCAL / "labels" / key / "latest.parquet")
20
+ lab = lab[lab.kind == "model"]
21
+ counted = lab.family.astype(bool) & lab.relation.isin(metrics.REL_ORDER)
22
+ if "--uncounted" in sys.argv:
23
+ pool = lab[~counted & lab.evidence.str.contains(lineage, regex=False)]
24
+ else:
25
+ pool = lab[counted & (lab.lineage == lineage)]
26
+ print(f"{len(pool)} repos in the pool; {min(n, len(pool))} sampled\n")
27
+ for x in pool.sample(min(n, len(pool)), random_state=7).itertuples():
28
+ ev = json.loads(x.evidence) if isinstance(x.evidence, str) else []
29
+ print(f"https://huggingface.co/{x.repo_id}\n {x.lineage} / {x.relation} / {x.confidence}"
30
+ f"{' / ' + ','.join(json.loads(x.flags)) if isinstance(x.flags, str) and x.flags != '[]' else ''}")
31
+ for e in ev[:4]:
32
+ print(" ·", e)
code/.claude/skills/eco-release/scripts/shots.mjs ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Screenshots of the preview at desktop and phone width, first screen and full page, with any
2
+ // page error, failed request, horizontal overflow or stalled hero video reported. Runs on the
3
+ // Mac (playwright-core in ~/mm-shots + Google Chrome):
4
+ // cd ~/mm-shots && /opt/homebrew/bin/node shots.mjs <tag> "home:/,m3pro:/language/m3-pro"
5
+ // Writes ~/mm-shots/out/<tag>_<d|m>_<name>[_fold].png; scp them back to look at them.
6
+ import { mkdirSync } from "node:fs"
7
+ import { chromium } from "playwright-core"
8
+ const b = await chromium.launch({ executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" })
9
+ const U = "http://localhost:18767/index.html#"
10
+ const tag = process.argv[2] || "shot"
11
+ const pages = (process.argv[3] || "home:/").split(",").map((x) => x.split(":"))
12
+ const errs = []
13
+ const OUT = new URL("./out/", import.meta.url).pathname
14
+ mkdirSync(OUT, { recursive: true })
15
+ for (const [vw, vh, dev] of [[1440, 900, "d"], [390, 844, "m"]]) {
16
+ const ctx = await b.newContext({ viewport: { width: vw, height: vh }, colorScheme: "light" })
17
+ const p = await ctx.newPage()
18
+ p.on("pageerror", (e) => errs.push(e.message))
19
+ p.on("response", (r) => r.status() >= 400 && errs.push(`${r.status()} ${r.url()}`))
20
+ for (const [n, h] of pages) {
21
+ await p.goto(U + h); await p.waitForTimeout(3500)
22
+ await p.screenshot({ path: `${OUT}${tag}_${dev}_${n}_fold.png` })
23
+ const H = await p.evaluate(() => document.documentElement.scrollHeight)
24
+ for (let y = 0; y < H; y += 700) { await p.evaluate((y) => window.scrollTo(0, y), y); await p.waitForTimeout(200) }
25
+ await p.evaluate(() => window.scrollTo(0, 0)); await p.waitForTimeout(600)
26
+ await p.screenshot({ path: `${OUT}${tag}_${dev}_${n}.png`, fullPage: true })
27
+ const sw = await p.evaluate(() => document.documentElement.scrollWidth)
28
+ if (sw > vw) errs.push(`overflow at ${vw}px on ${h}: ${sw}px`)
29
+ const v = await p.evaluate(() => [...document.querySelectorAll("video")].slice(0, 1).map((v) => !v.paused))
30
+ if (dev === "d" && v.length && !v[0]) errs.push(`hero video not playing on ${h}`)
31
+ }
32
+ await ctx.close()
33
+ }
34
+ console.log("problems:", errs.length ? errs : "none"); await b.close()
code/.claude/skills/eco-release/scripts/site_media.mjs ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // The footage minimax.io uses: every <video> (src, poster, size on screen) on the given pages,
2
+ // for picking a hero / tile clip for a new modality or release. Runs on the Mac:
3
+ // scp site_media.mjs parsar-mac:mm-shots/ && ssh parsar-mac 'cd ~/mm-shots && /opt/homebrew/bin/node site_media.mjs https://www.minimax.io/ https://www.minimax.io/models/text/m3'
4
+ // The clips live on file.cdn.minimax.io (CORS open); a homepage carousel only loads the slides
5
+ // it reaches, so the script waits on each page and scrolls once to the bottom.
6
+ import { chromium } from "playwright-core"
7
+ const b = await chromium.launch({ executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" })
8
+ const p = await (await b.newContext({ viewport: { width: 1440, height: 900 } })).newPage()
9
+ for (const url of process.argv.slice(2)) {
10
+ await p.goto(url, { waitUntil: "domcontentloaded", timeout: 60000 }).catch((e) => console.log("goto", e.message))
11
+ await p.waitForTimeout(6000)
12
+ await p.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); await p.waitForTimeout(3000)
13
+ const vids = await p.evaluate(() => [...document.querySelectorAll("video")].map((v) => {
14
+ const r = v.getBoundingClientRect()
15
+ return { src: v.currentSrc || v.src || v.querySelector("source")?.src, poster: v.poster, w: Math.round(r.width), h: Math.round(r.height) }
16
+ }))
17
+ console.log(`\n${url}`)
18
+ for (const v of vids) console.log(` ${v.w}x${v.h} ${v.src}${v.poster ? `\n poster ${v.poster}` : ""}`)
19
+ }
20
+ await b.close()
code/.claude/skills/eco-release/scripts/try_repo.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Classify a few repos with a family's current rules, probing them fresh (no cache, nothing
2
+ written), and print the label with its evidence. For trying rules on known examples while
3
+ writing them.
4
+
5
+ python .claude/skills/eco-release/scripts/try_repo.py m someone/MiniMax-M3-Pro-GGUF [more repos]
6
+
7
+ Uses the latest local raw snapshot of the family for the declared base_model graph and the
8
+ official release dates; a repo missing from it is fetched from the Hub. Whole-repo copies of
9
+ other community repos are not detected here (that needs every probed repo).
10
+ """
11
+ import datetime as dt
12
+ import json
13
+ import sys
14
+
15
+ import _root # noqa: F401
16
+ from hfeco import classify, discover, enrich, families, hub, store
17
+
18
+ fam = families.get(sys.argv[1])
19
+ # A new family has no snapshot yet: then the declared graph holds only the repos tried here.
20
+ has_raw = any((store.LOCAL / "raw" / fam.key).glob("*.parquet"))
21
+ raw = store.read_raw(fam.key) if has_raw else None
22
+ today = raw[raw.day == raw.day.max()] if has_raw else None
23
+ g = classify.declared_graph(today) if has_raw else {}
24
+ created = dict(zip(today.repo_id, today.created_at)) if has_raw else {}
25
+ for m in fam.members: # official dates, even for a member the snapshot predates
26
+ for rid in m.repos:
27
+ if not created.get(rid):
28
+ try:
29
+ created[rid] = str(hub.info("model", rid).created_at)
30
+ except Exception:
31
+ pass
32
+ cutoff = {m.lineage: min((str(created[x]) for x in m.repos if created.get(x)), default="")
33
+ for m in fam.members if m.lineage != fam.default_member}
34
+ now = dt.datetime.now(dt.timezone.utc).isoformat(timespec="seconds")
35
+
36
+ for rid in sys.argv[2:]:
37
+ rows = today[today.repo_id == rid].to_dict("records") if has_raw else []
38
+ if rows:
39
+ r = rows[0]
40
+ else:
41
+ r = discover.record("model", hub.info("model", rid), now)
42
+ r["sources"] = []
43
+ g[rid] = [tuple(p.split(":", 1)) for p in r["hf_parents"]]
44
+ ev = enrich.enrich_model(rid, fam)
45
+ lab = classify.classify_model(r, ev, g, cutoff, fam)
46
+ lab.update(classify.declared_status(r, lab, g, fam))
47
+ print(f"\n{rid} (in today's snapshot: {bool(rows)})")
48
+ print(f" -> lineage={lab['lineage']} relation={lab['relation']} family={lab['family']} "
49
+ f"confidence={lab['confidence']} flags={lab['flags']}")
50
+ for e in lab["evidence"]:
51
+ print(" ·", e)
52
+ brief = {k: ev.get(k) for k in ("main_weight", "hidden_size", "vocab_size", "file_config", "n_weight_files")}
53
+ brief["gguf_arch"] = ((ev.get("gguf") or {}).get("kv") or {}).get("general.architecture")
54
+ print(" evidence read:", json.dumps(brief, ensure_ascii=False, default=str))
code/scripts/daily.py CHANGED
@@ -73,7 +73,8 @@ for key, (raw, today, cache_path, labels) in run.items():
73
  who, who_path = authors.update({i.split("/")[0] for i in fam_ids} | {b.split("/")[0] for b in fam.bases}, log=log)
74
  history = org.read_snapshots() if any((store.LOCAL / "raw" / "org").glob("*.parquet")) else None
75
  data = metrics.build(raw, labels, metrics.hf_tree_counts(today, fam), fam, who, history=history)
76
- data_path = store.LOCAL / "dashboard" / f"{fam.key}.json"
 
77
  metrics.dump(data, data_path)
78
  log(f"{fam.key}: {len(labels)} labels, {len(data['repos'])} repos on the dashboard")
79
  if args.push:
@@ -88,7 +89,11 @@ pub = org.public_models()
88
  rels = org.group(pub, log=log)
89
  deep = {}
90
  for key in {r["deep"][0] for r in rels.values() if r["deep"]}:
91
- deep[key] = json.loads((store.LOCAL / "dashboard" / f"{key}.json").read_text())
 
 
 
 
92
  in_families = {x["id"] for d in deep.values() for x in d["repos"]}
93
  roots = {m.id: k for k, r in rels.items() if not r["deep"] for m in r["models"]}
94
  found = org.crawl(roots, skip=in_families, log=log)
 
73
  who, who_path = authors.update({i.split("/")[0] for i in fam_ids} | {b.split("/")[0] for b in fam.bases}, log=log)
74
  history = org.read_snapshots() if any((store.LOCAL / "raw" / "org").glob("*.parquet")) else None
75
  data = metrics.build(raw, labels, metrics.hf_tree_counts(today, fam), fam, who, history=history)
76
+ data_path = store.LOCAL / "dashboard" / "family" / f"{fam.key}.json" # apart from the page files:
77
+ # a family key can also be a category key ("music"), and dashboard/<category>.json is a page
78
  metrics.dump(data, data_path)
79
  log(f"{fam.key}: {len(labels)} labels, {len(data['repos'])} repos on the dashboard")
80
  if args.push:
 
89
  rels = org.group(pub, log=log)
90
  deep = {}
91
  for key in {r["deep"][0] for r in rels.values() if r["deep"]}:
92
+ p = store.LOCAL / "dashboard" / "family" / f"{key}.json"
93
+ if not p.exists():
94
+ sys.exit(f"{p} is missing: the landing page needs every family's dashboard; run all families "
95
+ f"(no --family) or --skip-org")
96
+ deep[key] = json.loads(p.read_text())
97
  in_families = {x["id"] for d in deep.values() for x in d["repos"]}
98
  roots = {m.id: k for k, r in rels.items() if not r["deep"] for m in r["models"]}
99
  found = org.crawl(roots, skip=in_families, log=log)