Get Started#
The Live Video Captioning RAG sample application is a retrieval-augmented generation workflow that creates caption-text embeddings and stores them in a vector database together with the corresponding video frames and metadata, using an LLM that is optimized and deployed using OpenVINO™ toolkit, for response generation. The application works with the Live Video Captioning sample application that processes a Real-Time Streaming Protocol (RTSP) video stream, runs video analytics pipelines, and uses a Vision-Language Model (VLM) to generate live captions for video frames. The Live Video Captioning sample application then sends the frame data, caption text, and associated metadata to the Live Video Captioning RAG sample application so the latter can build an embedding context and store it in the vector database. The Live Video Captioning RAG sample application then provides chatbots that answer questions based on the caption text generated from the video frames.
By following this guide, you will learn how to:
Set up the sample application: Use Docker Compose tool to deploy the application in your system environment.
Run the sample application: Launch the application and use the chatbots to answer questions.
Customize application parameters: Customize settings, for example, the LLM models and deployment configurations, to adapt the application to your specific requirements and environment.
Prerequisites#
Verify that your system meets the minimum requirements. See System Requirements for details.
Install Docker platform: Installation Guide.
Install Docker Compose tool: Installation Guide.
OpenVINO toolkit-compatible VLM/LLM. Follow the guide in section below.
Run the Application#
1. Clone the suite#
Go to the target directory of your choice and clone the suite.
If you want to clone a specific release branch, replace main with the desired tag.
To learn more on partial cloning, check the Repository Cloning guide.
git clone --filter=blob:none --sparse --branch main https://github.com/open-edge-platform/edge-ai-suites.git
cd edge-ai-suites
git sparse-checkout set metro-ai-suite
cd metro-ai-suite/live-video-analysis/live-video-captioning-rag
2. Create .env#
Run the setup helper:
bash scripts/setup_env.sh
The helper creates .env from .env.example, detects HOST_IP, and stores image settings such as REGISTRY and TAG in the file.
Use --force only if you want to overwrite an existing .env:
bash scripts/setup_env.sh --force
This script sets the following important values:
Variable |
Default |
Purpose |
|---|---|---|
|
Auto-detected from host network (fallback |
Host IP used by browser-accessible services and dashboard URLs. |
|
|
Image registry prefix. |
|
|
Docker image tag. |
|
|
Port for the LVC web dashboard. |
|
|
Port for the LVC-RAG web dashboard. |
|
|
Port for the pipeline management REST API. |
|
|
Port for WebRTC/WHIP signaling (mediamtx). |
|
|
Port for the internal MQTT broker. |
|
|
WebRTC stream bitrate in kbps. Lower values reduce bandwidth. |
|
|
Enables optional object-detection pre-filtering when set to |
|
|
Enables alert-style visual highlighting based on keyword rules when set to |
|
|
Number of previous captions shown in the UI. |
|
(empty) |
Pre-fills the RTSP URL field in the dashboard on load. |
|
(empty) |
Required for downloading gated Hugging Face models. |
|
|
Host path used for cached/downloaded model artifacts. |
|
|
Embedding model identifier used by embedding service configuration. |
|
|
Target device for embedding inference runtime (for example |
|
|
LLM model identifier used for RAG response generation. |
|
|
Target device for LLM inference runtime (for example |
|
|
Maximum number of generated output tokens per response. |
|
|
Number of top retrieved context entries used during RAG answering. |
|
|
Minimum retrieval similarity score required to include context. |
|
|
Hostname of the VDMS vector database service used by the app. |
|
|
Vector DB hostname used by compatibility paths in the backend stack. |
3. Download models (one-time)#
Download a VLM model that required to generate captions for LVC. For default CPU example:
./model_download_scripts/download_models.sh \
--model OpenGVLab/InternVL2-1B \
--type vlm \
--weight-format int8
Gated Hugging Face models#
Some models (for example, Gemma-3) require a Hugging Face access token. Set the token in .env or export it before running the download script:
export HUGGINGFACEHUB_API_TOKEN=<your-token>
Specifying the conversion device#
By default the model is converted on CPU. To explicitly set the device:
./model_download_scripts/download_models.sh \
--model <vlm-model-of-choice-from-huggingface> \
--type vlm \
--weight-format int8 \
--device <CPU|GPU|NPU>
Note: NPU currently requires
int4quantization for VLM/LLM conversion. If you pass--device NPUwithint8orfp16, the script automatically overrides it toint4.
The VLM models stored under ov_models.
See Model Preparation for detailed usage.
Download a LLM model for RAG.
# Set --model to the Hugging Face model you want to convert.
# Set --device to the preferred conversion target (for example, CPU or GPU).
# Set --weight-format to the precision/quantization format (`int4`, `int8`, or `fp16`).
./model_download_scripts/download_models.sh \
--model Qwen/Qwen2.5-3B-Instruct \
--type llm \
--device CPU \
--weight-format int8
Note: LLM model support for NPU is not yet enabled in Live-Video-Captioning-RAG application.
This stores the model under llm_models/.
For gated Hugging Face models, set a token first:
export HUGGINGFACEHUB_API_TOKEN=<your-huggingface-token>
4. Start the application#
From the live-video-analysis/live-video-captioning-rag directory, start the sample application using the Docker Compose tool:
docker compose up -d
Note: Docker Compose automatically reads values from
.envin the project root.
Note: The application will take some time to start. Check the container status and ensure that they are in the
"healthy/running"state using thedocker pscommand before accessing the application.
5. Access the application#
Follow these steps to use the application:
Open the Live Video Captioning UI at
http://<HOST_IP>:4173.Start a captioning run with a valid RTSP stream.
Confirm that captions are being generated.
Click the
chat iconin the top bar (visible only when embedding is enabled).This opens the Live Caption RAG dashboard at
http://<HOST_IP>:4172.Ask questions related to the current or recent scene.
6. Stop the application#
docker compose down
Troubleshooting#
Live Caption RAG dashboard Does not Open or is Unreachable#
Confirm that
live-video-captioning-ragcontainer is running.Confirm that port mapping
${LIVE_VIDEO_RAG_HOST_PORT:-4172}:4172is available.Check
http://localhost:4172/api/health.
Caption pipeline with RTSP not Running in LVC Dashboard#
If your network uses a proxy, add your RTSP stream host or IP to
no_proxyso the stream connection does not go through the proxy.For more detail on LVC, please refer to the LVC Documentation
Embeddings are Not Being Stored#
Ensure that the caption pipeline is actively running (not running means no ingestion).
Verify the embedding service health on
http://localhost:9777/health.Verify that the VDMS container is running.
If containers are running but no embeddings are stored, remove the volume and restart the services:
docker volume rm live-video-caption_vdms-db