AI features
P4 Code Review includes AI-powered features that help users understand code changes, improve review quality, and reduce the time spent reviewing complex diffs.
AI features integrate with external AI models and are:
-
Disabled by default.
-
Configured by an administrator.
-
Available to users, administrators, and developers.
AI features at a glance
| Feature | Description |
Documentation |
|---|---|---|
|
Code analysis |
Generates explanations for code diffs. |
|
|
AI Assistant for comments |
Helps create or improve review comments. |
|
|
AI in checklists |
Supports automated checklist validation. |
|
|
API integration |
Enables programmatic AI analysis. |
When AI features are used:
-
Only the file diff or selected code is sent to the AI model.
-
Full files and repositories are not shared.
-
The AI model returns text-based analysis or suggestions.
Supported AI models
P4 Code Review supports integration with multiple AI providers, including:
Quick start: Enable AI features
To start using AI features:
-
Obtain an API key or access to an AI model (For example, OpenAI, Claude, Gemini, or a local model).
-
Enable AI features in P4 Code Review.
-
Go to System Information > Configuration.
-
Click AI Configuration to expand the section.
-
-
Configure the AI model with your API key and other model details.
-
Open a code review and test AI features such as:
-
Request a code analysis on a file diff.
-
Send a comment to your AI model for improvement.
-
For detailed setup instructions, see:
Who can use AI features
Users
-
Use AI to understand code changes.
-
Generate or improve review comments. See AI Assistant for comments.
-
Access AI tools in the file diff and review pages. See Use AI for code analysis.
Administrators
-
Enable AI features. See AI for code analysis.
-
Configure AI models and API keys.
-
Customize prompts and behavior. See AI Assistant for comments.
-
Manage AI configuration using the UI. See Configuration.
-
Configure Checklists items to check code using AI. See Checklists.
Developers (API users)
-
Integrate AI into automated workflows.
-
Generate AI-based code analysis programmatically. See AiAnalysis: AI code analysis.
-
Configure AI features through the API. See Configurations.
-
Manage AI in checklists, see Checklist definitions.