Skip to content

DraftLint Detector Gateway

Status: Active shared detector infrastructure Preferred detector: 26: YOLO26l Specialist Ensemble v01 (CPU) Last verified: 2026-07-16

Source And Runtime Identity

  • Variant ID: draftlint-detector-gateway
  • Owner/source of truth: IONOS operational deployment and central model-serving playbook
  • Server root: /opt/cvat-inference
  • Gateway code: /opt/cvat-inference/gateway/app/main.py
  • Operational scripts: /opt/cvat-inference/scripts
  • Remote repository: No Git remote recorded
  • Git status: /opt/cvat-inference is not a Git worktree
  • Public API: https://draftlint-gateway.rapiddraft.ai
  • CVAT: https://cvat.adeelyj.com
  • Runtime: IONOS Docker, Nuclio, and CVAT
  • Not to be confused with: DraftLint Railway Validator, which performs the complete validation workflow

Responsibility

The gateway provides one stable authenticated detector contract for RapidDraft and the DraftLint Railway Validator. It hides changing Nuclio function ports and model container topology from Railway applications.

RapidDraft and the Railway Validator should call the gateway. They should not call individual Nuclio ports, CVAT's internal lambda manager, host.docker.internal, or a model container IP.

CVAT AI Tools is a separate native path: CVAT calls Nuclio through its own lambda integration.

Serving Topology

flowchart LR
    RD["RapidDraft .ai and .io"]
    DV["DraftLint Railway Validator"]
    GW["Detector Gateway"]
    NA["Nuclio API"]
    FN["Functions 15 through 26"]
    CV["CVAT AI Tools"]

    RD -->|"Bearer token and stable HTTPS"| GW
    DV -->|"Bearer token and stable HTTPS"| GW
    GW -->|"discover metadata"| NA
    GW -->|"invoke current host port"| FN
    CV -->|"native lambda manager"| FN

The gateway discovers Nuclio metadata through the Docker host gateway and invokes the currently advertised host-published function port. This exists because Nuclio function containers and the gateway are not guaranteed to share resolvable container DNS after a clean local-platform redeploy.

Public Contract

Endpoint Purpose Authentication
GET /models Return the active detector registry Bearer token
POST /predict/{detector_id} Run one detector against a base64 image Bearer token

The prediction request used by the Railway adapter contains:

{
  "image_base64": "<encoded image>",
  "threshold": 0.2
}

The response contains a predictions array. Consumers normalize labels, confidence, bounding boxes/polygons, and source detector identity into their own review contract.

Active Registry

The authenticated gateway returned 12 detectors on 2026-07-16:

ID Display name Role
15 YOLO26m All-Polygon Seg v1 Earlier all-polygon segmentation
16 YOLO26m Drawing Detect v2 / Job75 General drawing detection
17 YOLO26m Drawing View Seg v2 / Job75 Drawing-view segmentation
18 YOLO26x Drawing View Seg v4 / Job75 Windows AMD-backed drawing-view segmentation
19 Hybrid YOLO26m Detect + m Seg v2 IONOS hybrid
20 Hybrid YOLO26m Detect + x Seg v2 IONOS + Windows AMD hybrid
21 YOLO26m All-Polygon Seg v2 / Job75 Newer all-polygon segmentation
22 YOLO26l Dimensions Seg v01 Specialist dimensions model
23 YOLO26l Feature Control Frame Seg v01 Specialist FCF model
24 YOLO26l Title Block Seg v01 Specialist title-block model
25 YOLO26l Other Multi-class Seg v01 Specialist remaining classes
26 YOLO26l Specialist Ensemble v01 Preferred combined model calling 22 through 25

Both RapidDraft Railway deployments reported default_detector_id=26 and the same 12-model registry when verified.

Port Drift And Why CVAT Can Fail Separately

Nuclio stores status.httpPort metadata. Docker also exposes an actual host port for each function. If these values drift:

  • a function container may be healthy,
  • the gateway may or may not still reach it depending on discovery,
  • CVAT AI Tools can fail by calling a stale port,
  • the error often names host.docker.internal or 172.17.0.1 with “connection refused.”

This explains why the Railway applications and CVAT can show different health at the same time. They share functions but use different invocation paths.

Verified Operations

The server contains two executable scripts:

Script Purpose
/opt/cvat-inference/scripts/verify-yolo-stack.sh Compare Docker ports with Nuclio metadata, check ready state, validate detector 26 backend URLs, and check gateway registry
/opt/cvat-inference/scripts/redeploy-cvat-yolo-functions.sh Back up configuration, redeploy functions, refresh 26 backend URLs, and run verification

The verifier passed all detector functions 15 through 26 on 2026-07-16. It also confirmed that detector 26 pointed to the current ports for specialist detectors 22 through 25.

Change Procedure

  1. Capture a serverless configuration backup.
  2. Redeploy the affected function with the matching nuctl version.
  3. Confirm Docker's host port equals Nuclio status.httpPort.
  4. If any of 22 through 25 changed, rewrite detector 26 backend URLs and redeploy 26.
  5. Run verify-yolo-stack.sh.
  6. Run a real prediction through detector 26.
  7. Test the model inside CVAT AI Tools.
  8. Check both RapidDraft detector-list endpoints.
  9. Record the model identity, source dataset, weights, and deployment time.

Do not repair this by hardcoding a new function port into every Railway application.

Security And Provenance

  • Keep the bearer token in Railway/service secrets only.
  • Do not publish gateway token values or IONOS credentials.
  • The public hostname is stable, but the service currently lacks Git provenance because its server directory is not a repository.
  • The recommended improvement is a private infrastructure repository that owns gateway source, Compose configuration, scripts, and a deployment manifest.

Open Questions

  1. When will the gateway be moved into a reviewable private repository?
  2. Should the gateway expose a non-sensitive authenticated health/status summary for operations?
  3. Should model promotion require an automated prediction fixture in addition to port verification?

Sources

  • Live authenticated gateway registry verified 2026-07-16
  • IONOS /opt/cvat-inference/scripts/verify-yolo-stack.sh verified 2026-07-16
  • Central playbook 04_playbooks/DRAWING_MODEL_TRAINING_AND_CVAT_MODEL_SERVING.md
  • Central handover 01_tracks/techstack/handover/260603_draftlint-yolo-gateway-railway-stabilization.md
  • DraftLint System Family