Setting Up Free AI Code Review with GLM and Ollama
A step-by-step guide to running Open Code Review with zero cost using GLM (free cloud) and Ollama (free local). Full L3 deep scan included.
Zero-Cost AI Code Review
One of the most common questions: "Do I need to pay for an API key?" No. Open Code Review supports two completely free providers.
Option 1: GLM (Cloud, Free)
GLM (智谱) offers a free tier that's more than enough for code review.
# 1. Get your free API key at https://open.bigmodel.cn
# 2. Run scan
npx @opencodereview/cli@latest scan ./src \
--level l3 \
--provider glm \
--api-key your-free-glm-key
# 3. Auto-heal
npx @opencodereview/cli@latest heal ./src \
--provider glm \
--api-key your-free-glm-key
Option 2: Ollama (Local, Free)
Run everything locally — no API key, no internet, no data leaving your machine.
# 1. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# 2. Pull a model
ollama pull llama3
# 3. Run OCR
npx @opencodereview/cli@latest scan ./src \
--level l3 \
--provider ollama
Environment Variables
For CI/CD, use environment variables instead of CLI flags:
export OCR_PROVIDER=glm
export OCR_API_KEY=your-free-glm-key
export OCR_MODEL=glm-4
npx @opencodereview/cli@latest scan ./src --level l3
npx @opencodereview/cli@latest heal ./src
Config File
For project-level configuration:
{
"level": "l3",
"provider": "glm",
"apiKey": "your-free-glm-key",
"paths": ["src/**/*.ts"],
"threshold": 70
}
Which Should You Choose?
| GLM | Ollama | |
|---|---|---|
| Setup time | 2 min | 5 min |
| Internet required | Yes | No |
| Data privacy | Cloud-processed | 100% local |
| Model quality | High (GLM-4) | Varies by model |
| Best for | CI/CD pipelines | Privacy-sensitive projects |
Next Steps
Total cost: $0. Total setup time: 5 minutes.
Related Articles
What Are AI Code Hallucinations and Why Traditional Tools Miss Them
AI code assistants like Copilot and Cursor can generate imports for packages that don't exist. Learn what hallucinated packages are, why they're dangerous, and how to detect them.
2026-03-20Detect & Heal: How Self-Healing Code Review Works in CI/CD
Learn how Open Code Review's Detect & Heal workflow auto-fixes AI-generated code issues in your CI/CD pipeline — from scan to commit, zero human intervention.
2026-03-18