ARL Sidecar User Guide
June 9, 2026 ยท View on GitHub
This guide explains how to integrate with the ARL FastAPI sidecar from a consumer application.
Key endpoints
-
GET /v1/health- Returns basic service status and whether the sidecar is active.
-
GET /v1/ready- Returns readiness and expected feature dimension checks.
- Fails with
503if the layer is not ready.
-
POST /v1/batch- Send a batch of features for monitoring and optional adaptation.
- Request body fields:
features: array of feature vectors, shape[n_rows, n_features]or single row.labels(optional): label array for immediate feedback.metadata(optional): additional metadata, includingbatch_idandregime.batch_id(optional): unique id for idempotent batch processing.regime_id/regime(optional): regime hint for routing.
-
POST /v1/batches/{batch_id}/labels- Reveal labels for a previously processed batch using its
batch_id. - Request body must include
labels.
- Reveal labels for a previously processed batch using its
-
POST /v1/batch/{step}/labels- Reveal labels for a batch by its numeric step index.
-
POST /v1/approve- Approve a pending recommendation when operating in
recommendmode. - Request body fields:
features: batch features matching the pending recommendation.approved_action: selected action such asadapt,reset,label_shift, ornone.approver: approving user or system identifier.
- Approve a pending recommendation when operating in
-
GET /v1/pending- Returns the currently pending recommendation in
recommendmode.
- Returns the currently pending recommendation in
-
POST /v1/operating-mode- Change runtime mode between
shadow,recommend, andbounded_auto. - Request body:
{ "mode": "bounded_auto" }.
- Change runtime mode between
-
GET /v1/audit/recent- Returns recent intervention audit records.
-
POST /v1/audit/export- Export audit history to a JSONL file in the configured audit directory.
- Request body may include
filename.
-
POST /v1/rollback/{snapshot_id}- Roll back the model adapter to a saved snapshot.
-
GET /v1/metrics- Debug endpoint exposing delayed feedback and runtime counters.
Request and response expectations
- The sidecar validates feature shape and rejects mismatched feature dimensions.
- If
batch_idis provided and duplicate batch IDs are not allowed, repeated requests will return an idempotent cached response. - Invalid payloads return
400with an error detail. - Missing batch labels on reveal endpoints return
400. - Missing or invalid
batch_idon reveal-by-id returns404.
Authentication
- The sidecar supports API key authentication with the configured
api_keyand optionaladmin_api_key. - Admin actions may require the admin key.
- If
require_api_keyis enabled, all paths except public health and metrics must present a valid key header.
Common integration patterns
- Start the sidecar in your deployment environment with a config file and required secrets.
- Send batches to
/v1/batchas your model scores data. - For delayed labels, call
/v1/batches/{batch_id}/labelsor/v1/batch/{step}/labelswhen labels arrive. - Use
/v1/operating-modeto move fromshadowtobounded_autoonly after validation. - Use
/v1/pendingand/v1/approveinrecommendmode to implement human-in-the-loop approvals. - Check
/v1/audit/recentand/v1/audit/exportto review intervention history.
Best practices
- Start in
shadowmode for evaluation before enablingbounded_auto. - Use
batch_idto make label association robust and idempotent. - If possible, send metadata such as
regimeorregime_idto improve controller context. - Treat
retrain_recommendedas an advisory signal for longer-term retraining workflows. - Use health and readiness endpoints in orchestration and service discovery checks.
Troubleshooting
503 readyfailure: check that the sidecar can load the model adapter and reference batches, and thatfeature_dimmatches.400 invalid payload: verify the request JSON containsfeatures, and ensure shapes and types are correct.404 no pending batch: confirm the batch ID or step exists and the label reveal request matches the original batch.401 unauthorized: verify the API key header name and value.409/idempotent_replayreturned: the batch was already submitted with the samebatch_idand duplicate requests are prevented.