Skip to content

CICD-437 · Model response latency testing ​

Encyclopedia · AI and LLM application pipelines · All snippets

Previous · CICD-436 · Next · CICD-438

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites approved synthetic evaluation data, authorized model artifacts and pinned runtime tools.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters MODEL_BASE, MODEL_ID.

2. Copy the snippet ​

bash
curl -fsS --max-time 10 -o model.json -w '%{time_total}\n' "${MODEL_BASE:?}/v1/models"
jq -e --arg id "${MODEL_ID:?}" '.data | any(.id==$id)' model.json

3. How it works ​

The request checks the selected HTTP interface. Timeouts limit waiting, and an explicit exit or payload condition determines pass and fail. The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

This is a connectivity and model-readiness probe. Measure generation latency with a streamed completion as in CICD-450.

Validation syntax-validated (Bash parse). Status definitions.