ml-intern: Instructions file for Codex

AGENTS.md

ml-intern AGENTS.md is an instructions file for Codex, OpenCode from huggingface/ml-intern. It costs 1,040 tokens per session, scanned A, original, Apache-2.0.

Repository-specific instructions for developing and checking a Hugging Face machine-learning intern application, including its frontend, backend, local servers, and Git workflow.

In plain words
What is it for?
Use them when starting the app, checking frontend or backend health, installing frontend dependencies, configuring model access, or investigating session-related web issues.
Why use it?
They give coding agents the project’s required commands, local URLs, environment settings, and debugging locations instead of leaving them to guess.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Codex.

This is huggingface/ml-intern's own configuration. It tells Codex and OpenCode how to work on ml-intern itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ml-intern configures →

About the project

ML Intern is an AI software agent that researches machine-learning topics, writes code, trains models, and ships models using the Hugging Face ecosystem. It is for ML engineers and developers who want an agent to work with papers, documentation, datasets, and hosted or locally served models.

huggingface/ml-intern · 10,788 stars · on GitHub · huggingface.co

Reuse

Borrowing it

Nothing to install: this file belongs to huggingface/ml-intern. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/huggingface/ml-intern/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/huggingface/ml-intern

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ml-intern AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/huggingface/ml-intern/agents-md/github.svg)](https://agentmods.dev/instructions/huggingface/ml-intern/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/huggingface/ml-intern/agents-md"><img src="https://agentmods.dev/badge/instructions/huggingface/ml-intern/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ml-intern AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/huggingface/ml-intern/agents-md"><img src="https://agentmods.dev/badge/instructions/huggingface/ml-intern/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,040 This file is loaded in full into every session.
When invoked 1,040 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01040 $0.01040
Opus 5.5 $0.00416 $0.00416
Sonnet 5.5 $0.00208 $0.00208
Haiku 4.5 $0.00104 $0.00104

Measured 1mo ago against content hash 60ab65c13f94, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ml-intern AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Backend health check: `curl -g http://[::1]:7860/api`
AGENTS.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Notes

Local Dev Servers

  • Frontend: from frontend/, run npm ci if dependencies are missing, then npm run dev.
  • Backend (full/rollback): from backend/, run uv run uvicorn main:app --host ::1 --port 7860.
  • Hosted Space: backend/start.sh runs retired_main:app, which serves only the retirement page and GET /api.
  • Frontend URL: http://localhost:5173/
  • Backend health check: curl -g http://[::1]:7860/api
  • Frontend proxy health check: curl http://localhost:5173/api

Notes:

  • Vite proxies /api and /auth to http://localhost:7860.
  • If 127.0.0.1:7860 is already owned by another local process, binding the backend to ::1 lets the Vite proxy resolve localhost cleanly.
  • Prefer npm ci over npm install for setup, since npm install may rewrite frontend/package-lock.json metadata depending on npm version.
  • Non-local LLM calls use https://router.huggingface.co/v1 with the active Hugging Face user's token. Web sessions and the CLI default to GLM 5.2. For local development, set HF_TOKEN and optionally ML_INTERN_DEFAULT_MODEL_ID.
  • When asked to start the local server, export the GitHub CLI token first with export GITHUB_TOKEN="$(gh auth token)".
  • When debugging a web app issue tied to a session ID, inspect the session data in smolagents/ml-intern-sessions for additional context.

Development Checks

  • Before every commit, run uv run ruff check . and uv run ruff format --check ..
  • If formatting fails, run uv run ruff format ., then re-run the Ruff checks before committing.

Git Workflow

  • Before creating any new branch or worktree, switch to main and pull the latest changes.

GitHub CLI

  • Always use the gh CLI for GitHub operations such as opening, editing, inspecting, or commenting on PRs and issues.
  • For multiline PR descriptions, prefer gh pr edit <number> --body-file <file> over inline --body so shell quoting, $ env-var names, backticks, and newlines are preserved correctly.
  • If gh reports an invalid token or auth failure, retry the command with GH_TOKEN and GITHUB_TOKEN unset, for example env -u GH_TOKEN -u GITHUB_TOKEN gh pr create ..., so gh can use the stored login token instead of a stale environment token.
  • In Codex, sandboxed gh auth checks can report a valid keyring login as invalid when GitHub network access is restricted. Before telling the user to re-authenticate, retry with both env tokens unset and GitHub network access enabled.

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines · +33 tokens per session 60ab65c13f94
  2. 2mo ago First seen · 58 lines · 1,007 tokens per session scan A 2252def186a8

Subscribe to this mod's changes

ml-intern AGENTS.md is an instructions file published in the GitHub repository huggingface/ml-intern (10,788 stars, last pushed 15d ago), licensed Apache-2.0. It adds 1,040 tokens to every session, about $0.0042 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

ml-intern AGENTS.md compared with instructions from other repositories

ml-intern AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ml-intern AGENTS.mdhuggingface/ml-internInstructions file11k15d agoApache-2.0A1,040Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode