ML Services Warmup
ML services may experience cold starts when they haven’t been called for a while. The warmup system allows you to pre-warm these services before making actual requests, ensuring faster response times for your users.
Services Warmed
The following ML services are included in the warmup:
- Active Speaker Detection (ASD) - Detects if the speaker in the video is actively speaking
- Visual Speech Recognition (VSR) - Recognizes speech from lip movements
- Face Liveness Detection - Detects if the face in the video is live
- Voice Recognition - Identifies users by their voice
- Face Match - Matches faces between images/videos
Trigger Warmup
Authorization
This endpoint requires an API token as Bearer in the Authorization header. Go to Authorization guide for details.
Request
POST https://api.biometrysolutions.com/api-gateway/warmupParameters
- No parameters are required for this endpoint.
Headers
- Authorization* - Your API Token.
Responses
The object with message, warmup_required and services fields.
message- Status message describing the warmup resultwarmup_required- Boolean indicating if any services needed warming upservices- Object containing the warmup status of each service
Response sample:
{ "message": "warmup completed", "warmup_required": true, "services": { "Active Speaker Detection": { "service_name": "Active Speaker Detection", "status": "completed", "duration_ms": 1250 }, "Visual Speech Recognition": { "service_name": "Visual Speech Recognition", "status": "completed", "duration_ms": 890 }, "Face Liveness Detection": { "service_name": "Face Liveness Detection", "status": "completed", "duration_ms": 1100 }, "Voice Recognition": { "service_name": "Voice Recognition", "status": "completed", "duration_ms": 750 }, "FMC": { "service_name": "FMC", "status": "completed", "duration_ms": 920 } }}Sample
Request
curl --location 'https://api.biometrysolutions.com/api-gateway/warmup' \ --request POST \ --header 'Authorization: Bearer eyJhbGciO...ANYea8r2xOG-Urc'Response
{ "message": "warmup completed", "warmup_required": true, "services": { "Active Speaker Detection": { "service_name": "Active Speaker Detection", "status": "completed", "duration_ms": 1250 }, "Visual Speech Recognition": { "service_name": "Visual Speech Recognition", "status": "completed", "duration_ms": 890 } }}If all services are already warm:
{ "message": "all services already warm", "warmup_required": false, "services": { "Active Speaker Detection": { "service_name": "Active Speaker Detection", "status": "completed", "last_warmup_at": "2025-01-15T10:00:00Z", "expires_at": "2025-01-15T10:05:00Z" } }}Get Warmup Status
Check the current warmup status of all ML services.
Authorization
This endpoint requires an API token as Bearer in the Authorization header. Go to Authorization guide for details.
Request
GET https://api.biometrysolutions.com/api-gateway/warmup/statusParameters
- No parameters are required for this endpoint.
Headers
- Authorization* - Your API Token.
Responses
The warmup state record containing all services and their current status.
Response sample:
{ "id": "warmup_state", "services": { "Active Speaker Detection": { "service_name": "Active Speaker Detection", "status": "completed", "last_warmup_at": "2025-01-15T10:00:00Z", "expires_at": "2025-01-15T10:05:00Z", "duration_ms": 1250 }, "Visual Speech Recognition": { "service_name": "Visual Speech Recognition", "status": "completed", "last_warmup_at": "2025-01-15T10:00:00Z", "expires_at": "2025-01-15T10:05:00Z", "duration_ms": 890 } }, "updated_at": "2025-01-15T10:00:00Z"}Sample
Request
curl --location 'https://api.biometrysolutions.com/api-gateway/warmup/status' \ --request GET \ --header 'Authorization: Bearer eyJhbGciO...ANYea8r2xOG-Urc'Warmup with Session Start
You can also trigger warmup when starting a session by adding the warmup=true query parameter. This triggers the warmup in the background and returns immediately with the session ID.
Request
POST https://api.biometrysolutions.com/api-gateway/sessions/start?warmup=trueSee the Sessions documentation for more details.
Sample
curl --location 'https://api.biometrysolutions.com/api-gateway/sessions/start?warmup=true' \ --request POST \ --header 'Authorization: Bearer eyJhbGciO...ANYea8r2xOG-Urc'Service Status Values
| Status | Description |
|---|---|
pending | Service has not been warmed up yet |
in_progress | Warmup is currently in progress |
completed | Service is warm and ready |
failed | Warmup failed (check error_message for details) |
Warmup TTL
Services are considered “warm” for 5 minutes after a successful warmup. After this TTL expires, the next warmup request will re-warm the service.