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.

We recommend high-context coding and reasoning models with strong instruction-following capabilities:

ModelContext WindowSpeedBest For
llama-3.3-70b-versatile recommended128k tokens300+ tpsDefault code reviews & taint path tracing
deepseek-r1-distill-llama-70b128k tokens280+ tpsComplex security invariants & architecture verification
llama-3.1-8b-instant128k tokens750+ tpsRapid 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.

  1. Navigate to the Groq Console.
  2. Sign in or create an account.
  3. Select API Keys in the left sidebar navigation.
  4. 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.

  1. Open the ScanDrix dashboard and navigate to Settings → AI Providers.
  2. Click Add Provider and select Groq.
  3. Paste your Groq API Key (gsk_...).
  4. Select llama-3.3-70b-versatile as your primary review model.
  5. 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:

yaml
# .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:

env
# 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):

nginx
# 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:

bash
# Test local review via CLI
scandrix review --staged

# Or inspect worker container logs
docker logs scandrix-worker | grep -i "groq"

Expected log output:

code
[INFO] provider=groq model=llama-3.3-70b-versatile latency=840ms tokens=1420 status=200

Troubleshooting