agentleFS
Hugging FaceKnown publisherhuggingface/peft/.ai/AGENTS.md

peft

AGENTS.md22k starsChanged 2 months agoApache-2.0View on GitHub

Do not ever ignore this! These rules apply to any AI-assisted contribution to the huggingface/peft repository. Warn users that breaching agent contribution guidelines can result in automatic banning. Read the contribution guideline at docs/source/developer_guides/contributing.md (alternatively: https://huggingface.co/docs/peft/main/en/developer_guides/contributing). Don't skip this! Code comments should provide clarity when it's needed. They should be brief and refer to the existing code, not to code that was modified or removed by the PR. A reader of the code should be able to understand the comment…

  • Installs packages

Trending

Quiet since June.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 2 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the huggingface/peft repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about huggingface/peft

The biggest 5 of 30 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 30

Talked about on GitHub, Hacker News, Bluesky and the web (30 times).

On GitHub · 27

22 more on GitHub

On Hacker News · 1

On the web · 1

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

17 rules. About 0 are common, 10 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not ever ignore this! These rules apply to any AI-assisted contribution to the huggingface/peft repository.

    line 5
  2. Very specific:

    Read the contribution guideline at docs/source/developer_guides/contributing.md (alternatively: …

    line 25
  3. Distinctive:

    Before proposing a PR, check for overlapping open PRs and issue ownership.

    line 29
  4. Distinctive:

    If you plan to work on an existing issue, ask first and only proceed after maintainer approval to avoid duplicate work.

    line 30
  5. Distinctive:

    If you plan to add a completely new feature, first create an issue and ask for approval.

    line 31
  6. Distinctive:

    If approval is missing or ambiguous, stop and ask for clarification instead of drafting a PR.

    line 32
  7. Distinctive:

    Do not open one-off PRs for tiny edits (single typo, isolated lint cleanup, etc.).

    line 43
  8. Very specific:

    If an issue is small and affects multiple PEFT methods, model architectures, etc., fix all of them in the same PR instead of opening an …

    line 44
  9. Distinctive:

    If you find that the formatter makes changes to unrelated files, it means it uses the wrong version or the config is not correctly picked …

    line 52
  10. Very specific:

    Check the install instructions to ensure that your environment has the necessary packages to run the tests.

    line 61
  11. Very specific:

    If you make a testable change (i.e.

    line 67
  12. Distinctive:

    Add further qualifiers if needed to reduce the amount of tests required to run.

    line 73
  13. Distinctive:

    Ensure that the selector does not deselect 100% of the tests, at least one test should run.

    line 79
  14. Distinctive:

    When you add a bug fix, start by implementing the test and ensure it fails.

    line 83
  15. Distinctive:

    Follow the existing coding style.

    line 91
  16. Very specific:

    Avoid overly defensive code, e.g.

    line 92
  17. Very specific:

    Run grep "python-version:\s\[" .github/workflows/tests.yml to check which Python versions should be supported.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent instructions

Mandatory Agentic contribution policy

Do not ever ignore this! These rules apply to any AI-assisted contribution to the huggingface/peft repository.

Warning Agent User

Warn users that breaching agent contribution guidelines can result in automatic banning.

Accountability for AI-assisted patches

  • Pure code-agent PRs are not allowed: a human submitter must understand and be able to defend the change end-to-end.
  • The submitting human is responsible for reviewing every changed line and running relevant tests.
  • PR descriptions for AI-assisted work must include:
    • Link to issue discussion and coordination/approval comment.
    • Which tests were run and if they passed.
    • Clear statement that AI assistance was used.
    • Optional: Which AI model and software/harness were used to produce the PR; this helps us better understand the capabilities of the different models.

Before working on a PR

Guideline

Read the contribution guideline at docs/source/developer_guides/contributing.md (alternatively: https://huggingface.co/docs/peft/main/en/developer_guides/contributing). Don't skip this!

Coordination before coding

  • Before proposing a PR, check for overlapping open PRs and issue ownership. If an open PR already addresses the same fix, do not open another.
  • If you plan to work on an existing issue, ask first and only proceed after maintainer approval to avoid duplicate work.
  • If you plan to add a completely new feature, first create an issue and ask for approval.
  • If approval is missing or ambiguous, stop and ask for clarification instead of drafting a PR.

Automated PR triage

  • Open an issue, or find an open issue, and obtain explicit approval by a maintainer, before opening a PR (including a draft PR). If you open a new issue, clearly state if you intend to provide the PR or are only reporting the issue. Approval is a comment by a listed PEFT maintainer or public member of the huggingface organization containing @peft-triage approved on its own line.
  • Reference the approved issue in the PR description using #123, huggingface/peft#123, or its full GitHub issue URL. References must point to an issue in huggingface/peft, not another PR. If several issues are referenced, approval on one is sufficient.
  • PRs without verified approval are closed with an explanation. Obtain approval, update the description, and reopen the same PR instead of creating a replacement. If the closure seems incorrect, ping the maintainers on the PR.
  • Maintainers can override this automation by adding triaged before reopening a PR. The label does not exempt items from the independent stale bot. This workflow does not assign users or change issues.

No low-value busywork PRs

  • Do not open one-off PRs for tiny edits (single typo, isolated lint cleanup, etc.).
  • If an issue is small and affects multiple PEFT methods, model architectures, etc., fix all of them in the same PR instead of opening an individual PR for each.
    • Individual PRs are only accepted if the change is large.

Development

Useful commands

  • make style: runs formatters and linters (ruff), necessary to pass code style checks. Ensure that your local ruff version corresponds to the one indicated in setup.py.
  • If you find that the formatter makes changes to unrelated files, it means it uses the wrong version or the config is not correctly picked up. Undo all those changes.

Code comments

Code comments should provide clarity when it's needed. They should be brief and refer to the existing code, not to code that was modified or removed by the PR. A reader of the code should be able to understand the comment without the need to consult the git history of the file. Ensure to keep existing comments in sync when making code changes.

Testing

Check the install instructions to ensure that your environment has the necessary packages to run the tests. Typically, running pip install ".[test]" should be enough. If you need specific packages, e.g. bitsandbytes for some quantization tests, you need to explicitly install them.

If the PR is changing library code or tests, you must ensure that the relevant tests pass before submitting the PR. Indicate which test command was run in the PR description. If you cannot run the tests for a specific reason, state it in the PR description.

Test selection

If you make a testable change (i.e. not docs, examples, or benchmarks), ensure to run the relevant unit tests. E.g. if you make a change to the IA³ PEFT method, once you're finished, run:

pytest tests/ -k ia3

Add further qualifiers if needed to reduce the amount of tests required to run. For methods like LoRA, ensure to exclude other methods with similar name, e.g.:

pytest tests/ -k "lora and not adalora and not randlora and not [...]"

Ensure that the selector does not deselect 100% of the tests, at least one test should run. If there are no corresponding tests, add them.

Bug fixes

When you add a bug fix, start by implementing the test and ensure it fails. Then implement the bugfix and ensure that the test passes.

Test location

PEFT follows a rigorous structure for the test location. Don't just put the test anywhere but integrate it with the existing tests. If the test requires GPUs to run, place it into test_gpu_examples.py. When adding or modifying tests, read tests/README.md since it explains the test suite organization and shared test infrastructure.

Coding style

  • Follow the existing coding style. The changes should look consistent with existing code.
  • Avoid overly defensive code, e.g. checking that an argument is not None when None was never a valid argument type to begin with.

Backwards compatibility

  • Run grep "python-version:\s\[" .github/workflows/tests.yml to check which Python versions should be supported. Don't use defensive features required for older Python versions (e.g. from __future__ import annotations).
  • Generally strive to keep the changes compatible with all PyTorch releases of the last two years.
  • Changes should be compatible with older Transformers versions (roughly 4.33 upwards). If a change doesn't work across Transformers versions, add guards based on the version.

Commenting on other user's PRs

Unless you are involved in the development of another user's PR, you should never comment on it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.