Use Case · Code Assistant

AI Code Assistant: From IDE Plugin to Full CI/CD Integration

Code completion inline in the IDE, async review on every PR, generated tests on demand, docstring + changelog synthesis and secret scanning — the whole codebase surface, on one OpenAI-compatible API.

Updated Aug 16, 2026 · Start building free →

Scenario overview

The "AI pair programmer" has three entry points in a team: in the IDE (completion + refactor), on the PR (review + security), and in CI (test generation + doc deployment). The same LLM does all three jobs in different roles — fast, latency-sensitive completion via small models in the IDE; large-context review on PR diff; reasoning models for hard security triage.

IDE completionPR reviewTest generationDocstring synthesisSecurity scanCI/CD integrationTeam workflow

Architecture (text version)

1
Index the repoBuild an LSP-grounded symbol index. Embed function bodies with text-embedding-3-large into a vector store keyed by file+symbol+line — refreshed on commit.
2
IDE completiongpt-5-mini / qwen3-7b stream completions (<100 ms). Context = current file + imports + top-k similar symbols from the index.
3
PR reviewLarge-context model (claude-opus-4 or gemini-2.5-pro, 200k context) reviews whole diff, comments inline via the GitHub App, cites other repo patterns to enforce consistency.
4
Generate testsOn demand ("generate tests for this function"), model writes pytest / vitest scaffolds with parameterised cases. Run in sandbox to keep only passing tests.
5
Security scanReasoning model triages candidate issues flagged by a static analyser: confirms / dismisses with explanation, opens a ticket for true positives.
6
Docs deployCI step regenerates docstrings + changelog entries from the commit log diff. Pushed to /docs site on green build.

Code & configuration

IDE-style streaming completion

curl -N https://api.dr-ai.top/v1/chat/completions \
  -H "Authorization: Bearer sk-***" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-mini",
    "stream": true,
    "max_tokens": 60,
    "messages": [
      {"role": "system", "content": "Complete the code. No prose. Match surrounding style."},
      {"role": "user", "content": "def parse_invoice(text):\n    \"\"\"Extract structured data from an invoice OCR string.\"\"\"\n    # TODO:"}
    ]
  }'

GitHub PR review action

name: DrAI PR Review
on: { pull_request: { types: [opened, synchronize] } }
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - run: |
          curl -s https://api.github.com/repos/${GR}/pulls/${PR}/files \
            | jq '[.[] | {filename, patch}]' > diff.json
          curl -X POST https://api.dr-ai.top/v1/chat/completions \
            -H "Authorization: Bearer ${{ secrets.DRAI_KEY }}" \
            -d @payload.json > review.json
          # post review.json as inline PR comments via /repos/{o}/{r}/pulls/{n}/comments
        env:
          GR: ${{ github.repository }}
          PR: ${{ github.event.pull_request.number }}
          DRAI_KEY: ${{ secrets.DRAI_KEY }}

ROI data

MetricWithout AIWith code assistant
PRs / engineer / week2.14.8
Time to first review comment~7 hrs< 30 sec
Bugs reaching prod (per 1k LOC)3.41.1
Test coverage on new code42%88%
Estimated dev velocity (DORA)baseline+58%

A 20-engineer team saves an estimated ~8 hours/engineer/week from completion + auto-review + test generation. Even at a blended $120/hr cost, that is roughly $77k/month reclaimed — for a DrAI subscription cost of ~$1,500/month.

Wire AI into your dev workflow

From inline IDE completion to automated CI reviews — one API, all models, flat cost.

Get Started — freeRead the Quickstart
🌐 English