All skills
nvidia avatar

/deepstream-sop

@4cb1092
by NVIDIA Corporationnvidia/skills3.5k stars
424

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the user does not name it: verify operator step sequence, detect missing or out-of-order SOP steps, score factory/work-cell video for procedure compliance, run VLM-based SOP checking on industrial cameras, or call /v1/chat/completions with a file, RTSP, or Basler camera. Also trigger for its internals: SOPVideoProcessor, DeepStream GEBD model (e.g. DDM) via Triton CAPI, nvds_custom_postprocess, Cosmos Reason 1/2 vLLM, SSE streaming, Kafka NvProto/JSON output, Basler/Pylon camera + emulation, Docker compose, chunk-level latency. Do NOT trigger for generic DeepStream pipelines, object detection/tracking, NIM imports, or video summarization.

Use this Skill: https://skilld.dev/gh/nvidia/skills/deepstream-sop

This session only. Nothing lands on disk.

referencesskill_10_test_suite.md

≈742 tokens on demand. Your agent reads this file only when SKILL.md points to it.

§ 10 — Test Suite Coverage

Reference file to copy: test_api_endpoints_reference.py → tests/test_api_endpoints.py Related sections: § 1 (endpoints), § 7 (SSE streaming), § 13 (curl examples)


Running Tests

# Start service first (requires GPU + DDM model + vLLM)
TEST_VIDEO_PATH=/path/to/video.mp4 python tests/test_api_endpoints.py
# OR with pytest
TEST_VIDEO_PATH=/path/to/video.mp4 pytest tests/test_api_endpoints.py -v

Test Classes and Coverage

Test Class Endpoints Tested
TestHealthEndpoints /v1/live, /v1/startup, /v1/ready
TestModelEndpoints /v1/models
TestMetadataEndpoint /v1/metadata
TestMetricsEndpoint /v1/metrics (format, content, increments)
TestFileEndpoints Full workflow: upload → list → download → chat → delete
TestChatCompletionEndpoint Non-streaming, streaming, invalid content-type
TestUniformChunkingEndpoint algorithm:"uniform" non-streaming + streaming; chunk_length_sec<=0 → 422; extra DDM fields → 422; ddm-net regression
TestEdgeCases 404 on invalid paths, 405 on wrong HTTP method

Critical Assertions

# --- Health endpoints ---
# /v1/live
assert data["object"] == "health.response"
assert data["message"] == "Service is live."

# /v1/startup
assert "started successfully" in data["message"].lower()

# /v1/ready
assert "ready" in data["message"].lower() or "dummy" in data["message"].lower()

# --- Model endpoint ---
# /v1/models
assert data["object"] == "list"
assert data["data"][0]["object"] == "model"

# --- Metadata endpoint ---
# /v1/metadata
assert "version" in data and "modelInfo" in data and "licenseInfo" in data
assert all(k in data["licenseInfo"] for k in ["name", "path", "size", "content"])

# --- File management ---
# /v1/files (POST)
assert upload_data["object"] == "file"
assert upload_data["id"].startswith("file-")

# --- Chat completions (non-streaming) ---
# /v1/chat/completions
assert data["object"] == "chat.completion"
assert data["id"].startswith("chatcmpl-")
assert data["choices"][0]["message"]["role"] == "assistant"

# --- Chat completions (streaming) ---
# /v1/chat/completions (stream=true)
assert "text/event-stream" in response.headers["content-type"]
assert first_chunk["object"] == "chat.completion.chunk"

# --- Uniform chunking (algorithm="uniform") ---
# {"algorithm":"uniform","chunk_length_sec":2.5} → accepted, returns chunks
assert data["object"] == "chat.completion"
# chunk_length_sec <= 0 → 422 ; extra DDM fields (e.g. threshold) with uniform → 422 (extra="forbid")
assert response.status_code == 422

# --- Error cases ---
# Content-type validation
# POST with Content-Type: text/plain → 415
# POST /v1/live → 405
# GET /v1/invalid_endpoint → 404

# --- Metrics ---
assert "api_requests_total" in metrics_text
assert "api_request_latency_seconds" in metrics_text

Source: SKILL.md on GitHub

2 warnings27d3 checks · Risk MEDIUM
  • Gen Agent Trust Hub27d

    This skill provides a framework for building an industrial SOP monitoring microservice. It uses multi-stage processing, including Vision-Language Models and custom logic. Security observations include dynamic code generation based on configuration files, execution of build scripts via subprocess, and reliance on external research repositories for model weights and code.

  • Socket27d

    2 alerts: gptSecurity, gptAnomaly

  • Snyk27d

    Risk: LOW · No issues

Signed by skilld at 4cb1092. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
owner
windy@nvidia.com
service
deepstream-sop
version
1.0.0
Other metadata
reviewed
2026-04-08
metadata
{
  "author": "Wind Yuan <windy@nvidia.com>",
  "tags": [
    "deepstream",
    "sop",
    "vlm",
    "triton",
    "gpu"
  ],
  "languages": [
    "python"
  ],
  "frameworks": [
    "deepstream",
    "triton",
    "fastapi"
  ],
  "domain": "video-analytics"
}

README badge

README badge for nvidia/skills/deepstream-sop