From 5f17e1a0572ff927955e09bb5847bd223b1ddef8 Mon Sep 17 00:00:00 2001 From: Michael Bunsen Date: Tue, 16 Sep 2025 21:37:25 -0700 Subject: [PATCH 1/3] feat: enable real classifiers in local dev by default --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e1588478d..8f8c4c0ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -149,9 +149,9 @@ services: ml_backend: build: - context: ./processing_services/minimal + context: ./processing_services/example volumes: - - ./processing_services/minimal/:/app + - ./processing_services/example/:/app ports: - "2005:2000" networks: From 77a5793adae6583eedcee838e91a1bb9dc3748f3 Mon Sep 17 00:00:00 2001 From: Michael Bunsen Date: Tue, 13 Oct 2026 15:03:53 -0700 Subject: [PATCH 2/3] feat(dev): keep the example service's downloaded models across rebuilds The local stack now runs the example service as ml_backend, which downloads its models on first use. Without a cache volume every rebuild downloaded them again. Also describes which service each stack runs. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01TNNRg9NDr6opFZgK3nxx5C --- docker-compose.yml | 3 +++ processing_services/README.md | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 82710ab75..794e6ecbc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ volumes: minio_data: driver: local node_modules: + ml_backend_model_cache: services: django: &django @@ -190,6 +191,8 @@ services: context: ./processing_services/example volumes: - ./processing_services/example/:/app + # Hugging Face and torch downloads survive container rebuilds; the first start downloads the models. + - ml_backend_model_cache:/root/.cache ports: - "2005:2000" networks: diff --git a/processing_services/README.md b/processing_services/README.md index 48bb254e7..9850db0e2 100644 --- a/processing_services/README.md +++ b/processing_services/README.md @@ -11,8 +11,8 @@ In this directory, we define locally-run processing services as FastAPI apps. A - `/process`: receives source images and existing detections via a `PipelineRequest` and returns a `PipelineResponse` containing detections `processing_services` contains 2 apps: -- `example`: demos how to add custom pipelines/algorithms. -- `minimal`: a simple ML backend for basic testing of the processing service API. This minimal app also runs within the main Antenna docker compose stack. +- `example`: demos how to add custom pipelines/algorithms with real models. It runs as `ml_backend` in the main Antenna docker compose stack for local development, so jobs there produce real detections and classifications. The first start downloads the models into the `ml_backend_model_cache` volume, which keeps them across rebuilds; `docker volume rm` it to download again. +- `minimal`: a simple ML backend with no models and fixed outputs, for testing the processing service API. The CI stack (`docker-compose.ci.yml`) uses it, and it can be started next to the main stack with `docker compose -f processing_services/docker-compose.yml up -d ml_backend_minimal`. If your goal is to run an ML backend locally, simply copy the `example` app and follow the steps below. From 680678680baf102f9cd007bcd9e775524988bc1a Mon Sep 17 00:00:00 2001 From: Michael Bunsen Date: Tue, 13 Oct 2026 15:30:45 -0700 Subject: [PATCH 3/3] docs(processing-services): state the size of the first model download in local dev Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01TNNRg9NDr6opFZgK3nxx5C --- processing_services/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing_services/README.md b/processing_services/README.md index 9850db0e2..cf61c8315 100644 --- a/processing_services/README.md +++ b/processing_services/README.md @@ -11,7 +11,7 @@ In this directory, we define locally-run processing services as FastAPI apps. A - `/process`: receives source images and existing detections via a `PipelineRequest` and returns a `PipelineResponse` containing detections `processing_services` contains 2 apps: -- `example`: demos how to add custom pipelines/algorithms with real models. It runs as `ml_backend` in the main Antenna docker compose stack for local development, so jobs there produce real detections and classifications. The first start downloads the models into the `ml_backend_model_cache` volume, which keeps them across rebuilds; `docker volume rm` it to download again. +- `example`: demos how to add custom pipelines/algorithms with real models. It runs as `ml_backend` in the main Antenna docker compose stack for local development, so jobs there produce real detections and classifications. The first job downloads the models (about 3.6 GB for the zero-shot pipelines; about a minute on a fast connection) into the `ml_backend_model_cache` volume, which keeps them across rebuilds; `docker volume rm` it to download again. - `minimal`: a simple ML backend with no models and fixed outputs, for testing the processing service API. The CI stack (`docker-compose.ci.yml`) uses it, and it can be started next to the main stack with `docker compose -f processing_services/docker-compose.yml up -d ml_backend_minimal`. If your goal is to run an ML backend locally, simply copy the `example` app and follow the steps below.