This guide explains how to configure Qodo PR-Agent to use Abacus AI's RouteLLM API for automated code reviews in GitLab merge requests.
Qodo PR-Agent uses litellm for LLM routing. While Abacus AI provides an OpenAI-compatible API, configuring it through litellm's openai provider doesn't work correctly because:
- The
openaiprovider prependsopenai/to model names (e.g.,openai/gpt-5.1-codex-max) - Abacus AI rejects prefixed model names with "Invalid model" errors
- The
openai__api_basesetting doesn't properly override the default OpenAI endpoint
The hosted_vllm provider in litellm is designed for OpenAI-compatible endpoints and:
- Reads
HOSTED_VLLM_API_BASEandHOSTED_VLLM_API_KEYenvironment variables - Strips the
hosted_vllm/prefix before sending requests to the API - Works seamlessly with Abacus AI's RouteLLM endpoint
- GitLab Personal Access Token with
apiscope - Abacus AI API Key from abacus.ai
Add these as CI/CD variables in GitLab (Settings > CI/CD > Variables):
GITLAB_PERSONAL_ACCESS_TOKENABACUS_API_KEY
Add this job to your .gitlab-ci.yml:
stages:
- review
qodo_review:
stage: review
image:
name: codiumai/pr-agent:latest
entrypoint: [""] # Required: Override default entrypoint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script:
- cd /app
- echo "Running Qodo PR-Agent review..."
# Construct MR URL
- export MR_URL="$CI_MERGE_REQUEST_PROJECT_URL/merge_requests/$CI_MERGE_REQUEST_IID"
# Configure GitLab provider
- export config__git_provider="gitlab"
- export gitlab__url="$CI_SERVER_PROTOCOL://$CI_SERVER_HOST"
- export gitlab__PERSONAL_ACCESS_TOKEN="$GITLAB_PERSONAL_ACCESS_TOKEN"
# Configure Abacus AI via hosted_vllm provider
- export HOSTED_VLLM_API_BASE="https://routellm.abacus.ai/v1"
- export HOSTED_VLLM_API_KEY="$ABACUS_API_KEY"
- export config__model="hosted_vllm/gpt-5.1-codex-max"
- export config__custom_model_max_tokens="272000" # Required for unknown models
- export config__fallback_models="[]" # Disable fallbacks
# PR-Agent settings (optional)
- export pr_reviewer__require_score_review="false"
- export pr_reviewer__require_tests_review="true"
- export pr_reviewer__require_security_review="true"
- export pr_reviewer__num_code_suggestions="4"
# Run review
- python -m pr_agent.cli --pr_url="$MR_URL" review
allow_failure: true # Don't block MR on review failures| Setting | Purpose |
|---|---|
entrypoint: [""] |
Overrides the container's default CLI entrypoint to allow running shell commands |
HOSTED_VLLM_API_BASE |
Abacus AI's OpenAI-compatible endpoint |
HOSTED_VLLM_API_KEY |
Your Abacus AI API key |
config__model |
Model with hosted_vllm/ prefix (stripped before API call) |
config__custom_model_max_tokens |
Token limit for models not in litellm's default list |
config__fallback_models="[]" |
Prevents fallback to default models like o4-mini |
Some models available on Abacus AI RouteLLM:
| Model | Context Window |
|---|---|
gpt-5.1-codex-max |
272k tokens |
gpt-5.2-codex |
128k tokens |
gpt-5.1-codex |
128k tokens |
Check Abacus AI documentation for the latest model list.
You're using the wrong provider. Switch from openai__* settings to HOSTED_VLLM_* environment variables.
Add config__custom_model_max_tokens with the model's context window size.
Ensure HOSTED_VLLM_API_BASE is set to https://routellm.abacus.ai/v1 (with /v1).
Set config__fallback_models="[]" to disable fallbacks to models you don't have access to.
The job logs should show:
Reviewing PR: https://gitlab.com/your/repo/merge_requests/1 ...
Tokens: XXXXX, total tokens over limit: 32000, pruning diff.
Setting review labels: ['Review effort X/5']
Persistent mode - updating comment ... to latest review message
The openai provider in litellm:
- Doesn't strip model prefixes before API calls
- Has hardcoded logic expecting
api.openai.com - Doesn't properly read
openai__api_basefor custom endpoints
The hosted_vllm provider was specifically designed for self-hosted or third-party OpenAI-compatible endpoints.