An open-source ML engineer that reads papers, trains models, and ships ML models using the Hugging Face ecosystem
Deep access to docs, papers, datasets, and cloud compute. Researches ML topics autonomously.
Automatically trains models with optimized hyperparameters and proper validation.
Deploys trained models to production environments with proper packaging and documentation.
Writes high-quality ML code using the Hugging Face ecosystem best practices.
Supports Claude, GPT, local models, and Hugging Face router models like MiniMax, Kimi, GLM, DeepSeek.
Auto-uploads sessions to your private Hugging Face dataset for easy review and debugging.
git clone git@github.com:huggingface/ml-intern.git
cd ml-intern
uv sync
uv tool install -e .
# Interactive mode
ml-intern
# Headless mode (single prompt)
ml-intern "fine-tune llama on my dataset"
# Different models
ml-intern --model anthropic/claude-opus-4-7 "your prompt"
ml-intern --model openai/gpt-5.5 "your prompt"
ml-intern --model ollama/llama3.1:8b "your prompt"
# Create .env file
ANTHROPIC_API_KEY=
OPENAI_API_KEY=
LOCAL_LLM_BASE_URL=http://localhost:8000
HF_TOKEN=
GITHUB_TOKEN=
┌─────────────────────────────────────────────────────────────┐
│ User/CLI │
└────────────┬─────────────────────────────────────┬──────────┘
│ Operations │ Events
↓ (user_input, exec_approval, ↑
submission_queue interrupt, compact, ...) event_queue
│ │
↓ │
┌────────────────────────────────────────────────────┐ │
│ submission_loop (agent_loop.py) │ │
│ ┌──────────────────────────────────────────────┐ │ │
│ │ 1. Receive Operation from queue │ │ │
│ │ 2. Route to handler (run_agent/compact/...) │ │ │
│ └──────────────────────────────────────────────┘ │ │
│ ↓ │ │
│ ┌──────────────────────────────────────────────┐ │ │
│ │ Handlers.run_agent() │ ├──┤
│ │ │ │ │
│ │ ┌────────────────────────────────────────┐ │ │ │
│ │ │ Agentic Loop (max 300 iterations) │ │ │ │
│ │ │ │ │ │ │
│ │ │ ┌────────────────────────────────────┐ │ │ │ │
│ │ │ │ Session & Context Management │ │ │ │ │
│ │ │ │ • Message history │ │ │ │ │
│ │ │ │ • Auto-compaction (170k) │ │ │ │ │
│ │ │ │ • Session upload to HF │ │ │ │ │
│ │ │ └────────────────────────────────────┘ │ │ │ │
│ │ │ │ │ │ │
│ │ │ ┌────────────────────────────────────┐ │ │ │ │
│ │ │ │ ToolRouter │ │ │ │ │
│ │ │ │ ├─ HF docs & research │ │ │ │ │
│ │ │ │ ├─ HF repos, datasets, jobs │ │ │ │ │
│ │ │ │ ├─ GitHub code search │ │ │ │ │
│ │ │ │ ├─ Sandbox & local tools │ │ │ │ │
│ │ │ │ └─ Planning & MCP servers │ │ │ │ │
│ │ │ └────────────────────────────────────┘ │ │ │ │
│ │ └──────────────────────────────────────────┘ │ │ │
│ └──────────────────────────────────────────────┘ │ │
└────────────────────────────────────────────────────┴──┘
Join thousands of developers using ML Intern to accelerate their machine learning projects