Skip to main content
Label Studio · SAM · Docker · Supabase · MinIO · Cloudflare Tunnel

Overview

As of 2026-04, the upstream Label Studio ML backend does not provide a maintained SAM3 production deployment path. This project fills that gap: a Docker Compose stack that bundles Label Studio, PostgreSQL, Redis, MinIO, Nginx, and a Cloudflare Tunnel as the core service set, with optional GPU overlays for SAM3 and SAM2.1 image and video inference backends. The Label Studio database backend uses Supabase standalone (the v1.1.x main line). For native PostgreSQL mode, switch to the v1.0.4 release line.

Core features

  • make up brings up the full core stack (Label Studio + PostgreSQL + Redis + MinIO + Nginx + Cloudflare Tunnel)
  • SAM3 backend: native point embeddings (image + video), mask selection modes (adaptive / top1 / topk / threshold / all), bidirectional video tracking, multi-object track merging, runtime threshold and mode UI overrides
  • SAM2.1 backend: image and video inference
  • SAM3 Agent (optional): LLM-assisted mask selection, compatible with vLLM, Ollama, OpenAI, Gemini, Groq, and any vision-capable endpoint
  • Batch annotation: run SAM3 or SAM2.1 inference over an entire Label Studio project from the CLI or from a browser-based Web UI with no terminal required
  • Separate env files (.env / .env.ml / .env.supabase / .env.tools) to keep per-scope variables isolated
  • Optional Cloudflare Tunnel routes for admin interfaces (Supabase Studio, RedisInsight, etc.)

Inference backends

Optional GPU overlays provide three inference backends; pick by task:

Architecture

Quick start

1

Clone the repo and prepare env files

Fill in all <PLACEHOLDER> values. LABEL_STUDIO_USER_TOKEN has a 40-character limit; generate one with openssl rand -hex 20. The POSTGRES_PASSWORD in .env and .env.supabase must match.
2

Start Supabase and the core stack

make init-minio is a one-time command that initialises MinIO buckets and service accounts. Open http://localhost:18090 to confirm Label Studio is running.
3

Attach GPU inference backends (optional)

Use a Legacy Token from the Label Studio account page, not a Personal Access Token.
4

Verify stack health

Notes

ML backends require a Legacy Token, not a Personal Access Token. For Label Studio S3 access to MinIO, use the dedicated service-account keys (MINIO_LS_ACCESS_ID / MINIO_LS_SECRET_KEY), never the root credentials. Rotate the MinIO service-account keys immediately after first deployment. After changing .env, recreate containers with down + up rather than only restart, which does not pick up env changes.

In practice

Used for annotating precision livestock imagery: SAM auto-generates initial masks, which annotators then correct, significantly faster than fully manual labelling. Batch annotation mode processes an entire Label Studio project of images or video in one command, well-suited to the initial segmentation pass on large datasets.