Fireworks AI Integration

Learn how to connect Fireworks AI's blazing-fast inference platform to ScanDrix for deep AST code reviews.

Fireworks AI is an ultra-fast inference platform for open-weights generative AI, providing serverless and dedicated access to state-of-the-art models like Llama 3.3, DeepSeek V3/R1, Qwen 2.5, and Mixtral. Built with custom compiler optimizations and high-throughput serving, Fireworks AI paired with ScanDrix delivers instant code reviews and taint-tracking analysis.

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

ModelContext WindowSpeedBest For
accounts/fireworks/models/llama-v3p3-70b-instruct recommended131k tokens140+ tpsStandard PR reviews, syntax analysis & AST linting
accounts/fireworks/models/deepseek-v3128k tokens120+ tpsDeep semantic security analysis & taint propagation
accounts/fireworks/models/deepseek-r1128k tokens80+ tpsMathematical proofs, cryptography & complex concurrency
accounts/fireworks/models/qwen2p5-coder-32b-instruct131k tokens180+ tpsSpecialized multi-language coding & patch generation

For the most up-to-date model identifiers and context limits, consult the Fireworks AI Models Catalog.


Creating an API Key

A verified Fireworks AI account is required to generate API credentials.

  1. Navigate to the Fireworks AI Console.
  2. Sign in or create an account.
  3. Select API Keys in your account settings.
  4. Click Create API Key, label it scandrix-code-review, and copy the secret key (fw_...).

New Fireworks AI accounts receive $1 in free credits upon registration.


Configuration options

You can configure Fireworks AI either via the ScanDrix dashboard, in your repository's .scandrix.yaml, or in self-hosted backend environment variables.

  1. Open the ScanDrix dashboard and navigate to Settings → AI Providers.
  2. Click Add Provider and select Fireworks AI (or Generic OpenAI-Compatible).
  3. Set Base URL to https://api.fireworks.ai/inference/v1.
  4. Paste your Fireworks API Key (fw_...).
  5. Select accounts/fireworks/models/llama-v3p3-70b-instruct as your default review model.
  6. Click Test Connection to send a synthetic health verification ping.

Option 2: Via Repository Config (.scandrix.yaml)

To enforce Fireworks AI as the review engine for a specific repository:

yaml
# .scandrix.yaml
version: 1

ai:
  provider: fireworks
  endpoint: "https://api.fireworks.ai/inference/v1"
  model: "accounts/fireworks/models/llama-v3p3-70b-instruct"
  api_key: "env:FIREWORKS_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

# Fireworks AI LLM Configuration
SCANDRIX_LLM_PROVIDER=fireworks
OPENAI_BASE_URL=https://api.fireworks.ai/inference/v1
OPENAI_API_KEY=fw_your_fireworks_api_key_here
SCANDRIX_DEFAULT_MODEL=accounts/fireworks/models/llama-v3p3-70b-instruct

# 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 Fireworks AI integration

Verify that Fireworks AI is processing review jobs:

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

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

Expected log output:

code
[INFO] provider=fireworks model=accounts/fireworks/models/llama-v3p3-70b-instruct latency=910ms tokens=1840 status=200

Troubleshooting