Hugging Face ML Intern: Automated Model Development and Distillation

Hugging Face has demonstrated the capabilities of ML Intern, an agentic tool integrated into HuggingChat that automates the end-to-end machine learning pipeline. By providing a detailed natural language prompt, users can task ML Intern to identify datasets, select base models, execute training scripts, perform evaluations, and publish the resulting models directly to the Hugging Face Hub.

Automated ML Workflow and Prompting Strategy

ML Intern operates as an autonomous agent that plans the development work, requests a specific budget from the user before spending, runs smoke tests to verify weights are changing, and executes the full training and evaluation process on Hugging Face hardware.

To maximize the agent's effectiveness, a structured prompting approach is recommended:

  • Idea and Rationale: Start with a clear statement of the desired model and why it is needed.
  • Specification: Explicitly name the dataset, base model, and training script.
  • Verified Facts: Include a section titled "Verified facts, do not re-derive" to prevent the agent from wasting compute budget on rediscovering known information.
  • Baseline Requirements: Request a zero-shot score from the base model on the target metric to quantify the actual gain after training.
  • Smoke Testing: Mandate a small initial run (e.g., 50 training steps) with a check to ensure saved weights have changed before committing to a full training run.
  • Budgetary Control: Define a strict spending cap (e.g., "Cap total spend at USD 12") which the agent must adhere to, requesting permission before exceeding it.

Case Studies in Model Creation

Using ML Intern, several specialized models were developed across different modalities and use cases within a few days:

Domain-Specific Vision Models

ML Intern fine-tuned Qwen3.5-2B to create the citrus-disease-vlm, a model capable of identifying 21 distinct pests, illnesses, and nutritional deficiencies in citrus plants. The base model's accuracy on 335 test photos rose from 14.9% to 52.8% after two epochs on one A10G GPU, costing approximately USD 1.90.

Character-Specific LoRAs

A LoRA was trained on FLUX.2 klein base 4B using 84 captioned drawings to create a model that consistently renders "Huggy," a specific brand character. The process involved saving checkpoints every 100 steps to identify the optimal balance between character fidelity and style bleed, costing approximately USD 7.60.

Functional Image LoRAs

Two specialized LoRAs for Qwen-Image 2.1 were developed:

  • Viewpoint Orbit LoRA: This model allows users to request an object be viewed from specific angles. ML Intern rendered 24,722 transparent images from 1,030 scanned objects to create the training set. The project cost approximately USD 16.
  • Doodle-in LoRA: This model replaces magenta scribbles in photos with specific objects while maintaining lighting and composition. ML Intern synthesized a dataset of 6,042 training pairs using the LaMa inpainting model. The project cost approximately USD 24.30.

Model Distillation and Compression

ML Intern was used to create smaller, more efficient versions of existing models:

  • Pocket Rewriter: A 0.8B and 2B student version of the 9B Qwen-Image 2.1 prompt rewriter. The 0.8B version runs on a CPU and returns valid output 99.7% of the time while using a quarter of the teacher's tokens. The total compute cost was USD 16.05.
  • Agate 4-step: A distillation of Logolabs' Agate Preview 002 (260M parameters). The original model required 50 steps; ML Intern distilled it down to 4 steps. After two training runs, the GenEval score improved from 0.509 to 0.536 (compared to the teacher's 0.563 at 50 steps), reducing compute by 75%. Total cost was USD 37.

Resource and Cost Summary

Across six projects, the total compute cost for GPU and CPU jobs was approximately USD 103.

Model Base Model Compute Cost
Citrus Doctor Qwen3.5-2B USD 1.90
Huggy LoRA FLUX.2 klein base 4B USD 7.60
Pocket Rewriter (0.8B & 2B) Qwen3.5-0.8B & 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 Agate Preview 002 USD 37
Total ~USD 103

Sources