Reference implementation of LVMem. Runs as a Docker container and talks to an OpenAI-compatible inference backend.
The inference backend can be either:
- Local SGLang servers (GPU required), or
- Any external OpenAI-compatible API (e.g. OpenRouter).
Only the lvmem container is always required; the SGLang containers are optional
and gated behind a Compose profile.
Clone this repository.
LVMem imports utils and tools from
ReMEmbR:
git clone --filter=blob:none --sparse https://github.com/NVIDIA-AI-IOT/remembr.git
cd remembr
git sparse-checkout set remembr/utils remembr/tools
mv remembr/utils ./utils
mv remembr/tools ./tools
rmdir remembr
cd ..Enter the docker/ directory.
cp .env.example .envEdit .env if needed. In particular, set UID / GID to match your host user:
echo "UID=$(id -u)" >> .env
echo "GID=$(id -g)" >> .envLVMem uses Milvus as its vector store, following the setup from ReMEmbR.
curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/master/scripts/standalone_embed.sh \
-o launch_milvus_container.sh
bash launch_milvus_container.sh startNote: the SGLang backend is tested end-to-end. The OpenRouter backend is supported by the code but has not been re-tested after refactoring. Use it with that in mind.
Set in .env:
VLM_ENDPOINT=https://openrouter.ai/api/v1
JUDGE_ENDPOINT=https://openrouter.ai/api/v1
OPENAI_API_KEY=sk-xxx
VLM_MODEL=qwen/qwen3.5-9b
JUDGE_MODEL=qwen/qwen3.5-9bRun only the method container:
docker compose up lvmem -d --build
docker compose exec lvmem bashLeave the default endpoints in .env. Adjust VLM_CUDA_VISIBLE_DEVICES /
JUDGE_CUDA_VISIBLE_DEVICES to select the GPUs to use.
Run the full stack:
docker compose --profile local up -d --build
docker compose exec lvmem bashThis starts:
| Service | Purpose | Default port |
|---|---|---|
sglang-lvmem-vlm |
Vision-language-model backend | 8100 |
sglang-lvmem-judge |
Judge backend | 8101 |
lvmem |
Method container | — |
Model IDs differ between backends: SGLang uses HuggingFace-style paths (
Qwen/Qwen3.5-9B), OpenRouter uses lowercase slugs (qwen/qwen3.5-9b).
All configuration is read from .env (see .env.example).
| Variable | Description | Default |
|---|---|---|
UID / GID |
Host user UID/GID, passed as Docker build args | 1000 / 1000 |
VLM_ENDPOINT |
OpenAI-compatible endpoint for the VLM backend | http://localhost:8100/v1 |
JUDGE_ENDPOINT |
OpenAI-compatible endpoint for the judge backend | http://localhost:8101/v1 |
OPENAI_API_KEY |
API key for external backends | — |
VLM_MODEL |
Model path or ID for the VLM | Qwen/Qwen3.5-9B |
JUDGE_MODEL |
Model path or ID for the judge | Qwen/Qwen3.5-0.8B |
VLM_CUDA_VISIBLE_DEVICES |
GPU index for the VLM container | 0 |
JUDGE_CUDA_VISIBLE_DEVICES |
GPU index for the judge container | 0 |
HF_TOKEN |
HuggingFace token (for gated models) | — |
We recommend mounting a shared HuggingFace cache directory so that downloaded
models are reused across containers and runs. Create a local
docker-compose.override.yaml:
services:
lvmem:
volumes:
- ./hf_cache:/home/user/.cache/huggingface
sglang-lvmem-vlm:
volumes:
- ./hf_cache:/root/.cache/huggingface
sglang-lvmem-judge:
volumes:
- ./hf_cache:/root/.cache/huggingfaceThen start the stack as usual — Compose picks up the override automatically.
See EVAL.md for dataset download, memory building, question generation, and the full-sequence evaluation pipeline.
This project includes code from several third-party sources.
- DAAAM,
copyright (c) 2026 Massachusetts Institute of Technology,
licensed under the BSD 3-Clause License (see
LICENSE-DAAAM). - ReMEmbR,
licensed under the NVIDIA License, non-commercial / research use only
(see
LICENSE-ReMEmbR). - PSFR (
key-frame-selection), obtained directly from the authors of FocusGraph upon request. Not our code; used as provided by the authors (seeLICENSE-PSFR).