huggingface/Serge
Review pull requests with any OpenAI-compatible LLM and post inline comments on the diff.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| llm_api_key | Bearer token for the chat-completion endpoint. | yes | — |
| llm_api_base | Base URL of an OpenAI-compatible service. Accepts either https://host or https://host/v1. | no | https://api.openai.com/v1 |
| llm_model | Model identifier to pass in the chat-completion request. If omitted, the action auto-discovers the first model from {llm_api_base}/models. | no | — |
| llm_bill_to | Optional org slug for routing inference billing (sent as the X-HF-Bill-To header). Required when using a Hugging Face token whose Inference Providers permission is scoped to an organization rather than the user. | no | — |
| llm_max_tokens | Maximum completion tokens requested from the LLM. Bump for reasoning models (e.g. Kimi-K2) that spend tokens on reasoning before emitting JSON. | no | 4096 |
| llm_stream | Set to "true" to consume the chat-completion response as a streaming SSE feed. Off by default; useful for endpoints/proxies that drop long-running non-streaming connections. | no | false |
| mention_trigger | Phrase that triggers reviews. Must be the first word of the comment. | no | @askserge |
| review_event | One of COMMENT, REQUEST_CHANGES, APPROVE (fallback if the LLM omits one). | no | COMMENT |
| max_diff_chars | Maximum diff size (characters) sent to the LLM. | no | 200000 |
| review_rules_path | Path to repo-specific review rules, read from the default branch. | no | .ai/review-rules.md |
| helper_tools_path | Path to a repo-specific helper-tools JSON file, read from the default branch. Helpers can expose tightly scoped CLI commands to the reviewer when a local PR checkout is available. | no | .ai/review-tools.json |
| default_review_rules | Fallback rules used when the repo has no review-rules file. | no | Apply general Python correctness and security standards. |
| context_script_path | Path to an executable script in the target repo that, given the PR title/body and modified-file list as JSON on stdin, prints additional context to inject into the reviewer prompt. Skipped silently if the file is missing or not executable. | no | .ai/context-script |
| context_script_timeout | Seconds to wait for the context script before giving up. | no | 30 |
| repo_checkout_path | Path to a local checkout of the PR head ref. When set, the reviewer exposes read-only browse tools (read_file/list_dir/grep) rooted here so the LLM can fetch context beyond the diff. Defaults to GITHUB_WORKSPACE; set to an empty string to disable tools entirely. The caller workflow is responsible for checking out the PR head ref (e.g. with `actions/checkout@v4` and `ref: refs/pull/<number>/head`) before invoking this action. | no | ${{ github.workspace }} |
| tool_max_iterations | Maximum number of tool-calling rounds before forcing the model to produce a final review. Each iteration is a separate LLM call. | no | 8 |
| headroom_compress | Set to "true" to compress context with headroom-ai before each LLM call (cuts tokens on tool outputs and older turns). Requires the headroom-ai package; install reviewbot with the [headroom] extra. No-op if the package is missing. | no | false |
| headroom_target_ratio | Optional headroom keep-ratio for text compression (e.g. 0.5 keeps ~50%). Leave empty to let headroom decide. | no | — |
| headroom_compress_user_messages | Set to "true" to also compress user messages (the annotated diff). Off by default so cited line numbers stay intact. | no | false |
| headroom_compress_system_messages | Set to "false" to leave system messages uncompressed. On by default. | no | true |
| headroom_protect_recent | Number of most-recent messages never compressed. | no | 4 |
| headroom_min_tokens | Skip compressing messages shorter than this many tokens. | no | 250 |
| headroom_kompress_model | Kompress model id for ML compression, or "disabled" to skip it. Leave empty for the headroom default. | no | — |
| headroom_model_limit | Model context window (tokens) used for sizing. | no | 200000 |
| staging | Set to "true" to mark this as a staging deployment. Published reviews then carry a note saying they were posted from staging. | no | false |
| github_token | Token with pull-requests:write. Defaults to the job token. | no | ${{ github.token }} |
| python_version | Python version to set up for running the reviewer. | no | 3.12 |
Outputs
no outputs