vss-deploy-dense-captioning
NVIDIA/skills
Stellen Sie einen eigenständigen RT-VLM-Mikroservice für Dense Captioning bereit und testen Sie dessen REST-API-Endpunkte für den Datei-Upload, die Untertitelgenerierung, das Streaming, die Chat-Vervollständigung und die Kafka-Integration.
...Alle erweiternZweck
Den RT-VLM-Mikroservice für Dense Captioning eigenständig bereitstellen und jeden von ihm bereitgestellten Endpunkt testen (Datei-Upload, generate_captions, Stream hinzufügen/löschen, Chat-Vervollständigungen, Kafka-Themen).
Voraussetzungen
Für die eigenständige RT-VLM-Bereitstellung:
- Docker, Docker Compose, NVIDIA Container Toolkit und eine sichtbare GPU.
- Anmeldedaten für die NGC-Registry in
$NGC_CLI_API_KEYfürdie Docker-Anmeldung bei nvcr.io, das Abrufen von Images sowie das Herunterladen lokaler NGC-Modelle und -Artefakte. curl,jqund ein beliebiges beschreibbares Arbeitsverzeichnis für die eigenständige Compose-Kopie.
Für API-Aufrufe an einen bestehenden Dienst:
- Laufender RT-VLM-Dienst, erreichbar unter
$BASE_URL. - Bearer-Token in
$RTVI_VLM_API_KEYoder$NGC_CLI_API_KEY, je nachdem, wie der Dienst konfiguriert wurde.
Für die vollständige Bereitstellung eines VSS-Profils:
- Verwenden Sie
../vss-deploy-profile/SKILL.md; dieser Skill stellt keine vollständigen VSS-Profile bereit.
Anleitung
Befolgen Sie die unten aufgeführten Routing-Tabellen und Schritt-für-Schritt-Workflows. Jeder Abschnitt, der mit „Workflow“, „Schnellstart“ oder „Ablauf“ endet, ist von oben nach unten auszuführen. Detailliertes Referenzmaterial finden Sie im Verzeichnis „references/“; führen Sie die dokumentierten Workflows direkt aus, sofern in einer zukünftigen Überarbeitung kein konkreter Helfer genannt wird.
Beispiele
Fertig ausgearbeitete End-to-End-Beispiele befinden sich im Verzeichnis „evals/“ (jedes *.json-Manifest enthält ein ausführbares Szenario) sowie inline in den nachstehenden „curl“-Blöcken zu den einzelnen Workflows. Führen Sie eine Tier-3-Bewertung mit „nv-base validate durch, um diese abzuspielen.
Einschränkungen
- Erfordert entweder einen eigenständigen RT-VLM-Dienst, der über diesen Skill bereitgestellt wird, oder einen vorhandenen RT-VLM-Dienst, der für den Aufrufer erreichbar ist.
- Von NGC gehostete Modelle und NIMs können Ratenbeschränkungen, Anforderungen an den GPU-Speicher sowie Lizenzbeschränkungen unterliegen.
- Die Grenzen für Parallelität, GPU-Speicher und Speicherplatz hängen von der Host-Hardware und der „compose“-Datei des Profils ab.
- Halten Sie die Dateien `
NGC_CLI_API_KEY`,`RTVI_VLM_API_KEY` und`.env`aus Git und aus den Protokollen heraus; geben Sie Anmeldedaten nicht im Klartext aus und fügen Sie sie nicht in endgültige Antworten ein. - Der Zugriff auf die Docker-Gruppe und
„sudo“entsprechen faktisch Root-Rechten. Verwenden Sie den nicht-interaktiven„sudo -n“-Schutz in der Deploy-Referenz und stoppen Sie die Aktion des Host-Besitzers, wenn passwortloses „sudo“ nicht verfügbar ist.
Fehlerbehebung
- Fehler: REST-Aufruf gibt „Connection refused“ zurück. Ursache: Ziel-Mikroservice läuft nicht. Lösung: Überprüfen Sie
/docsoder/health; führen Sie ein erneutes Deployment übervss-deploy-profileoder die entsprechendevss-deploy-*-Skilldurch. - Fehler: HTTP 401/403 bei NGC-Pulls. Ursache: fehlender/abgelaufener
NGC_CLI_API_KEY. Lösung:FührenSie„docker login nvcr.io“ ausund exportieren Sie den Schlüssel erneut, bevor Sie es erneut versuchen. - Fehler: Container OOM oder Modell kann nicht geladen werden. Ursache: Unzureichender GPU-Speicher für das ausgewählte Profil. Lösung: Wechseln Sie zu einer kleineren Variante oder geben Sie GPUs mit
„docker compose down“frei.
Bereitstellung und Verwendung von RT-VLM Dense Captioning (VSS 3.2)
RT-VLM ist der Echtzeit-Vision-Language-Mikroservice von NVIDIA: Dekodiere Videos (Datei oder
RTSP), segmentiere sie in Chunks, führe ein VLM aus (cosmos-reason1, cosmos-reason2 oder ein beliebiges
OpenAI-kompatibles Modell), Dense Captions über SSE/HTTP zurückstreamen und
Untertitel, Vorfallwarnungen und Fehler an Kafka veröffentlichen. Verwenden Sie diese Funktion, um den
eigenständigen RT-VLM-Dienst bereitzustellen, wenn noch kein vollständiges VSS-Profil ausgeführt wird, und rufen Sie anschließend
dessen /v1/... API auf, um Untertitel zu generieren, Dateien hochzuladen, Live-Streams zu verwalten, Zustandsprüfungen
durchzuführen, NIM-kompatible Chat-Vervollständigungen zu nutzen oder Prometheus-Metriken abzurufen. API-Referenz:
https://docs.nvidia.com/vss/latest/real-time-vlm-api.html.
Bereitstellungs-Routing
Wenn der Nutzer die Bereitstellung eines vollständigen VSS-Profils anfordert, verwenden Sie
../vss-deploy-profile/SKILL.md. Diese Skill
ist zuständig für das Profil-Routing, „generated.env“, „resolved.yml“, die Dimensionierung mehrerer Dienste sowie
die vollständige Bereitstellung und das Herunterfahren.
Wenn der Benutzer eine eigenständige RT-VLM-Dichteuntertitelung anfordert oder noch kein VSS-Profil
läuft, verwenden Sie den eigenständigen RT-VLM-Ablauf in
references/deploy-rt-vlm-service.md,
bevor Sie die API aufrufen. Dies folgt demselben „Compose“-zentrierten Muster wie
vss-deploy-profile: Kontext erfassen, Vorabprüfungen durchführen, mit einer lokalen Kopie arbeiten,
Trockenlauf mit der Docker-Compose-Konfiguration durchführen, überprüfen, bereitstellen und anschließend auf den Status warten.
Standalone-Bereitstellungsablauf
Befolgen Sie stets diese Reihenfolge. Überspringen Sie niemals den Testlauf.
# 1. Kopiere deploy/docker/services/rtvi/rtvi-vlm/rtvi-vlm-docker-compose.yml
# in ein beliebiges beschreibbares eigenständiges Arbeitsverzeichnis.
# 2. Leite RTVI_VLM_IMAGE_TAG aus dieser Compose-Kopie ab.
# 3. Entfernen Sie den nur für die Standalone-Bereitstellung relevanten, überflüssigen `depends_on`-Block aus der Kopie.
# 4. Erstellen Sie eine `.env`-Datei, die von Git ignoriert wird, mit den erforderlichen RT-VLM-Werten.
# 5. Bereiten Sie Host-Bind-Pfade wie $VSS_DATA_DIR/data_log/vst/clip_storage vor.
# Verwende `sudo -n` für Berechtigkeitskorrekturen; falls passwortloses `sudo` nicht verfügbar ist,
# halte an und bitte den Host-Besitzer, den angezeigten Befehl manuell auszuführen.
# 6. docker compose --env-file .env -f rtvi-vlm-docker-compose.yml config --quiet
# 7. Laden Sie mit `docker pull` genau den RT-VLM-Image-Tag herunter.
# 8. Führen Sie `docker compose ... up -d rtvi-vlm` aus, warten Sie, bis der Status „ready“ erreicht ist, und führen Sie dann einen Smoke-Test durch.
Führen Sie vor jedem „pull“ oder „up“ Vorabprüfungen durch; beenden Sie den Vorgang hier und beheben Sie Fehler, bevor
Sie RT-VLM selbst debuggen:
nvidia-smi --query-gpu=index,name --format=csv,noheader
nvidia-container-cli info
docker compose version
docker run --rm --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi
Bei eigenständigen Ein-Datei-Bereitstellungen führen Sie die Datei
deploy/docker/services/rtvi/rtvi-vlm/rtvi-vlm-docker-compose.yml nicht direkt aus: Sie
enthält „depends_on“-Verweise auf gleichrangige VLM/NIM-Dienste, die nur
im vollständigen VSS/met-blueprints-Compose-Projekt definiert sind. Die Referenz für die eigenständige Bereitstellung
zeigt, wie man die Compose-Datei kopiert, daraus das aktuelle Image-Tag ableitet,
den `depends_on` -Block entfernt und das Ergebnis vor dem Start überprüft.
Bei der agentengesteuerten Validierung darf die sudo- Eingabeaufforderung niemals interaktiv erscheinen. Verwenden Sie vor jedem
privilegierten Eigentümerwechsel oder Docker-Vorgang die nicht-interaktive Schutzmaßnahme in
references/deploy-rt-vlm-service.md:
bevorzuge „plain docker“; verwende andernfalls „sudo -n docker“; falls „sudo -n“ fehlschlägt, breche den Vorgang ab
und führe den genauen manuellen Befehl für den Host-Besitzer aus, anstatt es mit
interaktivem „sudo“ erneut zu versuchen oder die Berechtigungen zu schwächen.
Wenn „docker pull“ mit einem „containerd snapshotter/unpack“-Fehler unter Docker 28+ fehlschlägt,
wenden Sie die Korrektur „containerd-snapshotter=false“ in der Datei
„/etc/docker/daemon.json“ aus der Standalone-Referenz an, bevor Sie es erneut versuchen.
Mindestwerte für die standalone -.env -Datei:
| Host-Umgebungsvariable | Erforderlich, wenn | Zweck |
|---|---|---|
NGC_CLI_API_KEY |
Standalone-Bereitstellungspfad | Abruf von NGC-Registry-Images und Download von NGC-Modellen/Artefakten |
RTVI_VLM_API_KEY oder NGC_CLI_API_KEY |
Authentifizierte API-Aufrufe | RT-VLM-Bearer-Authentifizierung nach dem Start des Dienstes |
RTVI_VLM_PORT |
Immer | Host-API-Port, der dem Container 8000 zugeordnet ist |
HOST_IP |
Immer | Kafka-Bootstrap-Host (${HOST_IP}:9092) |
VSS_DATA_DIR |
Immer | Erforderliche Bind-Mount-Verbindung für den Clip-Speicher |
RTVI_VLM_MODEL_TO_USE |
Immer für Standalone | Backend-Auswahl; verwenden Sie „cosmos-reason2“ für das standardmäßige lokale Modell oder „openai-compat“ für einen Remote- oder Sibling-Endpunkt |
RTVI_VLM_MODEL_PATH |
Lokales, selbst gehostetes Modell | Source-gestützter Cosmos Reason 2-Pfad: ngc:nim/nvidia/cosmos-reason2-8b:hf-1208 |
RTVI_VLM_ENDPOINT |
RTVI_VLM_MODEL_TO_USE=openai-compat |
Remote-/Sibling-Endpunkt für OpenAI-kompatibles VLM |
VLM_NAME |
RTVI_VLM_MODEL_TO_USE=openai-compat |
Von diesem Endpunkt bereitgestellter Modell-/Bereitstellungsname |
Einrichtung
export BASE_URL="http://localhost:${RTVI_VLM_PORT:-8018}" # RT-VLM-Port auf der Host-Seite
export API_KEY="${NGC_CLI_API_KEY:-${RTVI_VLM_API_KEY:-}}" # Bearer-Token, das von hostseitigen curl-Befehlen verwendet wird
: "${API_KEY:?Legen Sie NGC_CLI_API_KEY oder RTVI_VLM_API_KEY fest, bevor Sie authentifizierte Endpunkte aufrufen}"
Jede der folgenden Anfragen verwendet „Authorization: Bearer $API_KEY“. Health-Endpunkte
(/v1/health/*, /v1/ready, /v1/live, /v1/startup) funktionieren in der Regel ohne Authentifizierung.
Test vor der Nutzung:
curl -fsS "$BASE_URL/v1/health/ready"
MODEL_ID="$(curl -fsS "$BASE_URL/v1/models" -H "Authorization: Bearer $API_KEY" | jq -r '.data[0].id // .id')"
curl -fsS "$BASE_URL/openapi.json" | jq -r '.paths | keys[]' | sort
RTSP-Beispiel-Stream-Guard
Wenn eine Aufgabe oder ein Eval den Namen RTSP_SAMPLE_URL trägt, behandeln Sie genau diese Umgebungsvariable
als erforderliche Eingabe. Überprüfen Sie vor dem Abfragen oder der
Registrierung eines Streams, ob sie gesetzt und nicht leer ist; falls sie fehlt, brechen Sie den Vorgang mit einer eindeutigen Fehlermeldung ab. Leiten Sie
keinen Ersatzwert aus NvStreamer, VIOS, Sample-Data-Bundles oder anderen
Fallback-Lösungen ab, da dadurch ein anderer Stream validiert wird als der vom Aufrufer angeforderte.
: „${RTSP_SAMPLE_URL:?Setzen Sie RTSP_SAMPLE_URL vor der RTSP-Validierung auf einen erreichbaren RTSP-Beispiel-Stream}“
case „$RTSP_SAMPLE_URL“ in
rtsp://*) ;;
*) echo „RTSP_SAMPLE_URL muss eine rtsp://-URL sein, erhalten: $RTSP_SAMPLE_URL“ >&2; exit 1 ;;
esac
if command -v ffprobe >/dev/null 2>&1; then
ffprobe -v error -rtsp_transport tcp \
-select_streams v:0 -show_entries stream=codec_type \
-of csv=p=0 "$RTSP_SAMPLE_URL" | grep -qx video
elif command -v gst-discoverer-1.0 >/dev/null 2>&1; then
gst-discoverer-1.0 "$RTSP_SAMPLE_URL" | grep -qi 'video'
else
echo "Installieren Sie ffprobe oder gst-discoverer-1.0 vor der RTSP-Validierung." >&2
exit 1
fi
Schnellstart – Dense Captions aus einem lokalen Video
# 1. Laden Sie das Video hoch und erfassen Sie dessen Datei-ID
FILE_ID=$(curl -fsS -X POST "$BASE_URL/v1/files" \
-H "Authorization: Bearer $API_KEY" \
-F „file=@/path/to/warehouse.mp4“ \
-F „purpose=vision“ \
-F „media_type=video“ | jq -r '.id')
# 2. Untertitel und Benachrichtigungen generieren (SSE-Stream mit in Blöcken übermittelten Antworten)
curl -N -X POST "$BASE_URL/v1/generate_captions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"id\": \"$FILE_ID\",
\"prompt\": \"Verfasse für jedes 10-Sekunden-Segment dieses Lagerhausvideos eine prägnante, aussagekräftige Bildunterschrift.\",
\"model\": \"$MODEL_ID\",
\"chunk_duration\": 10,
\"stream\": true
}"
API-Oberfläche
Verwenden Sie die Live-OpenAPI als maßgebliche Quelle, bevor Sie optionale Endpunkte aufrufen:
curl -fsS "$BASE_URL/openapi.json" | jq -r '.paths | keys[]' | sort
Die wichtigsten Pfade für VSS 3.2 sind:
POST /v1/filesfür den Multipart-Medien-Upload; übergeben Sie die zurückgegebeneDatei-IDan die Untertitelgenerierung und löschen Sie die Datei nach Abschluss des Vorgangs.POST /v1/generate_captionsfür die Untertitelung von Dateien oder Streams. Verwenden Sie die exakte Modell-ID, die vonGET /v1/modelszurückgegeben wird; Aliase wie„cosmos-reason2“sind Backend-Selektoren und keine Modell-IDs für Anfragen.POST /v1/streams/add,GET /v1/streams/get-stream-infoundDELETE /v1/streams/delete/{stream_id}für den RTSP-Lebenszyklus. Stream-IDs ausresults[0].idauswerten.POST /v1/chat/completionsfür OpenAI-kompatible Text- und multimodale Aufrufe. Aktuelle 26.05-Builds geben für reine Text-/v1/completionseinen HTTP-400-Fehler zurück; behandle dies bei der Validierung von Legacy-Verhalten als erwartet.GET /v1/health/ready,/v1/models,/v1/assets/statsund/v1/metricsfür Service-Probes. Gehen Sie nicht davon aus, dass/v1/licenseexistiert, es sei denn, OpenAPI listet es auf.
Detaillierte Endpunkt-Schemas, Antwortformate, Endpunkte im CV-Stil mit einem einzigen Stream
sowie Hinweise zur Kompatibilität mit 26.05 finden Sie in
references/api-surface-26.05.md.
Gängige Arbeitsabläufe
- Untertitelung gespeicherter Dateien: Hochladen mit
POST /v1/files, Aufruf von/v1/generate_captionsmit der zurückgegebenen Datei-ID, Verwendung vonstream=truefür SSE, anschließendes Löschen der Datei, um Speicherplatz freizugeben. - RTSP-Live-Untertitelung: Wenn der Aufrufer
RTSP_SAMPLE_URLangibt, verwende genau diese URL und führe vor der Registrierung den RTSP Sample Stream Guard aus. Leiten Sie keinen Ersatzstream aus NvStreamer oder VIOS ab, wennRTSP_SAMPLE_URLleer ist; führen Sie stattdessen einen „Fail-Fast“-Abbruch durch. Verlangen Sie vor der Registrierung einen tatsächlichen Videostream-/Untertitel-Eintrag; fügen Sie den Stream hinzu, untertiteln Sie ihn und heben Sie anschließend die Registrierung auf. - Warnmeldungen: Fügen Sie eine deterministische Zeile
„Anomalie erkannt: Ja/Nein“ein. Die Kafka-Veröffentlichung erfolgt serverseitig, zusätzlich zu den HTTP-Antworten, und ist in„references/kafka-workflows.md“dokumentiert. - Kafka-Validierung: Verlasse dich bei den Themennamen auf die Live-Umgebung
von vss-rtvi-vlm. Verwende in einem vollständigen VSS-Echtzeit-Profil für Warnmeldungen den vorhandenen VSS-Kafka-Container„mdx-kafka“für CLI-Prüfungen und abschließende Befehle des Incident-Consumers. Für die eigenständige Validierung verwenden Sie einen Broker, der${HOST_IP}:9092veröffentlicht; beenden oder ersetzen Sie niemals einen bereits vorhandenen Broker ohne Bestätigung durch den Benutzer.
Fehlerreferenz
Häufige Ursachen: 400 bei ungültiger Anfrageform oder Modell-ID, 401/403 bei fehlendem
oder falschem Bearer-Token, 404 bei gelöschten Dateien/Streams oder nicht unterstützten Endpunkten,
413 bei zu großen Uploads, 422 bei der Schemavalidierung, 429 bei zu hoher
Parallelität, 500 bei Inferenz-/Laufzeitfehlern und 503, während der Start noch
im Gange ist. Überprüfen Sie die Docker-Protokolle „vss-rtvi-vlm“ auf serviceseitige Fehler.
---
name: vss-deploy-dense-captioning
description: Deploy a standalone RT-VLM dense-captioning microservice and exercise its REST API endpoints for file upload, caption generation, streaming, chat completions, and Kafka integration.
license: Apache-2.0
---
## Purpose
Stand up the RT-VLM dense-captioning microservice on its own and exercise every endpoint it exposes (file upload, generate_captions, stream add/delete, chat-completions, Kafka topics).
## Prerequisites
For standalone RT-VLM deployment:
- Docker, Docker Compose, NVIDIA Container Toolkit, and a visible GPU.
- NGC registry credentials in `$NGC_CLI_API_KEY` for `docker login nvcr.io`,
image pulls, and local NGC model/artifact downloads.
- `curl`, `jq`, and any writable working directory for the standalone compose copy.
For API calls against an existing service:
- Running RT-VLM service reachable at `$BASE_URL`.
- Bearer token in `$RTVI_VLM_API_KEY` or `$NGC_CLI_API_KEY`, depending on how the
service was configured.
For full VSS profile deployment:
- Use `../vss-deploy-profile/SKILL.md`; this skill does not deploy full VSS profiles.
## Instructions
Follow the routing tables and step-by-step workflows below. Each section that ends in *workflow*, *quick start*, or *flow* is intended to be executed top-to-bottom. Detailed reference material lives in `references/`; execute the documented workflows directly unless a future revision names a concrete helper.
## Examples
Worked end-to-end examples are kept under `evals/` (each `*.json` manifest contains a runnable scenario) and inline in the per-workflow `curl` blocks below. Run a Tier-3 evaluation with `nv-base validate <this-skill-dir> --agent-eval` to replay them.
## Limitations
- Requires either a standalone RT-VLM service deployed via this skill or an
existing RT-VLM service reachable from the caller.
- NGC-hosted models and NIMs may be subject to rate-limits, GPU memory requirements, and license restrictions.
- Concurrency, GPU memory, and storage limits depend on the host hardware and the profile's compose file.
- Keep `NGC_CLI_API_KEY`, `RTVI_VLM_API_KEY`, and `.env` files out of git and out of logs; do not echo credential values or include them in final responses.
- Docker group access and `sudo` are effectively root-level privileges. Use the non-interactive `sudo -n` guard in the deploy reference and stop for host-owner action when passwordless sudo is unavailable.
## Troubleshooting
- **Error**: REST call returns connection refused. **Cause**: target microservice not running. **Solution**: probe `/docs` or `/health`; redeploy via `vss-deploy-profile` or the matching `vss-deploy-*` skill.
- **Error**: HTTP 401/403 from NGC pulls. **Cause**: missing/expired `NGC_CLI_API_KEY`. **Solution**: `docker login nvcr.io` and re-export the key before retrying.
- **Error**: container OOM or model fails to load. **Cause**: insufficient GPU memory for the selected profile. **Solution**: switch to a smaller variant or free GPUs via `docker compose down`.
# Deploy and Use RT-VLM Dense Captioning (VSS 3.2)
RT-VLM is NVIDIA's real-time vision-language microservice: decode video (file or
RTSP), segment it into chunks, run a VLM (`cosmos-reason1`, `cosmos-reason2`, or any
OpenAI-compatible model), stream dense captions back over SSE/HTTP, and publish
captions, incident alerts, and errors to Kafka. Use this skill to deploy the
standalone RT-VLM service when a full VSS profile is not already running, then call
its `/v1/...` API for caption generation, file upload, live-stream management, health
checks, NIM-compatible chat completions, or Prometheus metrics. API reference:
<https://docs.nvidia.com/vss/latest/real-time-vlm-api.html>.
## Deployment Routing
If the user asks to deploy a full VSS profile, use
[`../vss-deploy-profile/SKILL.md`](../vss-deploy-profile/SKILL.md). That skill
owns profile routing, `generated.env`, `resolved.yml`, multi-service sizing, and
full-stack deploy/teardown.
If the user asks for standalone RT-VLM dense captioning, or no VSS profile is
already running, use the standalone RT-VLM flow in
[`references/deploy-rt-vlm-service.md`](references/deploy-rt-vlm-service.md)
before calling the API. This follows the same compose-centric pattern as
`vss-deploy-profile`: gather context, run preflights, work from a local copy,
dry-run with `docker compose config`, review, deploy, then wait for health.
## Standalone Deployment Flow
Always follow this sequence. Never skip the dry-run.
```bash
# 1. Copy deploy/docker/services/rtvi/rtvi-vlm/rtvi-vlm-docker-compose.yml
# into any writable standalone working directory.
# 2. Derive RTVI_VLM_IMAGE_TAG from that compose copy.
# 3. Strip the standalone-only dangling depends_on block from the copy.
# 4. Create a gitignored .env with the required RT-VLM values.
# 5. Prepare host bind paths such as $VSS_DATA_DIR/data_log/vst/clip_storage.
# Use `sudo -n` for ownership fixes; if passwordless sudo is unavailable,
# stop and ask the host owner to run the printed command manually.
# 6. docker compose --env-file .env -f rtvi-vlm-docker-compose.yml config --quiet
# 7. docker pull the exact RT-VLM image tag.
# 8. docker compose ... up -d rtvi-vlm, wait for ready, then smoke test.
```
Run preflights before any pull or `up`; stop and fix failures here before
debugging RT-VLM itself:
```bash
nvidia-smi --query-gpu=index,name --format=csv,noheader
nvidia-container-cli info
docker compose version
docker run --rm --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi
```
For standalone single-file deployments, do not run the raw
`deploy/docker/services/rtvi/rtvi-vlm/rtvi-vlm-docker-compose.yml` directly: it
contains `depends_on` references to sibling VLM/NIM services that are only
defined in the full VSS/met-blueprints compose project. The standalone reference
shows how to copy the compose file, derive the current image tag from it, strip
the `depends_on` block, and validate the result before `up`.
For agent-driven validation, never let `sudo` prompt interactively. Before any
privileged ownership or Docker operation, use the non-interactive guard in
[`references/deploy-rt-vlm-service.md`](references/deploy-rt-vlm-service.md):
prefer plain `docker`; otherwise use `sudo -n docker`; if `sudo -n` fails, stop
with the exact manual command for the host owner instead of retrying with
interactive sudo or weakening permissions.
If `docker pull` fails with a containerd snapshotter/unpack error on Docker 28+,
apply the `/etc/docker/daemon.json` `containerd-snapshotter=false` fix in the
standalone reference before retrying.
Minimum standalone `.env` values:
| Host env var | Required when | Purpose |
|---|---|---|
| `NGC_CLI_API_KEY` | Standalone deploy path | NGC registry image pull and NGC model/artifact download |
| `RTVI_VLM_API_KEY` or `NGC_CLI_API_KEY` | Authenticated API calls | RT-VLM bearer auth after the service is running |
| `RTVI_VLM_PORT` | Always | Host API port mapped to container `8000` |
| `HOST_IP` | Always | Kafka bootstrap host (`${HOST_IP}:9092`) |
| `VSS_DATA_DIR` | Always | Required clip-storage bind mount |
| `RTVI_VLM_MODEL_TO_USE` | Always for standalone | Backend selector; use `cosmos-reason2` for the default local model or `openai-compat` for a remote/sibling endpoint |
| `RTVI_VLM_MODEL_PATH` | Local self-hosted model | Source-backed Cosmos Reason 2 path: `ngc:nim/nvidia/cosmos-reason2-8b:hf-1208` |
| `RTVI_VLM_ENDPOINT` | `RTVI_VLM_MODEL_TO_USE=openai-compat` | Remote/sibling OpenAI-compatible VLM endpoint |
| `VLM_NAME` | `RTVI_VLM_MODEL_TO_USE=openai-compat` | Model/deployment name exposed by that endpoint |
## Setup
```bash
export BASE_URL="http://localhost:${RTVI_VLM_PORT:-8018}" # host-side RT-VLM port
export API_KEY="${NGC_CLI_API_KEY:-${RTVI_VLM_API_KEY:-}}" # bearer token used by host-side curl commands
: "${API_KEY:?Set NGC_CLI_API_KEY or RTVI_VLM_API_KEY before calling authenticated endpoints}"
```
Every request below uses `Authorization: Bearer $API_KEY`. Health endpoints
(`/v1/health/*`, `/v1/ready`, `/v1/live`, `/v1/startup`) typically work without auth.
**Smoke test before use:**
```bash
curl -fsS "$BASE_URL/v1/health/ready"
MODEL_ID="$(curl -fsS "$BASE_URL/v1/models" -H "Authorization: Bearer $API_KEY" | jq -r '.data[0].id // .id')"
curl -fsS "$BASE_URL/openapi.json" | jq -r '.paths | keys[]' | sort
```
## RTSP Sample Stream Guard
When a task or eval names `RTSP_SAMPLE_URL`, treat that exact environment
variable as a required input. Verify it is set and non-empty before probing or
registering any stream; if it is missing, stop with a clear failure message. Do
not derive a substitute from NvStreamer, VIOS, sample-data bundles, or any other
fallback, because that validates a different stream than the caller requested.
```bash
: "${RTSP_SAMPLE_URL:?Set RTSP_SAMPLE_URL to a reachable RTSP sample stream before RTSP validation}"
case "$RTSP_SAMPLE_URL" in
rtsp://*) ;;
*) echo "RTSP_SAMPLE_URL must be an rtsp:// URL, got: $RTSP_SAMPLE_URL" >&2; exit 1 ;;
esac
if command -v ffprobe >/dev/null 2>&1; then
ffprobe -v error -rtsp_transport tcp \
-select_streams v:0 -show_entries stream=codec_type \
-of csv=p=0 "$RTSP_SAMPLE_URL" | grep -qx video
elif command -v gst-discoverer-1.0 >/dev/null 2>&1; then
gst-discoverer-1.0 "$RTSP_SAMPLE_URL" | grep -qi 'video'
else
echo "Install ffprobe or gst-discoverer-1.0 before RTSP validation." >&2
exit 1
fi
```
## Quick Start — dense captions from a local video
```bash
# 1. Upload the video, capture its file id
FILE_ID=$(curl -fsS -X POST "$BASE_URL/v1/files" \
-H "Authorization: Bearer $API_KEY" \
-F "file=@/path/to/warehouse.mp4" \
-F "purpose=vision" \
-F "media_type=video" | jq -r '.id')
# 2. Generate captions + alerts (SSE stream of chunked responses)
curl -N -X POST "$BASE_URL/v1/generate_captions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"id\": \"$FILE_ID\",
\"prompt\": \"Write a concise dense caption for each 10-second segment of this warehouse video.\",
\"model\": \"$MODEL_ID\",
\"chunk_duration\": 10,
\"stream\": true
}"
```
## API Surface
Use the live OpenAPI as the source of truth before calling optional endpoints:
```bash
curl -fsS "$BASE_URL/openapi.json" | jq -r '.paths | keys[]' | sort
```
Core paths for VSS 3.2 are:
- `POST /v1/files` for multipart media upload; pass the returned file `id` into
caption generation and delete the file when finished.
- `POST /v1/generate_captions` for file or stream captioning. Use the exact
model id returned by `GET /v1/models`; aliases such as `cosmos-reason2` are
backend selectors, not request model ids.
- `POST /v1/streams/add`, `GET /v1/streams/get-stream-info`, and
`DELETE /v1/streams/delete/{stream_id}` for RTSP lifecycle. Parse stream ids
from `results[0].id`.
- `POST /v1/chat/completions` for OpenAI-compatible text and multimodal calls.
Current 26.05 builds return HTTP 400 for text-only `/v1/completions`; treat
that as expected when validating legacy behavior.
- `GET /v1/health/ready`, `/v1/models`, `/v1/assets/stats`, and `/v1/metrics`
for service probes. Do not assume `/v1/license` exists unless OpenAPI lists it.
Detailed endpoint schemas, response shapes, CV-style singular stream endpoints,
and 26.05 compatibility notes live in
[`references/api-surface-26.05.md`](references/api-surface-26.05.md).
## Common Workflows
- Stored file captioning: upload with `POST /v1/files`, call
`/v1/generate_captions` with the returned file id, use `stream=true` for SSE,
then delete the file to release storage.
- RTSP live captioning: when the caller provides `RTSP_SAMPLE_URL`, use that
exact URL and run the **RTSP Sample Stream Guard** before registration. Do not
derive a replacement stream from NvStreamer or VIOS when `RTSP_SAMPLE_URL` is
empty; fail fast instead. Require an actual video stream/caps entry before
registration; add the stream, caption it, then unregister it.
- Alert prompts: include a deterministic `Anomaly Detected: Yes/No` line.
Kafka publication is server-side config, additive to HTTP responses, and
documented in [`references/kafka-workflows.md`](references/kafka-workflows.md).
- Kafka validation: trust the live `vss-rtvi-vlm` environment for topic names.
In a full VSS alerts real-time profile, use the existing VSS Kafka container
`mdx-kafka` for CLI checks and final incident-consumer commands. For
standalone validation, use a broker that advertises `${HOST_IP}:9092`; never
stop or replace a pre-existing broker without user confirmation.
## Error Reference
Common causes: 400 for invalid request shape or model id, 401/403 for missing
or wrong bearer token, 404 for deleted files/streams or unsupported endpoints,
413 for oversized uploads, 422 for schema validation, 429 for too much
concurrency, 500 for inference/runtime failures, and 503 while startup is still
in progress. Inspect `docker logs vss-rtvi-vlm` for service-side failures.
Alle Dateien
11 Dateienvss-deploy-dense-captioning installieren
Laden Sie die Skill-Dateien herunter und entpacken Sie sie in Ihr Verzeichnis „.claude/skills/“.
ZIP herunterladenKlonen Sie das Repository und kopieren Sie die Skill-Dateien in Ihr Projekt.
git clone https://github.com/NVIDIA/skills/tree/main/skills/vss-deploy-dense-captioning # Copy SKILL.md to your .claude/skills/ directory
Kopieren





Heim
