Skip to content

Commit 5ba123b

Browse files
authored
docs: settings and configuration (#1095)
Co-authored-by: jayhack <2548876+jayhack@users.noreply.github.com>
1 parent b1fe0bf commit 5ba123b

File tree

6 files changed

+182
-0
lines changed

6 files changed

+182
-0
lines changed

docs/docs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
"sandboxes/environment-variables",
4545
"sandboxes/web-preview"
4646
]
47+
},
48+
{
49+
"group": "Settings",
50+
"pages": ["settings/repo-rules", "settings/model-configuration"]
4751
}
4852
]
4953
},

docs/images/llm-configuration.png

144 KB
Loading

docs/images/repo-rules.png

131 KB
Loading

docs/settings/model-configuration.mdx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "LLM Configuration"
3+
sidebarTitle: "Model Config"
4+
icon: "brain-circuit"
5+
---
6+
7+
Codegen offers flexibility in choosing the Large Language Model (LLM) that powers your agent, allowing you to select from various providers and specific models. You can also configure custom API keys and base URLs if you have specific arrangements or need to use self-hosted models.
8+
9+
## Accessing LLM Configuration
10+
11+
LLM Configuration settings are applied globally for your entire organization. You can access and modify these settings by navigating to:
12+
13+
[**codegen.com/settings/model**](https://codegen.com/settings/model)
14+
15+
This central location ensures that all agents operating under your organization adhere to the selected LLM provider and model, unless specific per-repository or per-agent overrides are explicitly configured (if supported by your plan).
16+
17+
<Frame caption="LLM Configuration UI at codegen.com/settings/model">
18+
<img src="/images/llm-configuration.png" alt="LLM Configuration UI" />
19+
</Frame>
20+
21+
As shown in the UI, you can generally configure the following:
22+
23+
- **LLM Provider:** Select the primary LLM provider you wish to use. Codegen supports major providers such as:
24+
- Anthropic
25+
- OpenAI
26+
- Google (Gemini)
27+
- **LLM Model:** Once a provider is selected, you can choose a specific model from that provider's offerings (e.g., Claude 3.7, GPT-4, Gemini Pro).
28+
29+
## Model Recommendation
30+
31+
<Warning>
32+
While Codegen provides access to a variety of models for experimentation and
33+
specific use cases, **we highly encourage the use of Anthropic's Claude 3.7
34+
(Haiku)**. Our internal testing and prompt engineering are heavily optimized
35+
for Claude 3.7, and it consistently delivers the best performance,
36+
reliability, and cost-effectiveness for most software engineering tasks
37+
undertaken by Codegen agents. Other models are made available primarily for
38+
users who are curious or have unique, pre-existing workflows.
39+
</Warning>
40+
41+
## Custom API Keys and Base URLs
42+
43+
For advanced users or those with specific enterprise agreements with LLM providers, Codegen may allow you to use your own API keys and, in some cases, custom base URLs (e.g., for Azure OpenAI deployments or other proxy/gateway services).
44+
45+
- **Custom API Key:** If you provide your own API key, usage will be billed to your account with the respective LLM provider.
46+
- **Custom Base URL:** This allows Codegen to route LLM requests through a different endpoint than the provider's default API.
47+
48+
<Tip>
49+
Using the default Codegen-managed LLM configuration (especially with Claude
50+
3.7) is recommended for most users to ensure optimal performance and to
51+
benefit from our continuous prompt improvements.
52+
</Tip>
53+
54+
<Note>
55+
The availability of specific models, providers, and custom configuration
56+
options may vary based on your Codegen plan and the current platform
57+
capabilities.
58+
</Note>

docs/settings/repo-rules.mdx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: "Repository Rules"
3+
sidebarTitle: "Repo Rules"
4+
icon: "shield-check"
5+
---
6+
7+
Repository Rules in Codegen act as a persistent set of instructions or a "system prompt" for the AI agent whenever it operates on a specific repository. These rules guide the agent's behavior by enforcing coding standards and repository-specific conventions through automated reminders to the language model (LLM) during each task.
8+
9+
<Frame caption="Update repo rules at codegen.com/repos">
10+
<img src="/images/repo-rules.png" />
11+
</Frame>
12+
13+
## How Repository Rules Work
14+
15+
When an agent is assigned a task on a repository with defined rules, those rules are automatically prepended or made available to the LLM as part of its context. This means the agent "sees" these rules alongside the actual task or prompt it receives.
16+
17+
For example, if you have a rule like "Always use tabs for indentation," the agent will be reminded of this preference before it starts writing or modifying code in that repository.
18+
19+
## Accessing and Configuring Repository Rules
20+
21+
You can typically find and configure Repository Rules within the settings page for each specific repository in the Codegen web UI.
22+
23+
1. Navigate to [codegen.com/repos](https://codegen.com/repos).
24+
2. Select the repository for which you want to set rules.
25+
3. Look for a section titled "Repository rules" or similar in the repository's settings.
26+
27+
<Frame caption="Update repo rules at codegen.com/repos">
28+
<img src="/images/repo-rules.png" />
29+
</Frame>
30+
31+
In the text area provided (as shown in the image), you can specify any rules you want the agent to follow for this repository. Click "Save" to apply them.
32+
33+
## Common Use Cases and Examples
34+
35+
Repository rules are flexible and can be used for various purposes:
36+
37+
- **Enforcing Linting/Formatting:**
38+
- "Remember to run the linter with `npm run lint` before committing."
39+
- "Ensure all Python code follows PEP 8 guidelines. Use `black` for formatting."
40+
- **Specifying Commit Message Conventions:**
41+
- "All commit messages must follow the Conventional Commits specification."
42+
- "Prefix commit messages with the related Linear issue ID (e.g., `ENG-123: ...`)."
43+
- **Highlighting Project-Specific Information:**
44+
- "This repository uses TypeScript. All new backend code should be in the `/server/src` directory."
45+
- "Avoid using deprecated function `old_function()`. Use `new_function()` instead."
46+
- **Code Style Preferences:**
47+
- "Don't write super long strings, as this will break pre-commit. Do triple-quoted strings with newlines, non-indented, instead!" (As seen in your example image)
48+
- "Prefer functional components over class components in React."
49+
- **Reminders for Testing:**
50+
- "Ensure all new features have corresponding unit tests."
51+
- "Run integration tests with `npm run test:integration` after significant changes."
52+
53+
<Tip>
54+
Keep your repository rules concise and clear. Overly complex or numerous rules
55+
might confuse the agent or lead to suboptimal performance. Focus on the most
56+
critical guidelines for each repository.
57+
</Tip>
58+
59+
<Note>
60+
Repository Rules are applied *in addition* to any global prompting strategies
61+
or agent capabilities. They provide a repository-specific layer of
62+
instruction.
63+
</Note>{" "}

docs/settings/repo-rules.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Repository Rules"
3+
sidebarTitle: "Repo Rules"
4+
icon: "shield-check"
5+
---
6+
7+
Repository Rules in Codegen act as a persistent set of instructions or a "system prompt" for the AI agent whenever it operates on a specific repository. These rules are shown to the language model (LLM) every time it performs a task related to that repository, ensuring that certain guidelines, preferences, or constraints are consistently followed.
8+
9+
This feature is powerful for guiding the agent's behavior, enforcing coding standards, or reminding it of repository-specific conventions.
10+
11+
## How Repository Rules Work
12+
13+
When an agent is assigned a task on a repository with defined rules, those rules are automatically prepended or made available to the LLM as part of its context. This means the agent "sees" these rules alongside the actual task or prompt it receives.
14+
15+
For example, if you have a rule like "Always use tabs for indentation," the agent will be reminded of this preference before it starts writing or modifying code in that repository.
16+
17+
## Accessing and Configuring Repository Rules
18+
19+
You can typically find and configure Repository Rules within the settings page for each specific repository in the Codegen web UI.
20+
21+
1. Navigate to [codegen.com/repos](https://codegen.com/repos).
22+
2. Select the repository for which you want to set rules.
23+
3. Look for a section titled "Repository rules" or similar in the repository's settings.
24+
25+
<Frame caption="Configuring Repository Rules in the UI">
26+
<img src="/images/repo-rules-ui.png" alt="Repository Rules UI" />
27+
</Frame>
28+
29+
In the text area provided (as shown in the image), you can specify any rules you want the agent to follow for this repository. Click "Save" to apply them.
30+
31+
## Common Use Cases and Examples
32+
33+
Repository rules are flexible and can be used for various purposes:
34+
35+
- **Enforcing Linting/Formatting:**
36+
- "Remember to run the linter with `npm run lint` before committing."
37+
- "Ensure all Python code follows PEP 8 guidelines. Use `black` for formatting."
38+
- **Specifying Commit Message Conventions:**
39+
- "All commit messages must follow the Conventional Commits specification."
40+
- "Prefix commit messages with the related Linear issue ID (e.g., `ENG-123: ...`)."
41+
- **Highlighting Project-Specific Information:**
42+
- "This repository uses TypeScript. All new backend code should be in the `/server/src` directory."
43+
- "Avoid using deprecated function `old_function()`. Use `new_function()` instead."
44+
- **Code Style Preferences:**
45+
- "Don't write super long strings, as this will break pre-commit. Do triple-quoted strings with newlines, non-indented, instead!" (As seen in your example image)
46+
- "Prefer functional components over class components in React."
47+
- **Reminders for Testing:**
48+
- "Ensure all new features have corresponding unit tests."
49+
- "Run integration tests with `npm run test:integration` after significant changes."
50+
51+
<Tip>
52+
Keep your repository rules concise and clear. Overly complex or numerous rules might confuse the agent or lead to suboptimal performance. Focus on the most critical guidelines for each repository.
53+
</Tip>
54+
55+
<Note>
56+
Repository Rules are applied *in addition* to any global prompting strategies or agent capabilities. They provide a repository-specific layer of instruction.
57+
</Note>

0 commit comments

Comments
 (0)