Hugging Face Transformers is a framework that defines machine-learning models for text, vision, audio, video, and multimodal data, supporting both training and inference. Developers use it to work with pretrained models and connect them to training frameworks, inference engines, and other modeling libraries. The catalogue add-ons provide instructions and a skill for working with Transformers.
Borrowing it
Nothing to install: this file belongs to huggingface/transformers. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/huggingface/transformers/main/.github/copilot-instructions.mdgit clone --depth 1 https://github.com/huggingface/transformersWrote 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.
[](https://agentmods.dev/instructions/huggingface/transformers/copilot-instructions)<a href="https://agentmods.dev/instructions/huggingface/transformers/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/huggingface/transformers/copilot-instructions/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.
<a href="https://agentmods.dev/instructions/huggingface/transformers/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/huggingface/transformers/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00773 | $0.00773 |
| Opus 5.5 | $0.00309 | $0.00309 |
| Sonnet 5.5 | $0.00155 | $0.00155 |
| Haiku 4.5 | $0.00077 | $0.00077 |
Grade A, and why
transformers copilot-instructions.md scanned grade A with 0 findings 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 2mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.
copilot-instructions.md Guide for Hugging Face Transformers
This copilot-instructions.md file provides guidance for code agents working with this codebase.
Core Project Structure
/src/transformers: This contains the core source code for the library/models: Code for individual models. Models inherit from base classes in the root/src/transformersdirectory.
/tests: This contains the core test classes for the library. These are usually inherited rather than directly run./models: Tests for individual models. Model tests inherit from common tests in the root/testsdirectory.
/docs: This contains the documentation for the library, including guides, tutorials, and API references.
Coding Conventions for Hugging Face Transformers
- PRs should be as brief as possible. Bugfix PRs in particular can often be only one or two lines long, and do not need large comments, docstrings or new functions in this case. Aim to minimize the size of the diff.
- When writing tests, they should be added to an existing file. The only exception is for PRs to add a new model, when a new test directory should be created for that model.
- Code style is enforced in the CI. You can install the style tools with
pip install -e .[quality]. You can then runmake fixupto apply style and consistency fixes to your code.
Copying and inheritance
Many models in the codebase have similar code, but it is not shared by inheritance because we want each model file to be self-contained. We use two mechanisms to keep this code in sync:
- "Copied from" syntax. Functions or entire classes can have a comment at the top like this:
# Copied from transformers.models.llama.modeling_llama.rotate_halfor# Copied from transformers.models.t5.modeling_t5.T5LayerNorm with T5->MT5These comments are actively checked by the style tools, and copies will automatically be updated when the base code is updated. If you need to update a copied function, you should either update the base function and usemake fixupto propagate the change to all copies, or simply remove the# Copied fromcomment if that is inappropriate. - "Modular" files. These files briefly define models by composing them using inheritance from other models. They are not meant to be used directly. Instead, the style tools
automatically generate a complete modeling file, like
modeling_bert.py, from the modular file likemodular_bert.py. If a model has a modular file, the modeling file should never be edited directly! Instead, changes should be made in the modular file, and then you should runmake fixupto update the modeling file automatically.
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.
- 2mo ago First seen · 40 lines · 773 tokens per session scan A 51d12faef435
transformers copilot-instructions.md is an instructions file published in the GitHub repository huggingface/transformers (168,576 stars, last pushed today), licensed Apache-2.0. It adds 773 tokens to every session, about $0.0031 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
transformers copilot-instructions.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| transformers copilot-instructions.mdhuggingface/transformers | Instructions file | 169k | today | Apache-2.0 | A | 773 | GitHub Copilot |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |