Offline vision-language chat demo for ARIES / Mobilint hardware.
The current implementation uses:
Flask-SocketIObackend for image-aware generationNext.jsfrontend for image upload and chat UI- frontend-owned locale resources, example questions, and prompt bundles
- backend-owned generation defaults in
backend/src/generation_config.json
- backend/src/server.py: websocket server, session orchestration, and prompt sync flow
- backend/src/ImageTextToTextPipeline.py: model loading, image preprocessing, and token streaming
- backend/src/generation_config.json: default generation parameters
- backend/src/prompt.txt: base prompt template used by the backend pipeline
- frontend/app/i18n: UI text resources by locale
- frontend/app/questions/locales: example question resources by locale
- frontend/public/prompt-bundles: locale-specific
system.txt/inter.txt - frontend/public/images: demo images referenced by frontend settings
Frontend locale resources are prepared for:
enkojazh
The frontend loads the selected locale's prompt bundle and sends it to the backend through the prompt_config socket event.
When the language changes:
- frontend reloads the selected locale resources and prompt bundle
- backend aborts any in-flight generation for the session
- backend applies the new
system_promptandinter_prompt - frontend resumes chat only after
prompt_config_saved
Windows does not support the Docker PCIe/NPU binding flow used on Linux, so run the backend and frontend directly.
cd frontend
npm install
npm run devcd backend
uv sync
uv run src/server.pyOpen http://localhost:3000.
The helper script installs dependencies, prepares the Docker network, updates the repository, and downloads required assets.
./update.shFollow the official Docker Engine instructions:
- https://docs.docker.com/engine/install/ubuntu/
- https://docs.docker.com/engine/install/linux-postinstall/
docker network create mblt_intdocker compose builddocker compose upInstall NVIDIA Container Toolkit first:
Then run:
docker compose -f docker-compose.yml -f docker-compose.gpu.yml updocker-compose.gpu.yml sets gpus: all.
docker compose up -d
docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -ddocker compose downThis demo is designed for hardware-accelerated inference only. CPU-only execution is not supported.
Prompt text is not stored on the backend as the active source of truth.
- frontend loads prompt bundle files from frontend/public/prompt-bundles
- frontend sends
system_prompt/inter_promptto the backend session - backend applies those prompts before handling
ask
The backend rejects ask requests until the session prompt bundle has been synchronized.
backend/backend-gpu.Dockerfile installs PyTorch with uv --torch-backend.
- default is
cu124(ARG TORCH_BACKEND=cu124) - you can override it at build time if needed:
docker compose -f docker-compose.yml -f docker-compose.gpu.yml build --build-arg TORCH_BACKEND=cu121autois not recommended for Docker GPU image builds because build-time environment detection may select CPU wheels
docker compose up: NPU mode uses backend/backend.Dockerfile and the NPU-backed runtime path.docker compose -f docker-compose.yml -f docker-compose.gpu.yml up: GPU mode uses backend/backend-gpu.Dockerfile and requestsgpus: all.
Edit the locale files under frontend/public/prompt-bundles:
system.txtinter.txt
The frontend reloads and sends the selected locale's prompt bundle to the backend session.
Edit backend/src/generation_config.json.
Edit the locale JSON files under frontend/app/i18n.
Edit the locale JSON files under frontend/app/questions/locales and frontend/app/questions/catalog.ts.
Edit frontend/app/settings.ts and add new image assets under frontend/public/images.
Large images can break inference; a width around 640 is recommended.
Frontend production build:
cd frontend
npm run buildBackend syntax check:
python -m py_compile backend/src/server.py backend/src/ImageTextToTextPipeline.pyIf you use the provided desktop shortcut, this repository is expected at ~/aries-vlm-demo.
If needed, update the path in:
Then install the desktop entry:
mkdir -p "$HOME/.local/share/applications"
cp vlm-demo.desktop "$HOME/.local/share/applications/"