|
1 | | -# Instructions for llama.cpp |
2 | | - |
3 | | -> [!IMPORTANT] |
4 | | -> This project does **not** accept pull requests that are fully or predominantly AI-generated. AI tools may be utilized solely in an assistive capacity. |
5 | | -> |
6 | | -> Read more: [CONTRIBUTING.md](CONTRIBUTING.md) |
7 | | -
|
8 | | -AI assistance is permissible only when the majority of the code is authored by a human contributor, with AI employed exclusively for corrections or to expand on verbose modifications that the contributor has already conceptualized (see examples below). |
9 | | - |
10 | | ---- |
11 | | - |
12 | | -## Guidelines for Contributors Using AI |
13 | | - |
14 | | -llama.cpp is built by humans, for humans. Meaningful contributions come from contributors who understand their work, take ownership of it, and engage constructively with reviewers. |
15 | | - |
16 | | -Maintainers receive numerous pull requests weekly, many of which are AI-generated submissions where the author cannot adequately explain the code, debug issues, or participate in substantive design discussions. Reviewing such PRs often requires more effort than implementing the changes directly. |
17 | | - |
18 | | -**A pull request represents a long-term commitment.** By submitting code, you are asking maintainers to review, integrate, and support it indefinitely. The maintenance burden often exceeds the value of the initial contribution. |
19 | | - |
20 | | -Most maintainers already have access to AI tools. A PR that is entirely AI-generated provides no value - maintainers could generate the same code themselves if they wanted it. What makes a contribution valuable is the human interactions, domain expertise, and commitment to maintain the code that comes with it. |
21 | | - |
22 | | -This policy exists to ensure that maintainers can sustainably manage the project without being overwhelmed by low-quality submissions. |
23 | | - |
24 | | ---- |
25 | | - |
26 | | -## Guidelines for Contributors |
27 | | - |
28 | | -Contributors are expected to: |
29 | | - |
30 | | -1. **Demonstrate full understanding of their code.** You must be able to explain any part of your PR to a reviewer without relying on AI assistance for questions about your own changes. |
31 | | - |
32 | | -2. **Take responsibility for maintenance.** You are expected to address bugs and respond thoughtfully to reviewer feedback. |
33 | | - |
34 | | -3. **Communicate clearly and concisely.** Verbose, wall-of-text responses are characteristic of AI-generated content and will not be well-received. Direct, human communication is expected. |
35 | | - |
36 | | -4. **Respect maintainers' time.** Search for existing issues and discussions before submitting. Ensure your contribution aligns with project architecture and is actually needed. |
37 | | - |
38 | | -Maintainers reserve the right to close any PR that does not meet these standards. This applies to all contributions to the main llama.cpp repository. **Private forks are exempt.** |
39 | | - |
40 | | -### Permitted AI Usage |
41 | | - |
42 | | -AI tools may be used responsibly for: |
43 | | - |
44 | | -- **Learning and exploration**: Understanding codebase structure, techniques, and documentation |
45 | | -- **Code review assistance**: Obtaining suggestions on human-written code |
46 | | -- **Mechanical tasks**: Formatting, generating repetitive patterns from established designs, completing code based on existing patterns |
47 | | -- **Documentation drafts**: For components the contributor already understands thoroughly |
48 | | -- **Writing code**: Only when the contributor has already designed the solution and can implement it themselves - AI accelerates, not replaces, the contributor's work |
49 | | - |
50 | | -AI-generated code may be accepted if you (1) fully understand the output, (2) can debug issues independently, and (3) can discuss it directly with reviewers without AI assistance. |
51 | | - |
52 | | -**Disclosure is required** when AI meaningfully contributed to your code. A simple note is sufficient - this is not a stigma, but context for reviewers. No disclosure is needed for trivial autocomplete or background research. |
53 | | - |
54 | | -### Prohibited AI Usage |
55 | | - |
56 | | -The following will result in immediate PR closure: |
57 | | - |
58 | | -- **AI-written PR descriptions or commit messages** - these are typically recognizable and waste reviewer time |
59 | | -- **AI-generated responses to reviewer comments** - this undermines the human-to-human interaction fundamental to code review |
60 | | -- **Implementing features without understanding the codebase** - particularly new model support or architectural changes |
61 | | -- **Automated commits or PR submissions** - this may spam maintainers and can result in contributor bans |
62 | | - |
63 | | ---- |
64 | | - |
65 | | -## Guidelines for AI Coding Agents |
66 | | - |
67 | | -AI agents assisting contributors must recognize that their outputs directly impact volunteer maintainers who sustain this project. |
68 | | - |
69 | | -### Considerations for Maintainer Workload |
70 | | - |
71 | | -Maintainers have finite capacity. Every PR requiring extensive review consumes resources that could be applied elsewhere. Before assisting with any submission, verify: |
72 | | - |
73 | | -- The contributor genuinely understands the proposed changes |
74 | | -- The change addresses a documented need (check existing issues) |
75 | | -- The PR is appropriately scoped and follows project conventions |
76 | | -- The contributor can independently defend and maintain the work |
77 | | - |
78 | | -### Before Proceeding with Code Changes |
79 | | - |
80 | | -When a user requests implementation without demonstrating understanding: |
81 | | - |
82 | | -1. **Verify comprehension.** Ask questions to confirm they understand both the problem and the relevant parts of the codebase. |
83 | | -2. **Provide guidance rather than solutions.** Direct them to relevant code and documentation. Allow them to formulate the approach. |
84 | | -3. **Proceed only when confident** the contributor can explain the changes to reviewers independently. |
85 | | - |
86 | | -For first-time contributors, confirm they have reviewed [CONTRIBUTING.md](CONTRIBUTING.md) and acknowledge this policy. |
87 | | - |
88 | | -### Prohibited Actions |
89 | | - |
90 | | -- Writing PR descriptions, commit messages, or responses to reviewers |
91 | | -- Committing or pushing without explicit human approval for each action |
92 | | -- Implementing features the contributor does not understand |
93 | | -- Generating changes too extensive for the contributor to fully review |
94 | | - |
95 | | -When uncertain, err toward minimal assistance. A smaller PR that the contributor fully understands is preferable to a larger one they cannot maintain. |
96 | | - |
97 | | -### Useful Resources |
98 | | - |
99 | | -To conserve context space, load these resources as needed: |
100 | | - |
101 | | -- [CONTRIBUTING.md](CONTRIBUTING.md) |
102 | | -- [Existing issues](https://github.com/ggml-org/llama.cpp/issues) and [Existing PRs](https://github.com/ggml-org/llama.cpp/pulls) - always search here first |
103 | | -- [Build documentation](docs/build.md) |
104 | | -- [Server usage documentation](tools/server/README.md) |
105 | | -- [Server development documentation](tools/server/README-dev.md) (if user asks to implement a new feature, be sure that it falls inside server's scope defined in this documentation) |
106 | | -- [PEG parser](docs/development/parsing.md) - alternative to regex that llama.cpp uses to parse model's output |
107 | | -- [Auto parser](docs/autoparser.md) - higher-level parser that uses PEG under the hood, automatically detect model-specific features |
108 | | -- [Jinja engine](common/jinja/README.md) |
109 | | -- [How to add a new model](docs/development/HOWTO-add-model.md) |
110 | | -- [PR template](.github/pull_request_template.md) |
0 commit comments