source: kdnuggets: getting started with hugging face ml intern: your first ml agent

level: technical

ml intern is an open-source command-line agent from hugging face that turns plain english task descriptions into executed machine learning workflows. you describe what you want, and it searches papers, writes scripts, launches gpu training jobs, logs experiments, and publishes trained models to the hub. it uses the smolagents framework and routes model calls through hugging face inference providers or local endpoints. the agent works iteratively, not just generating a single answer, and can improve model performance over time, as shown by a jump from 10% to 32% on the gpqa benchmark in under 10 hours.

to get started, you need a hugging face account, python, uv, and tokens for hugging face and github. after cloning the repository and installing with uv, you can run the agent in interactive mode for guided, step-by-step execution with approval prompts, or in headless mode for automated runs suitable for ci pipelines. in interactive mode, you can swap models mid-session and ask follow-up questions. headless mode auto-approves actions and is ideal for nightly experiments. the agent supports local models via ollama, vllm, or other openai-compatible servers, though small local models may struggle with complex multi-step tasks.

the agent comes with many built-in tools covering the hugging face ecosystem, github search, file operations, and planning helpers. it includes a doom loop detector to prevent repeated failed tool calls. every session can auto-upload traces to a private dataset on your hub account for debugging with the agent trace viewer. common pitfalls include vague prompts, blindly approving costly actions, and not setting iteration limits during testing. ml intern does not replace human judgment but automates repetitive setup, letting you focus on research decisions.

why it matters: it automates the tedious parts of machine learning experimentation, letting data scientists and researchers iterate faster on ideas instead of writing boilerplate code.


source: kdnuggets: getting started with hugging face ml intern: your first ml agent