Executive Summary
GenAI Protos deployed a private image segmentation API using SAM 3.1 on DGX Spark. The service supports text-prompted, box-prompted, and point-click segmentation, returns PNG masks, and includes lazy loading, idle unload, health checks, and gateway pass-through access.
The focus is practical deployment: model packaging, gateway integration, operational controls, and reusable API access for product and engineering teams.
The content stays close to the documented technical build and avoids unsupported adoption or ROI claims.
At a Glance
- Use case
- Private object segmentation API for image workflows.
- Prompt types
- Text prompts, bounding boxes, and point clicks.
- Output
- PNG masks with object metadata.
- Model size
- 848M-parameter segmentation model.
- Lifecycle
- Lazy load on first request and idle unload after inactivity.
- Gateway role
- Authenticated pass-through routes for segmentation and operations
The Challenge
- Segmentation models are valuable only when they can be integrated into annotation tools, asset systems, document pipelines, or product workflows.
- Different users need different prompt modes: plain-language object prompts, bounding boxes, or point clicks.
- The build needed to support private image processing while exposing enough operational controls for reliable use.
What GenAI Protos Built
- Packaged SAM 3.1 behind a FastAPI segmentation API.
- Supported text, bounding-box, and point-click segmentation inputs.
- Returned mask PNGs and segmentation metadata for downstream workflows.
- Added preload, unload, model listing, and health routes through the private gateway.
- Used lazy loading and idle unload behavior to reduce resource use when inactive.
Solution Architecture
The architecture separates the application interface, gateway layer, model service, runtime, and operations lane so the model can be consumed as a reusable private AI capability rather than a one-off local experiment.
- User interface
- Annotation, image-processing, document, or product workflow submits images and prompts.
- Gateway layer
- Provides authenticated routing and consistent private model access.
- Segmentation API
- Accepts image files and prompt parameters, validates input, and returns structured output.
- SAM 3.1 runtime
- Generates masks from text, boxes, or points.
- Output layer
- Returns PNG masks and metadata for downstream editing or extraction.
- Operations lane
- Lazy load, idle unload, preload, and health controls support service operations.
Prompt-to-Output Workflow
The segmentation workflow shows how images and prompt types move through the private gateway, segmentation API, SAM runtime, mask output, and downstream visual workflows.
An application submits an image with a text prompt, bounding box, or point-click instruction.
The gateway forwards the request to the segmentation API.
The model loads on first use if not already active.
SAM 3.1 generates one or more masks and returns results as encoded PNG assets with metadata.
The downstream workflow uses the masks for extraction, editing, annotation, or analysis.
Implementation Highlights
This section captures prompt flexibility, reusable mask output, on-demand lifecycle controls, custom gateway routes, and operational visibility for the private segmentation service.
- Prompt flexibility
- The API supports text, box, and point prompts so different user interfaces can share one model service.
- Mask output
- Segmentation results are returned as reusable PNG masks and structured result metadata.
- On-demand lifecycle
- Lazy loading and idle unload avoid keeping memory occupied when segmentation is inactive.
- Custom gateway routes
- Pass-through routes expose segmentation because the workflow is not a standard chat or speech endpoint.
- Operational visibility
- Health and model routes make the service easier to monitor and preload.
Measured Technical Details
The value of this service is not only mask generation. The stronger pattern is making segmentation available as a private computer vision API that can support real annotation, editing, extraction, and analysis workflows.
Why This Matters
The value of this service is not only mask generation. The stronger pattern is making segmentation available as a private computer vision API that can support real annotation, editing, extraction, and analysis workflows.
Results
GenAI Protos delivered an API-ready private AI service that can be discovered, called, monitored, and operated through the same model-serving pattern used across the wider private AI catalog.
| Outcome | What changed |
|---|---|
| Private vision API | Segmentation became available as a governed internal API instead of an isolated model. |
| Multiple interaction modes | Teams can build text, box, or click-based segmentation workflows on one service. |
| Resource-aware serving | Lazy load and idle unload reduce standing resource usage. |
| Reusable computer vision pattern | The same API packaging pattern can support other visual AI services with custom inputs and outputs. |
Reusable Pattern
This pattern can be reused for visual AI services that need custom image inputs, structured artifact outputs, on-demand loading, and downstream workflow integration.
- Design APIs around how users actually prompt the model, not around model internals.
- Return artifacts and metadata together so downstream systems can automate around the results.
- Use on-demand lifecycle controls for visual models that may be used in bursts.
- Avoid publishing internal routes while keeping the public story technically specific.
Build Private Computer Vision APIs for Real Product Workflows
GenAI Protos helps teams package segmentation and visual AI models into private services with clean APIs, lifecycle controls, and downstream integration.
Get custom solutions