# ml-intern | Hugging Face | Knowledge Base | Instagit

🤗 ml-intern: an open-source ML engineer that reads papers, trains models, and ships ML models

GitHub Stars: 4.8k

Repository: https://github.com/huggingface/ml-intern

---

## Articles

### [How the HF Router Catalog Auto-Selects Providers for Different Models in ML Intern](/huggingface/ml-intern/hf-router-catalog-auto-select-providers-ml-intern)

Discover how the HF router catalog auto-selects providers in ML Intern. Learn about routing policies and dynamic provider selection for optimized ML model deployment.

- Tags: internals
- Published: 2026-04-24

### [How ML Intern Tracks Token Usage Across the Agent Loop](/huggingface/ml-intern/ml-intern-track-token-usage-agent-loop)

Discover how ML Intern tracks token usage across the agent loop using LLM call site instrumentation and Litellm responses for cost analysis.

- Tags: internals
- Published: 2026-04-24

### [ML Intern Interactive Mode vs Headless Mode: Complete Execution Guide](/huggingface/ml-intern/ml-intern-interactive-vs-headless-mode-execution)

Explore ML Intern interactive vs headless mode execution. Understand command-line interfaces animated output manual approvals auto approvals and automated workflows.

- Tags: how-to-guide
- Published: 2026-04-24

### [Slash Commands in ML Intern: A Complete Guide to the Interactive CLI](/huggingface/ml-intern/ml-intern-slash-commands-functionality)

Master ML Intern slash commands like /help, /undo, and /model. Control agent behavior, manage context, and configure settings efficiently from the interactive CLI.

- Tags: how-to-guide
- Published: 2026-04-24

### [How ML Intern Implements Retry Logic for Transient LLM Errors and Rate Limiting](/huggingface/ml-intern/ml-intern-retry-logic-llm-errors-rate-limiting)

ML Intern implements robust retry logic for LLM errors. It retries failed calls up to three times with progressive back-off and handles rate limiting to ensure smooth operation.

- Tags: internals
- Published: 2026-04-24

### [How GitHub Code Search in ML Intern Finds Examples Across Repositories](/huggingface/ml-intern/ml-intern-github-code-search-examples-repositories)

Discover how ML Intern utilizes GitHub code search to efficiently locate and retrieve relevant code examples across repositories using fuzzy matching and ranked results.

- Tags: how-to-guide
- Published: 2026-04-24

### [How ML Intern Documentation Search Tools Explore Hugging Face Docs](/huggingface/ml-intern/ml-intern-documentation-search-tools-hf-docs)

Discover how ML Intern's documentation search tools navigate Hugging Face docs. Learn about dynamic scraping, indexing, and full-text search with intelligent caching for efficient retrieval.

- Tags: how-to-guide
- Published: 2026-04-24

### [How the Research Sub-Agent Tool in ML Intern Performs Parallel Research Tasks](/huggingface/ml-intern/ml-intern-research-sub-agent-parallel-tasks)

Discover how ML Intern’s research sub-agent performs parallel research tasks. Learn about its unique approach to concurrent execution for enhanced efficiency.

- Tags: internals
- Published: 2026-04-24

### [What Git Operations Are Supported Through ML Intern's GitHub Integration Tools?](/huggingface/ml-intern/ml-intern-github-integration-git-operations)

Discover the Git operations ML Intern supports on Hugging Face Hub repositories including branch management tagging pull requests and more Learn about GitHub exploration utilities for public repositories.

- Tags: api-reference
- Published: 2026-04-24

### [How hf_repo_files and hf_repo_git Tools Handle Repository Operations in ML Intern](/huggingface/ml-intern/hf_repo_files-hf_repo_git-tools-repository-operations)

Discover how hf_repo_files and hf_repo_git tools manage repository operations for the ML Intern agent. Explore async interfaces for file CRUD and Git management.

- Tags: how-to-guide
- Published: 2026-04-24

### [How the hf_jobs Tool in ML Intern Manages Cloud Compute and Training Scripts](/huggingface/ml-intern/hf_jobs-tool-ml-intern-cloud-compute-training-scripts)

Discover how the hf_jobs tool in ML Intern manages cloud compute and training scripts. It translates JSON requests into API calls for efficient execution and real-time log streaming.

- Tags: how-to-guide
- Published: 2026-04-24

### [How Session Trajectory Upload Works in ML Intern for Debugging and Replay](/huggingface/ml-intern/ml-intern-session-trajectory-upload-debugging-replay)

Learn how ML Intern's session trajectory upload asynchronously saves agent interactions for debugging and replay. Ensure non-blocking persistence with detached subprocesses.

- Tags: internals
- Published: 2026-04-24

### [ML Intern Event System: Complete Guide to Event Types and Consumption](/huggingface/ml-intern/ml-intern-event-system-emit-consume)

Explore the ML Intern event system's 16 SSE types like ready, assistant chunk, and tool call. Learn how to consume events directly via EventSource or the SSEChatTransport.

- Tags: deep-dive
- Published: 2026-04-24

### [How to Add Custom Built-in Tools to ML Intern: A Complete Guide](/huggingface/ml-intern/add-custom-built-in-tools-ml-intern)

Learn how to add custom built-in tools to ML Intern. Implement async handlers, define ToolSpecs, and register them using create_builtin_tools or ToolRouter for enhanced functionality.

- Tags: how-to-guide
- Published: 2026-04-24

### [How Prompt Caching Optimizes Token Usage in ML Intern](/huggingface/ml-intern/ml-intern-prompt-caching-optimize-token-usage)

Discover how ml intern uses prompt caching to slash Anthropic API costs by up to 90%. Learn to optimize token usage with the with_prompt_caching helper for efficient ML applications.

- Tags: internals
- Published: 2026-04-24

### [How ML Intern Recovers When the LLM Context Window Is Exceeded](/huggingface/ml-intern/ml-intern-recover-llm-context-window-exceeded)

Discover how ML Intern handles LLM context window overflows. It automatically recovers by summarizing older dialogue turns and retrying calls for seamless AI interaction.

- Tags: internals
- Published: 2026-04-24

### [How the Streaming Token Buffer Handles Markdown and Code Blocks in ML Intern](/huggingface/ml-intern/ml-intern-streaming-token-buffer-markdown-code-blocks)

Learn how ml interns streaming token buffer handles markdown and code blocks efficiently. Discover how fenced code blocks render atomically for a seamless user experience.

- Tags: internals
- Published: 2026-04-24

### [Sandbox Mode and Local Mode for Tool Execution in ML Intern: Security and Configuration Guide](/huggingface/ml-intern/ml-intern-sandbox-vs-local-mode-tool-execution)

Understand ML Intern's sandbox mode vs local mode for tool execution. Securely isolate tools in Docker or run them directly on the host for speed. Choose the best mode for your needs.

- Tags: security-and-configuration-guide
- Published: 2026-04-24

### [How to Configure MCP Servers in ML Intern for Extended Tool Capabilities](/huggingface/ml-intern/configure-mcp-servers-ml-intern-extended-tools)

Learn to configure MCP servers in ML Intern to unlock new tool capabilities. This guide shows how to integrate external back-ends using JSON configuration and Pydantic models for enhanced functionality.

- Tags: how-to-guide
- Published: 2026-04-24

### [Model Switching with Effort Probing in ML Intern: How It Works](/huggingface/ml-intern/ml-intern-model-switching-effort-probing)

Discover model switching with effort probing in ML Intern. This automated system validates LLM reasoning effort using lightweight requests before committing changes. Optimize your ML workflow.

- Tags: internals
- Published: 2026-04-24

### [How ML Intern Manages Session State and Auto-Saves Conversations to Hugging Face](/huggingface/ml-intern/ml-intern-session-state-auto-save-conversations)

Discover how ML Intern manages session state and auto-saves conversations to Hugging Face. Learn about its SessionManager, state tracking, and efficient upload process.

- Tags: internals
- Published: 2026-04-24

### [ML Intern Tool Approval Workflow: How HF Jobs and File Uploads Stay Secure](/huggingface/ml-intern/ml-intern-tool-approval-workflow-sensitive-operations)

Secure your sensitive ML operations with the ML Intern tool approval workflow. Learn how HF Jobs and file uploads get explicit user consent before execution.

- Tags: how-to-guide
- Published: 2026-04-24

### [Doom Loop Detector in ML Intern: How It Prevents Repetitive Tool Calls](/huggingface/ml-intern/ml-intern-doom-loop-detector-repetitive-tool-calls)

Discover the doom loop detector in ML Intern. Learn how it prevents repetitive tool calls by identifying cyclic patterns and injecting corrective prompts to optimize LLM strategy.

- Tags: internals
- Published: 2026-04-24

### [How ML Intern Implements Context Compaction for Long Conversations](/huggingface/ml-intern/how-ml-intern-context-compaction-long-conversations)

Discover how ML Intern compacts long conversations with AI summarization. Learn how it preserves key info while optimizing token usage for efficient chat AI.

- Tags: internals
- Published: 2026-04-24

