上周,我想要一个精简版的提示词重写器,也就是随 Qwen-Image 2.1 发布的那个。官方版本是一个 9B 模型,需要大约 20 GB 的内存,并且在写出第一段文字之前要处理数千个 token。在 Hugging Face Hub 上,我只找到了该 9B 模型的压缩副本。于是,我向 ML Intern 描述了我的需求,第二天我就得到了一个可以在 CPU 上运行的 0.8B 版本。它在 99.7% 的情况下能返回有效输出,且使用的 token 量仅为原版教师的四分之一。整个项目的计算成本(包括让 9B 模型标注 8,797 个示例请求)共计 16 美元。
在接下来的几天里,我以同样的方式制作了五个更多的模型。每一个都始于 HuggingChat 中的一条消息,并开启了 ML-intern 功能;每一个最终都成为 Hub 上的公开模型,并在其模型卡片中包含了评估结果。ML-intern 负责规划工作,在花费任何资金之前会向我询问预算,在实际任务运行前会先进行小规模测试,然后在 Hugging Face 的硬件上进行训练、评估和发布。
我如何提示 ML Intern
第一条消息是我投入精力的地方。对于下面共享的 citrus(柑橘)模型,我的第一个提示词大约有 450 个单词。到了第六个项目时,它已经接近 2,000 个单词,因为每个项目都教会了我下一个项目所需的一些东西。所有七个提示词都在 GitHub 上的 yvrjsharma/ml-intern-prompts 中,完全保留了我编写时的原貌。
提示词以一句话的理念和我想要它的理由开始。然后它指定了具体的组成部分:数据集、基础模型、训练脚本。任何我已经核实过的内容都放在一个标题为“已验证的事实,请勿重新推导”的部分下,这样代理就能将预算用于实际工作,而不是重新发现我已知的知识。对于相机角度 LoRA,该部分列出了哪位训练器刚刚添加了透明图像支持,以及哪些开放的 GitHub 问题使得备用训练器存在风险。
提示词中的两行内容至关重要。第一行要求在开始任何训练之前提供基线。例如,柑橘模型的提示词写道:“在训练前也报告基础模型在同一指标上的零样本得分,以便我们能看到提升幅度。”如果没有这一行,你会得到一个训练好的模型,却完全不知道它是否比初始模型更好。第二行是带有检查功能的冒烟测试。对于图像 LoRA,我要求先进行 50 个训练步骤,然后检查保存的权重是否确实发生了变化,之后才支付完整运行的费用。
在提示词的末尾,我列出了预期的交付物并限制了成本。我定义了模型卡片中应包含的内容,并加入了指令如:“将总花费上限设为 12 美元,并在超出之前询问我。”由于 ML-intern 每次任务都以零美元预算开始,并且在执行付费任务前需要许可,因此这一支出限制会得到严格执行。如果你不留下预算,代理会根据项目规模建议几种路径,并询问你偏好哪一种。
在第一次尝试时,你并不一定需要所有这些内容。例如,在我的柑橘简报中我没有包含已验证事实部分,但 ML Intern 仍然生成了一个模型,其准确率是 Qwen3.5-2B 模型的三倍以上。让我带你看看我在短短几天内用 ML-Intern 构建的六件事。
通用视觉模型可以描述一片发黄的柑橘叶子。然而,告诉你这是螨虫问题还是镁缺乏症,以及治疗植物的生物和非生物方法则非常困难。使用 Claude,我整理了一个训练数据集,该数据集合并了 Hub 上 Project-AgML 组织托管的三个来源的数据。生成的 citrus-disease-vlm-instruct 是一个包含 3,017 张标注图像的数据集,涵盖 21 种不同的害虫、疾病、营养缺失和治疗方案。ML-intern 使用这些示例对 Qwen3.5-2B 进行了微调,并确保在此之前对基础模型进行了基准测试。
在335张测试照片中,基础模型正确识别出问题的比例仅为14.9%。在经过一个A10G显卡上的两个epoch微调后,微调模型的准确率提升至52.8%。计算成本约为1.90美元。
查看:模型 · 数据集 · Citrus Doctor App
图像模型熟知许多角色。以Hugging Face品牌资产的扁平风格绘制的Huggy并不在其中。我要求ML-Intern在FLUX.2 klein base 4B基础上训练一个LoRA,使用了来自Chunte/huggy_for_training数据集的84张带标题的绘图。
该代理每100步保存一次检查点,并用每个检查点对同一组提示词进行绘图,这使得选择变得容易。在第200步时,Huggy终于完全符合模型风格。从第500步开始,Huggy的风格开始“渗透”到与Huggy毫无相关的提示词中!训练好的LoRA在4步的蒸馏klein模型上也同样有效。计算成本约为7.60美元。
查看:模型 · 数据集 · Huggy Generator App
相机角度LoRA是早期Qwen-Image模型社区中最受欢迎的附加组件之一。你可以给模型一张物体的照片,并要求从左侧45度角观察它。在Qwen-Image 2.1模型发布几天后我进行检查时,发现还没有人制作过此类LoRA,因此我指派ML-Intern来构建它。
ML-Intern在CPU任务中渲染了Google Scanned Objects数据集中的1,030个扫描家居物体,每个物体以24个角度呈现,共生成24,722张透明图像,成本仅为几分钱。随后,它确定了461个用于训练的物体和40个用于测试的保留物体,并生成了1,844对训练前后的配对数据,均匀分布在23种相机指令中。
训练在一个A100显卡上运行了2,000步,耗时约90分钟(约3.75美元)。整个项目耗时约半天,涉及48个任务,其中包括因缺少包或路径错误而失败、需要ML-Intern重新提交的任务。总计算成本约为16美元。
查看:模型 · 数据集 · Viewpoint Orbit App
Doodle-in LoRA是另一个很酷的想法。上传一张带有洋红色涂鸦的照片,并添加一个简短的提示词来命名某个物体。该LoRA会用该物体替换涂鸦,同时保持原始的光照和构图一致。
此前没有现成的数据集,因此我的提示词描述了如何构建这样一个数据集。从Open Images中的真实照片开始,使用LaMa修复模型移除其中一个物体,并在该物体原本所在的位置画上涂鸦。未受影响的原始照片即为目标图像。ML-Intern在CPU沙箱中编写并测试了配对构建脚本,然后将其作为GPU任务运行,同时记录了每张照片的来源作者和许可证信息。它构建了6,042对训练数据和160对的测试集,其中40对测试数据来自23个完全未参与训练的物体类别。
在训练前,它在Viggle turbo LoRA的帮助下对基础模型进行了自测,并检查了批量运行编辑是否生成相同的图像,从而降低了评估成本。训练在一个A100显卡上运行了2,000步,耗时1小时38分钟(约4美元),通过对48个测试对的保存检查点进行比较,最终选定第500步的结果。
与6步的Viggle turbo LoRA配合使用时,该LoRA表现非常出色。67.5%的物体在绘制位置被正确检测,每次编辑耗时4.7秒。来自23个未见类别的物体同样可靠地生成(65.0%对比64.2%)。该项目耗时一天多一点,涉及59个任务。总计算成本约为24美元。
查看:模型 · 数据集 · Doodle-in App
本文开头提到的Pocket Rewriter是第一个此类应用。ML-Intern首先通过Inference Providers使用小型指令模型生成了8,797个简短的图像请求,遵循我在提示词中设定的混合集合:照片、海报、标志、信息图等,其中约三分之一要求包含引号内的确切文本,许多还涉及非英语语言。随后,9B教师模型在一个A100显卡上耗时2小时37分钟(约6.50美元)重写了所有这些请求。经过质量过滤后,选出1,840个示例作为训练数据集。
在 A10G 上训练 0.8B 和 2B 的学生模型分别耗时 12 分钟和 18 分钟(两项合计费用为 0.75 美元)。0.8B 模型还提供大小为 812 MB 的 GGUF 文件,以便在 CPU 上运行。该项目耗时约 11 小时,共使用了 24 个作业。总计算成本约为 16 美元。
查看:Pocket rewriter 0.8B Student · 2B Student · Dataset · Pocket Studio App · Compare the teacher-student in Rewriter Arena
Agate-Preview-002-4step 是第二个模型。Logolabs 的 Agate Preview 002 是一个拥有 2.6 亿参数的文生图模型,体积小到可以在浏览器中运行,但它需要 50 步引导生成,这意味着每张图片需要进行 100 次网络前向传播。我要求 ML-intern 将其蒸馏为仅需 4 次前向传播!
这经历了两次运行。第一次运行将 15.5 万张训练图像缓存为潜变量(latents),将引导信息烘焙到模型中,然后在 A100 GPU 上分阶段将步数从 16 减少到 8,再减少到 4。在 GenEval 和 FID 指标上,4 步学生模型的表现优于教师模型在相同 4 步下的表现,随后 ML-intern 将其导出为 ONNX 格式以用于浏览器。这次运行耗时约 13 小时,费用为 22 美元。
我进行了第二次训练运行,要求 ML-Intern 进一步改进 4 步学生模型。它随后使用教师模型在 16 步下生成了另外 2.4 万对图像,并对 4 步学生模型针对这些数据进行微调,耗时约一小时。GenEval 得分从 0.509 提升至 0.536,而教师模型在 50 步下的得分为 0.563,此时学生模型仅需 4 步(计算量仅为四分之一)。ML-intern 重新导出了浏览器版本。第二次运行耗时约 8 小时。两次运行的总计算成本约为 37 美元。
查看:Agate 4-step model · Dataset · Run Agate in your browser · Agate 4-step LIVE
费用明细
模型
基础模型
计算成本
Citrus Doctor
Qwen3.5-2B
1.90 美元
Huggy LoRA
FLUX.2 klein base 4B
7.60 美元
Pocket rewriter (0.8B and 2B)
Qwen3.5-0.8B and 2B
16.05 美元
Viewpoint Orbit LoRA
Qwen-Image 2.1
16 美元
Doodle-in LoRA
Qwen-Image 2.1
24.30 美元
Agate 4-step (two runs)
Agate Preview 002
37 美元
总计
约 103 美元
这些是每个会话报告的 GPU 和 CPU 作业费用。
制作你自己的模型
ML-intern 位于 HuggingChat 中。开启 ML-intern 模式并粘贴提示词。如果你需要起点,我的示例提示词可免费复制。从一个你希望存在的模型和你拥有的数据集(或你能描述的数据集)开始。设定一个小预算,要求基线和冒烟测试,并在提高上限之前阅读返回结果。
如果你用它制作了什么东西,请在 X 上分享并标记 @Gradio 和 @HuggingFace 。我们非常乐意看到那些别人不会想到为你构建的模型。
Last week, I wanted a small version of the
prompt rewriter that ships with Qwen-Image 2.1. The official one is a 9B model that needs about 20 GB of memory and thinks for thousands of tokens before writing a single paragraph. On the Hub, I found only compressed copies of that same 9B model. So I described what I wanted to
ML Intern , and the next day I had a
0.8B version that runs on a CPU. It returns valid output 99.7% of the time and uses about a quarter of the teacher's tokens. The compute for the whole project, including having the 9B model label 8,797 example requests, came to USD 16.
Over the course of the next few days, I made five more models the same way. Each one started as a message in HuggingChat with ML-intern switched on, and each one ended as a public model on the Hub with its evaluation in the model card. ML-intern plans the work, asks me for a budget before it spends anything, runs a small test before the real job, then trains, evaluates and publishes on Hugging Face hardware.
How I prompt ML Intern
The first message is where I spend my effort. My first prompt, for the citrus model shared below, was about 450 words. By my 6th project it was closer to 2,000, because each project taught me something I wanted in the next one. All seven prompts are on GitHub at yvrjsharma/ml-intern-prompts , exactly as I wrote them.
A prompt starts with the idea in one line and why I want it. Then it names the exact pieces: the dataset, the base model, the training script. Anything I have already checked goes under a heading that literally says "Verified facts, do not re-derive", so the agent spends its budget on the work instead of rediscovering what I know. For the camera-angle LoRA that section listed which trainer had just added transparent-image support, and which open GitHub issues made the fallback trainer risky.
Two lines in the prompt are critical . The first asks for a baseline before any training. For example, the citrus prompt says: "Also report the base model's zero-shot score on the same metric before training so we can see the gain." Without it you get a trained model and no idea whether it is better than what you started with. The second is a smoke test with a check attached. For the image LoRAs I asked for 50 training steps, then a check that the saved weights had actually changed, before paying for the full run.
At the end of the prompt, I lay out the expected deliverables and limit the cost. I define what belongs in the model card and include a instruction like: "Cap total spend at USD 12 and ask me before exceeding it." Because ML-intern begins every task with zero dollar budget and needs permission before executing paid jobs, this spending limit stays strictly enforced. When you leave out a budget, the agent suggests a couple of paths depending on project size and asks which one you prefer.
You don't necessarily need all of that on your first attempt. For example, I didn't have the verified-facts section in my citrus brief and ML Intern still produced a model that more than tripled the accuracy of the Qwen3.5-2B model. Let me walk you through 6 things I built with Ml-Intern in just a couple of days.
A general vision model can describe a yellowing citrus leaf. However, telling you whether it is a mite problem or a magnesium deficiency, and the bio and non-bio remedies to treat the plant is very hard. Using Claude, I put together a training dataset merged from three sources hosted by the Project-AgML organization on the Hub. The resulting citrus-disease-vlm-instruct is a dataset containing 3,017 annotated images across 21 distinct pests, illnesses, nutritional gaps, and treatment approaches. ML-intern handled the fine-tuning of Qwen3.5-2B using these examples, making sure to benchmark the foundation model beforehand.
On the 335 test photos, the base model named the right problem 14.9% of the time. After two epochs on one A10G, the fine-tuned model got 52.8%. Compute cost, about USD 1.90.
Check out: Model · Dataset · Citrus Doctor App
Image models know plenty of characters. Huggy, drawn in the flat style of the Hugging Face brand assets, was not one of them. I asked ML-Intern for a LoRA on FLUX.2 klein base 4B , trained on 84 captioned drawings from Chunte/huggy_for_training dataset.
The agent saved a checkpoint every 100 steps and drew the same set of prompts with each one, which made choosing easy. Step 200 was the first where Huggy was fully on-model . From step 500 on, Huggy's style started bleeding into prompts that had nothing to do with Huggy! The trained LoRA also works on the distilled klein model at 4 steps. Compute cost, about USD 7.60.
Check out: Model · Dataset · Huggy Generator App
Camera-angle LoRAs are among the most-liked community add-ons for earlier Qwen-Image models. You can give the model a picture of an object and ask to see it 45 degrees from the left. When I checked a few days after the Qwen-Image 2.1 model release, nobody had made one, so I tasked ML-intern to build it.
ML-intern rendered 1,030 scanned household objects from Google Scanned Objects at 24 angles each, 24,722 transparent images, on a CPU job that cost a few cents. It later finalised 461 objects for training and 40 held out for testing, and 1,844 before-and-after training pairs spread evenly over 23 camera instructions.
Training ran 2,000 steps in about 90 minutes on one A100 (~USD 3.75). The whole project took about half a day and 48 jobs, counting the ones that failed on missing packages or wrong paths and had to be resubmitted by ML-Intern. Total compute cost, about USD 16.
Check out: Model · Dataset · Viewpoint Orbit App
Doodle-in LoRA is another cool idea. Upload a photo with a magenta scribble on it and add a short prompt naming an object. The LoRA replaces the scribble with that object while keeping the original lighting and composition consistent.
No dataset existed for this, so my prompt described how to make one. Start from a real photo in Open Images, remove one object with the LaMa inpainting model, and draw a scribble where the object used to be. The untouched photo is the target. ML-intern wrote and tested the pair-building scripts in a CPU sandbox, then ran them as GPU jobs, recording the author and license of every source photo along the way. It built 6,042 training pairs and a 160-pair test set, where 40 of the test pairs come from 23 object classes kept out of training entirely.
Before training, it measured the base model on its own and with the Viggle turbo LoRA, and checked that running edits in batches produced identical images, which made the evaluation cheaper. Training ran 2,000 steps in 1 hour 38 minutes on one A100 (~USD 4), and a comparison of the saved checkpoints on 48 test pairs picked step 500.
Paired with the Viggle turbo LoRA at 6 steps the LoRA performed really well. 67.5% of objects detected where they were drawn, at 4.7 seconds per edit. Objects from the 23 unseen classes landed as reliably as the rest (65.0% versus 64.2%). The project took a little over a day and 59 jobs. Total compute cost, about USD 24.
Check out: Model · Dataset · Doodle-in App
The Pocket Rewriter from the top of this post is the first one. ML-intern started by generating 8,797 short image requests with a small instruct model through Inference Providers, following a mix set in my prompt: photos, posters, logos, infographics and more, about a third of them asking for exact text in quotes, and many in languages other than English. The 9B teacher then rewrote all of them on one A100 in 2 hours 37 minutes (~USD 6.50). After filtering for quality, 1,840 examples were selected for training dataset.
Training the 0.8B and 2B students took 12 and 18 minutes on an A10G (USD 0.75 for both). The 0.8B also ships as an 812 MB GGUF file for running on a CPU. The project took about 11 hours and 24 jobs. Total compute cost, about USD 16.
Check out: Pocket rewriter 0.8B Student · 2B Student · Dataset · Pocket Studio App · Compare the teacher-student in Rewriter Arena
Agate-Preview-002-4step is the second. Logolabs' Agate Preview 002 is a 260M-parameter text-to-image model, small enough for a browser, but it needs 50 steps with guidance, which is 100 network passes per image. I asked ML-intern to distill it down to just 4 passes!
It took two runs. The first cached 155,000 training images as latents, baked the guidance into the model, then cut the step count in stages from 16 to 8 to 4, all on A100s. The 4-step student beat the teacher run at the same 4 steps on GenEval and FID, after that ML-intern exported it to ONNX for the browser. This run took about 13 hours and USD 22.
I did a second training run by asking ML-Intern to improve the 4-step student a bit more. It then made 24,000 more image pairs with the teacher at 16 steps and fine-tuned the 4-step student against them for about an hour. GenEval went from 0.509 to 0.536, against the teacher's 0.563 at 50 steps, with just 4 steps (one-fourth the compute). ML-intern re-exported the browser version. The second run took about 8 hours. Total compute cost across both runs, about USD 37.
Check out: Agate 4-step model · Dataset · Run Agate in your browser · Agate 4-step LIVE
What it cost
Model
Base model
Compute
Citrus Doctor
Qwen3.5-2B
USD 1.90
Huggy LoRA
FLUX.2 klein base 4B
USD 7.60
Pocket rewriter (0.8B and 2B)
Qwen3.5-0.8B and 2B
USD 16.05
Viewpoint Orbit LoRA
Qwen-Image 2.1
USD 16
Doodle-in LoRA
Qwen-Image 2.1
USD 24.30
Agate 4-step (two runs)
Agate Preview 002
USD 37
Total
about USD 103
These are the GPU and CPU job charges reported for each session.
Make yours
ML-intern is in HuggingChat . Switch on ML-intern mode and paste a prompt. If you want a starting point, my example prompts are free to copy. Start from a model you wish existed and a dataset you have, or one you can describe. Give it a small budget, ask for a baseline and a smoke test, and read what comes back before you raise the cap.
If you make something with it, share it on X and tag @Gradio and @HuggingFace . We would love to see the models you make that nobody else would think to build for you.
首次收录 · 2026-10-09 · 9.95 分