Groq Cloud Integration
Learn how to connect Groq's high-speed LPU inference engine to ScanDrix for sub-second code reviews.
Groq Cloud provides ultra-fast LLM inference using its custom Language Processing Units (LPUs) with OpenAI-compatible APIs. Combining Groq with ScanDrix's Tree-sitter AST engine gives engineering teams deep semantic code reviews with virtually zero waiting time.
Recommended models
We recommend high-context coding and reasoning models with strong instruction-following capabilities:
| Model | Context Window | Speed | Best For |
|---|---|---|---|
llama-3.3-70b-versatile recommended | 128k tokens | 300+ tps | Default code reviews & taint path tracing |
deepseek-r1-distill-llama-70b | 128k tokens | 280+ tps | Complex security invariants & architecture verification |
llama-3.1-8b-instant | 128k tokens | 750+ tps | Rapid syntax checks & commit message linting |
For the most up-to-date model identifiers and context limits, consult the Groq Models documentation.
Creating an API Key
A verified Groq Cloud account is required to generate API credentials.
- Navigate to the Groq Console.
- Sign in or create an account.
- Select API Keys in the left sidebar navigation.
- Click Create API Key, label it
scandrix-code-review, and copy the secret key (gsk_...).
Configuration options
You can configure Groq either in the cloud dashboard, in repository configuration, or in self-hosted backend environment variables.
Option 1: Via the ScanDrix Dashboard (Recommended for SaaS)
- Open the ScanDrix dashboard and navigate to Settings → AI Providers.
- Click Add Provider and select Groq.
- Paste your Groq API Key (
gsk_...). - Select
llama-3.3-70b-versatileas your primary review model. - Click Test Connection to send a synthetic health ping.
Option 2: Via Repository Config (.scandrix.yaml)
To enforce Groq as the review engine for a specific repository:
# .scandrix.yaml
version: 1
ai:
provider: groq
endpoint: "https://api.groq.com/openai/v1"
model: "llama-3.3-70b-versatile"
api_key: "env:GROQ_API_KEY"
temperature: 0.1
max_tokens: 4096
review:
severity_threshold: warning
patch_suggestions: true
Option 3: Via Self-Hosted Backend (.env)
If deploying the self-hosted ScanDrix Go backend, configure your environment file:
# ScanDrix Core Service Configuration
PORT=8080
SCANDRIX_API_URL=https://api.scandrix.yourdomain.com
SCANDRIX_WEB_URL=https://scandrix.yourdomain.com
# Database Connection (PostgreSQL 16+)
DATABASE_URL=postgres://scandrix:yourpassword@postgres:5432/scandrix?sslmode=require
# Groq LLM Configuration
SCANDRIX_LLM_PROVIDER=groq
OPENAI_BASE_URL=https://api.groq.com/openai/v1
OPENAI_API_KEY=gsk_your_groq_api_key_here
SCANDRIX_DEFAULT_MODEL=llama-3.3-70b-versatile
# Webhook Secret for HMAC verification
GITHUB_WEBHOOK_SECRET=your_github_webhook_secret
Production Reverse Proxy Setup
For self-hosted instances with external Git webhooks, configure Nginx to forward requests to the Next.js frontend (port 3000) and the Go backend API (port 8080):
# ScanDrix Web Dashboard (port 3000)
server {
listen 443 ssl http2;
server_name scandrix.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/scandrix.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/scandrix.yourdomain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# ScanDrix Go API & Webhooks (port 8080)
server {
listen 443 ssl http2;
server_name api.scandrix.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/api.scandrix.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.scandrix.yourdomain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Verifying Groq integration
Verify that Groq is responding to pull request analysis requests:
# Test local review via CLI
scandrix review --staged
# Or inspect worker container logs
docker logs scandrix-worker | grep -i "groq"
Expected log output:
[INFO] provider=groq model=llama-3.3-70b-versatile latency=840ms tokens=1420 status=200