ML Intern
| Entity Passport | |
| Registry ID | hf-space--smolagents--ml-intern |
| Provider | huggingface |
Cite this space
Academic & Research Attribution
@misc{hf_space__smolagents__ml_intern,
author = {smolagents},
title = {ML Intern Space},
year = {2026},
howpublished = {\url{https://huggingface.co/spaces/smolagents/ml-intern}},
note = {Accessed via Free2AITools Knowledge Fortress}
} ๐ฌTechnical Deep Dive
Full Specifications [+]โพ
โ๏ธ Nexus Index V2.0
๐ฌ Index Insight
FNI V2.0 for ML Intern: Semantic (S:50), Authority (A:0), Popularity (P:49), Recency (R:99), Quality (Q:50).
Verification Authority
Environment Profile
ML Intern
An ML intern that autonomously researches, writes, and ships good quality ML related code using the Hugging Face ecosystem โ with deep access to docs, papers, datasets, and cloud compute.
Quick Start
Installation
git clone git@github.com:huggingface/ml-intern.git
cd ml-intern
uv sync
uv tool install -e .
That's it. Now `ml-intern` works from any directory:
ml-intern
Create a .env file in the project root (or export these in your shell):
ANTHROPIC_API_KEY= # if using anthropic models
OPENAI_API_KEY= # if using openai models
HF_TOKEN=
GITHUB_TOKEN=
If no HF_TOKEN is set, the CLI will prompt you to paste one on first launch. To get a GITHUB_TOKEN follow the tutorial here.
Usage
Interactive mode (start a chat session):
ml-intern
Headless mode (single prompt, auto-approve):
ml-intern "fine-tune llama on my dataset"
Options:
ml-intern --model anthropic/claude-opus-4-6 "your prompt"
ml-intern --model openai/gpt-5.5 "your prompt"
ml-intern --max-iterations 100 "your prompt"
ml-intern --no-stream "your prompt"
Architecture
Component Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ โ โ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ
โ โ โ โ โ ContextManager โ โ โ โ โ โ
โ โ โ โ โ โข Message history โ โ โ โ โ โ
โ โ โ โ โ (litellm.Message[]) โ โ โ โ โ โ
โ โ โ โ โ โข Auto-compaction (170k) โ โ โ โ โ โ
โ โ โ โ โ โข Session upload to HF โ โ โ โ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ
โ โ โ โ โ โ โ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ
โ โ โ โ โ ToolRouter โ โ โ โ โ โ
โ โ โ โ โ โโ HF docs & research โ โ โ โ โ โ
โ โ โ โ โ โโ HF repos, datasets, โ โ โ โ โ โ
โ โ โ โ โ โ jobs, papers โ โ โ โ โ โ
โ โ โ โ โ โโ GitHub code search โ โ โ โ โ โ
โ โ โ โ โ โโ Sandbox & local tools โ โ โ โ โ โ
โ โ โ โ โ โโ Planning โ โ โ โ โ โ
โ โ โ โ โ โโ MCP server tools โ โ โ โ โ โ
โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ
โ โ โ โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ
โ โ โ โ Doom Loop Detector โ โ โ โ โ
โ โ โ โ โข Detects repeated tool patterns โ โ โ โ โ
โ โ โ โ โข Injects corrective prompts โ โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ
โ โ โ โ โ โ โ
โ โ โ Loop: โ โ โ โ
โ โ โ 1. LLM call (litellm.acompletion) โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ 2. Parse tool_calls[] โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ 3. Approval check โ โ โ โ
โ โ โ (jobs, sandbox, destructive ops) โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ 4. Execute via ToolRouter โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ 5. Add results to ContextManager โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ 6. Repeat if tool_calls exist โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโ
Agentic Loop Flow
User Message
โ
[Add to ContextManager]
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Iteration Loop (max 300) โ
โ โ
โ Get messages + tool specs โ
โ โ โ
โ litellm.acompletion() โ
โ โ โ
โ Has tool_calls? โโNoโโ> Done โ
โ โ โ
โ Yes โ
โ โ โ
โ Add assistant msg (with tool_calls) โ
โ โ โ
โ Doom loop check โ
โ โ โ
โ For each tool_call: โ
โ โข Needs approval? โโYesโโ> Wait for โ
โ โ user confirm โ
โ No โ
โ โ โ
โ โข ToolRouter.execute_tool() โ
โ โข Add result to ContextManager โ
โ โ โ
โ Continue loop โโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Events
The agent emits the following events via event_queue:
processing- Starting to process user inputready- Agent is ready for inputassistant_chunk- Streaming token chunkassistant_message- Complete LLM response textassistant_stream_end- Token stream finishedtool_call- Tool being called with argumentstool_output- Tool execution resulttool_log- Informational tool log messagetool_state_change- Tool execution state transitionapproval_required- Requesting user approval for sensitive operationsturn_complete- Agent finished processingerror- Error occurred during processinginterrupted- Agent was interruptedcompacted- Context was compactedundo_complete- Undo operation completedshutdown- Agent shutting down
Development
Adding Built-in Tools
Edit agent/core/tools.py:
def create_builtin_tools() -> list[ToolSpec]:
return [
ToolSpec(
name="your_tool",
description="What your tool does",
parameters={
"type": "object",
"properties": {
"param": {"type": "string", "description": "Parameter description"}
},
"required": ["param"]
},
handler=your_async_handler
),
# ... existing tools
]
Adding MCP Servers
Edit configs/cli_agent_config.json for CLI defaults, or
configs/frontend_agent_config.json for web-session defaults:
{
"model_name": "anthropic/claude-sonnet-4-5-20250929",
"mcpServers": {
"your-server-name": {
"transport": "http",
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer ${YOUR_TOKEN}"
}
}
}
}
Note: Environment variables like ${YOUR_TOKEN} are auto-substituted from .env.
AI Summary: Based on Hugging Face metadata. Not a recommendation.
๐ก๏ธ Space Transparency Report
Technical metadata sourced from upstream repositories.
๐ Identity & Source
- id
- hf-space--smolagents--ml-intern
- slug
- smolagents--ml-intern
- source
- huggingface
- author
- smolagents
- license
- tags
- docker, region:us
โ๏ธ Technical Specs
- architecture
- null
- params billions
- null
- context length
- null
- pipeline tag
- docker
๐ Engagement & Metrics
- downloads
- 0
- stars
- 208
- forks
- 0
Data indexed from public sources. Updated daily.