Request Recompute Metrics
POST /api/v2/metrics/model/request_recompute_metrics
Description
The request_recompute_metrics
endpoint initiates the re-computation of metrics for a specific Arcanna model. This endpoint is useful when you want to refresh model performance statistics after new training data has been added or when you suspect metrics may be outdated. The re-computation process runs asynchronously in the background.
Quick Start Examples
Request metrics recomputation for a specific model
curl -X POST "https://your.arcanna.ai/api/v2/metrics/model/request_recompute_metrics?job_id=1234&model_id=generic-1-1234-model-1747385873.hdf5" \
-H "X-Arcanna-Api-Key: your-api-key-here" \
-H "Content-Type: application/json"
Request Parameters
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
job_id | integer or string | Yes | The ID or name of the job associated with the model |
model_id | string | Yes | The unique identifier of the model to recompute metrics for |
Response
Success Response (200 OK)
{
"message": "Metrics recomputation initiated successfully",
"job_id": 1234,
"model_id": "generic-1-1234-model-1747385873.hdf5",
"status": "queued",
"requested_at": "2025-01-15T14:30:00Z"
}
Error Response (404 Not Found)
{
"error": "Model not found",
"details": "Model 'generic-1-1234-model-1747385873.hdf5' not found for job '1234'"
}
Error Response (422 Validation Error)
{
"detail": [
{
"loc": ["query", "model_id"],
"msg": "Model ID is required",
"type": "value_error"
}
]
}
Response Fields
Success Response Fields
- message: Confirmation that the recomputation request was successful
- job_id: The ID of the job associated with the model
- model_id: The unique identifier of the model
- status: Current status of the recomputation request ('queued', 'in_progress', 'completed', 'failed')
- requested_at: Timestamp when the recomputation was requested
Important Notes
Asynchronous Processing
- The metrics recomputation runs asynchronously in the background
- The endpoint returns immediately after queuing the request
- Use the Model Metrics endpoint to check the
is_recomputing_metrics
flag andlast_recomputed_timestamp
When to Use
- After adding significant amounts of new training data
- When model metrics appear outdated or inconsistent
- Before important model evaluations or reports
- After manual corrections to the knowledge base
- As part of regular maintenance schedules
Use Cases
- Refresh model performance metrics after training data updates
- Ensure accurate metrics before model deployment decisions
- Maintain up-to-date performance statistics for reporting
Monitoring Recomputation Status
You can monitor the status of metrics recomputation using the Model Metrics endpoint:
curl -X GET "https://your.arcanna.ai/api/v2/metrics/model?job_id=1234&model_id=generic-1-1234-model-1747385873.hdf5" \
-H "X-Arcanna-Api-Key: your-api-key-here"
Check the is_recomputing_metrics
field in the response:
true
: Recomputation is currently in progressfalse
: Recomputation is complete or not running