CICD-436 · Token consumption benchmarking
Encyclopedia · AI and LLM application pipelines · All snippets
Previous · CICD-435 · Next · CICD-437
1. Where it fits
- Placement CI evidence step.
- Prerequisites approved synthetic evaluation data, authorized model artifacts and pinned runtime tools.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
jq -s '{requests:length,prompt_tokens:map(.usage.prompt_tokens)|add,completion_tokens:map(.usage.completion_tokens)|add}' reports/model-responses.jsonl3. How it works
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
Use provider usage fields or the exact engine tokenizer. Compare matched inputs and output constraints.
Watch for. Use the intended trusted execution context. Keep secret values out of traces, artifacts and debug output.
Validation syntax-validated (Bash parse). Status definitions.