Skip to content

Remote machine learning

Add a second computer: faster search and faces on your home network Watch on YouTube

Got a small server, such as a Raspberry Pi, and a more powerful desktop or laptop nearby? Run Frameleaf’s machine learning container on the bigger computer and get faster smart search and face detection without upgrading your server. The server sends image previews to that computer for processing, and the machine learning container doesn’t keep them or link them to a user.

Smart search and face detection use the remote container. Grouping faces into people doesn’t, because it works from results already saved in the database.

  1. Install Docker on the remote computer.
  2. Save this as docker-compose.yml on the remote computer:
name: frameleaf_remote_ml
services:
frameleaf-machine-learning:
container_name: frameleaf_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
# Example tag: ${FRAMELEAF_VERSION:-latest}-cuda
image: ghcr.io/frameleaf/frameleaf-machine-learning:${FRAMELEAF_VERSION:-latest}
# extends:
# file: hwaccel.ml.yml
# service: # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn]
volumes:
- model-cache:/cache
restart: always
ports:
- 3003:3003
volumes:
model-cache:
  1. Start it with docker compose up -d.
  2. On your Frameleaf server, go to Settings, then Search & intelligence, and open Advanced: the computer’s address.
  3. Click Add address, enter the remote container’s address, for example http://192.168.1.50:3003, and select Save changes.

You can also add it in Settings, then Computers & background work, then Computers: under Add a computer, choose Connect by address. In Add computer, fill in:

  • Name, required, for example Office desktop. Where work runs and the list of computers use it.
  • URL, the remote container’s address, for example http://192.168.1.50:3003.
  • Access token, the value of FRAMELEAF_ML_AUTH_TOKEN on the worker, if you set one. It’s stored on the server and never shown again.
  • Allowed work, the kinds of work it may run, for example Visual search and Faces & identity.

Then choose Save. Each address becomes a destination you can route work to and check. See Workers and where jobs run.

To use a GPU on the remote computer, also add hwaccel.ml.yml and follow Hardware acceleration.

Each address in the list becomes a computer you can send work to. Library work that has no route yet goes to the first address in the list; the order sets nothing else. To send work to the remote computer, choose it for each kind of work (faces, visual search, text, descriptions) in Settings, then Computers & background work, then Computers, under Where work runs. See Workers and where jobs run.

If everything runs on the remote computer, you can remove the local address and the frameleaf-machine-learning service from your server’s Compose file to save resources. At least one address must stay in the list.

Each kind of work goes to one computer. To share one kind of work across several computers, put a load balancer in front of them and use its address for that work. That also lets you mix configurations on one computer, for example an OpenVINO container next to a CUDA one, or a CPU container alongside a GPU one to use both.

One machine learning container can serve several Frameleaf servers, even if they use different models, though that raises peak memory use.

A computer added by address works on everyone’s photos, like the server’s own machine learning container. A computer that joins through Frameleaf Desktop starts with only the photos of the account signed in on it; see Whose photos each computer works on. Either kind counts as home, so it also takes the photos of people who chose Only at home in Where your photos are processed.

The remote container downloads each model the first time a job needs it, from the same model source as the server’s own container, and keeps it in its model-cache volume. To point it at a mirror of your own, see Where models come from. To run it with no internet access, see Model staging.