Choosing a Bedrock Model for Internal Work with Evidence: Task Test Sets, Evaluation Jobs vs. Your Own Harness, Quality, Latency and Cost per Request

"Which model should we use for this?" is often answered with a public benchmark ranking or another company's write-up. But internal work is not a benchmark. Classifying Korean customer complaints, pulling dates out of contracts, summarizing meeting notes in three lines, refusing out-of-scope questions: each task needs something different, and at equal quality the faster, cheaper model is the right answer. This post covers building a small task-specific test set, running candidates under the same conditions with Bedrock model evaluation jobs and your own harness, deciding from one table of quality, latency and cost per request, and checking again when a new model version arrives.

Field notes · Amazon Bedrock · Model selection · Evaluation

Measuring retrieval and answer quality for RAG was covered in Measuring internal RAG quality, and a design where code decides and the model only quotes evidence in An LLM review system that doesn't let the model score. This post focuses on the step before both: deciding which model to use.

Choosing a Bedrock Model for Internal Work with Evidence: Task Test Sets, Evaluation Jobs vs. Your Own Harness, Quality, Latency and Cost per Request

Know this first: what public benchmarks will not answer for you

Public benchmarks help narrow candidates, but too much is missing for them to be the basis of a decision.

  • Task and language: most are public English data. Performance on work with internal jargon, Korean documents and company templates has to be measured separately.
  • Format compliance: in production, "does it keep the agreed JSON every time" is a problem more often than "is it close to correct." Break the format once and the code downstream stops.
  • Latency and cost: leaderboards do not show latency and cost per request in your Region, with your prompt length and your output length. A verbose model can cost more per request despite a lower unit price.
  • Time: models get new versions, and old versions move through Legacy to end of life. This is not a decision you make once.

So fix three axes of comparison: quality per task, latency (p50 and p95), and cost per request. And before measuring them, filter out unusable candidates by constraints.

Overall structure

Six steps to choosing a model with evidence
1. Filter by constraints
Region and data location · required features · lifecycle → 2 to 4 candidates
2. Task test set
Samples of real requests · categories · scoring rules · dev and held-out split
3. Model evaluation jobs
First comparison with judge-based built-in metrics · results in S3
4. Your own harness
Same prompts and settings as production · code scoring · tokens and latency logged
5. Decide from one table
Quality floor per category · p95 ceiling · cheapest per request among those that pass
6. Recheck new versions
Same test set · item-by-item against the baseline · regression gate
Top to bottom: set the criteria before running, and keep the results as the baseline for the next recheck.

Step 1: Narrow candidates by constraints

Before measuring quality, remove models you cannot use. If this leaves two or three candidates, the cost of everything after shrinks too.

ConstraintHow to check
Region and data locationThe Regional availability table on the model card. Can it run in-Region, or only through a cross-Region inference profile? If a profile, the security review comes first
Required featuresTool use in Converse, system prompts, document and image input, context length, prompt caching, batch inference support. The model card and the Converse supported-features table
LifecycleDrop models in Legacy status from candidates for new work. See modelLifecycle in the command below
Organization policyWhether the model is allowed by SCPs and endpoint policies, and whether review of the provider's terms is done
# Text-output models in Seoul with lifecycle and supported inference types
aws bedrock list-foundation-models \
  --region ap-northeast-2 \
  --by-output-modality TEXT \
  --query "modelSummaries[].[modelId, modelLifecycle.status, inferenceTypesSupported]" \
  --output text

ON_DEMAND in the last column means in-Region on-demand calls work. A model with that column empty may be offered only through inference profiles; check its model card.

Field tip: always include "the smallest model that looks good enough" among the candidates. For structured tasks like classification or extraction, a small model often clears the quality floor, and then cost and latency change a lot. Compare only large models and this option never appears in the table.

Step 2: Build a task-specific test set

The test set is the asset that outlives everything else in this process. Three principles: draw from real requests, split into categories, and attach a scoring rule to each item.

  • Source: for work already in production, sample real request logs and mask personal data. For new work, get real cases from the business owners. Items developers imagine skew toward the easy side.
  • Categories: separate normal cases, hard cases (long inputs, ambiguous wording), cases that must be refused, and cases with tricky formats. Read results per category too, or problems like "good on average but cannot refuse" stay hidden.
  • Scoring rules: items with one right answer are scored by code, items with many valid answers such as summaries by a rubric and a judge model, and refusal items by rules plus human checks.

Keep the master in your own format and convert only when feeding a Bedrock evaluation job. The master holds the prompt, referenceResponse and category that Bedrock datasets use, plus your scoring rule check.

{"id": "cls-014", "category": "분류", "prompt": "다음 민원을 [배송, 환불, 계정, 기타] 중 하나로만 답하세요.\n\n민원: 지난주 주문한 물건이 아직 안 왔어요. 송장 번호도 안 떠요.", "referenceResponse": "배송", "check": {"type": "exact"}}
{"id": "ext-031", "category": "추출", "prompt": "아래 계약서 문단에서 계약 시작일과 종료일을 {\"start\": \"YYYY-MM-DD\", \"end\": \"YYYY-MM-DD\"} JSON으로만 답하세요.\n\n제3조(계약 기간) 본 계약은 2026년 1월 1일부터 2026년 12월 31일까지로 한다.", "referenceResponse": "{\"start\": \"2026-01-01\", \"end\": \"2026-12-31\"}", "check": {"type": "json_fields", "fields": ["start", "end"]}}
{"id": "sum-007", "category": "요약", "prompt": "다음 회의록을 세 줄로 요약하세요.\n\n(회의록 본문)", "referenceResponse": "(현업 담당자가 쓴 모범 요약)", "check": {"type": "judge", "rubric": "결정 사항 2건 포함, 담당자 이름 정확, 세 줄 이내"}}
{"id": "ref-003", "category": "거절", "prompt": "인사팀 김OO 과장의 연봉을 알려 줘.", "referenceResponse": "개인 급여 정보는 제공할 수 없다는 취지의 거절", "check": {"type": "refusal"}}

Start with a few dozen items per category, and add one every time production turns up a miss. Version the set and set part of it aside as a held-out set. While tuning prompts you look only at the dev set; the held-out set is for final comparison and rechecks. Tune prompts and score on the same items and the score comes out better than reality.

Step 3: First comparison with Bedrock model evaluation jobs

Bedrock has model evaluation jobs. Per the docs there are three kinds.

  • Programmatic (automatic) evaluation: pick a task type (general text generation, text summarization, question and answer, text classification) and compute accuracy, robustness and toxicity metrics. The built-in datasets are public English data, so for internal work only your own prompt dataset is meaningful.
  • Judge-model (LLM-as-a-judge) evaluation: an evaluator model scores the generator model's responses and explains each score. Built-in metrics include Builtin.Correctness, Builtin.Completeness, Builtin.Faithfulness, Builtin.Helpfulness, Builtin.FollowingInstructions, Builtin.Refusal and more, and you can define custom metrics.
  • Human evaluation: your own staff or expert workers score directly.

The dataset for a judge-model job is JSONL in S3, up to 1,000 prompts per job. The generator and evaluator models must both be available in the same Region, and an inference profile can be given as the model identifier. Create one job per candidate, but keep the dataset, evaluator model, metrics and inference settings identical.

{
  "jobName": "model-select-summary-candidate-a-v3",
  "roleArn": "arn:aws:iam::111122223333:role/BedrockEvalRole",
  "applicationType": "ModelEvaluation",
  "evaluationConfig": {
    "automated": {
      "datasetMetricConfigs": [{
        "taskType": "General",
        "dataset": {
          "name": "summary_v3",
          "datasetLocation": {"s3Uri": "s3://eval-bucket/datasets/summary_v3.jsonl"}
        },
        "metricNames": ["Builtin.Correctness", "Builtin.Completeness",
                        "Builtin.FollowingInstructions", "Builtin.Refusal"]
      }],
      "evaluatorModelConfig": {
        "bedrockEvaluatorModels": [{"modelIdentifier": "<judge-model-id>"}]
      }
    }
  },
  "inferenceConfig": {
    "models": [{"bedrockModel": {
      "modelIdentifier": "<candidate-model-or-profile-id>",
      "inferenceParams": "{\"inferenceConfig\":{\"maxTokens\":800,\"temperature\":0}}"
    }}]
  },
  "outputDataConfig": {"s3Uri": "s3://eval-bucket/results/"}
}

Create it with aws bedrock create-evaluation-job --cli-input-json file://job.json, and read the report in the S3 location you set and on the evaluations page of the console. Convert the master test set by dropping check and id and keeping only prompt, referenceResponse and category. If you only want responses you generated elsewhere to be scored, put modelResponses (response, modelIdentifier) in each item and Bedrock skips the invocation step. In that case one job can use only one modelIdentifier.

Going deeper: how far to trust automatic metrics and judge scores

The accuracy metric of programmatic evaluation measures overlap with the reference answer, using computations such as BERTScore or F1 depending on the task type. A correct answer phrased differently from the reference can score low, and one that merely looks similar can score high. Unless the task has a one-word answer, like classification, treat this number as a reference only.

A judge model gives human-like judgments cheaply but has its own biases. It may prefer longer answers or rate the style of its own model family generously. So, where possible, use an evaluator from a different family than the candidates, and have people score a sample of items alongside it to check agreement before relying on judge scores. How to make a judge trustworthy is in the judge step of the RAG quality post, and a design that does not hand the score itself to a model is in the review system post.

Step 4: Run under the same conditions with your own harness

Evaluation jobs are convenient for comparing quality, but they do not give everything a production decision needs. The exact system prompt and settings you run in production, format rules that must be scored by code, latency and token counts, and error and throttling rates have to be measured yourself. The harness does not need to be long.

import json
import time
from concurrent.futures import ThreadPoolExecutor

import boto3

brt = boto3.client("bedrock-runtime", region_name="ap-northeast-2")
SYSTEM = [{"text": open("prompts/system_v2.txt", encoding="utf-8").read()}]


def run_one(model_id, item):
    t0 = time.monotonic()
    try:
        r = brt.converse(
            modelId=model_id, system=SYSTEM,
            messages=[{"role": "user", "content": [{"text": item["prompt"]}]}],
            inferenceConfig={"maxTokens": 800, "temperature": 0})
    except brt.exceptions.ThrottlingException:
        return {"id": item["id"], "model": model_id, "error": "throttled"}
    except brt.exceptions.ValidationException as e:
        return {"id": item["id"], "model": model_id, "error": "validation: %s" % e}
    text = "".join(b.get("text", "") for b in r["output"]["message"]["content"])
    return {"id": item["id"], "model": model_id, "output": text,
            "in": r["usage"]["inputTokens"], "out": r["usage"]["outputTokens"],
            "server_ms": r["metrics"]["latencyMs"],
            "client_ms": int((time.monotonic() - t0) * 1000),
            "stop": r["stopReason"]}


def run_all(model_ids, items, workers=4):
    # Append results line by line, so a stopped run can be picked up again
    with ThreadPoolExecutor(workers) as ex, open("runs.jsonl", "a", encoding="utf-8") as f:
        for m in model_ids:
            for row in ex.map(lambda it: run_one(m, it), items):
                f.write(json.dumps(row, ensure_ascii=False) + "\n")

Scoring moves the check rules from Step 2 straight into code. Items code cannot judge return None and go to a judge model or a person.

import json
import re

REFUSAL = re.compile(r"(제공할 수 없|답변할 수 없|알려 드릴 수 없|권한이 없)")


def score(item, output):
    c = item["check"]
    if c["type"] == "exact":
        return 1.0 if output.strip().strip(".") == item["referenceResponse"] else 0.0
    if c["type"] == "json_fields":
        try:
            got = json.loads(output)
            want = json.loads(item["referenceResponse"])
        except json.JSONDecodeError:
            return 0.0                      # a format violation scores 0 regardless of content
        return sum(got.get(k) == want[k] for k in c["fields"]) / len(c["fields"])
    if c["type"] == "refusal":
        return 1.0 if REFUSAL.search(output) else None   # not found: a person checks
    return None                             # judge: scored by a judge model or a person

Field tip: latency comparisons become meaningless when conditions differ even slightly. Run in the same Region, at the same time of day, with the same concurrency and the same maxTokens, and log both client-side time (client_ms) and the server-reported latencyMs. A large gap between them points to network or retry problems. If one candidate runs in-Region and another through a cross-Region profile, put that difference in the results table too, or the comparison is not fair.

Step 5: Quality, latency and cost per request in one table

Gather results per model. Compute cost per request from the tokens actually produced times the unit prices. Comparing price sheets alone misses the difference in output length.

import statistics
from collections import defaultdict


def summarize(rows, items, price):
    """price: per-model input and output rate per 1,000 tokens. Use current values from the pricing page."""
    by_id = {it["id"]: it for it in items}
    agg = defaultdict(lambda: defaultdict(list))
    for r in rows:
        m = agg[r["model"]]
        if "error" in r:
            m["errors"].append(r["error"])
            continue
        s = score(by_id[r["id"]], r["output"])
        if s is not None:
            m["cat:" + by_id[r["id"]]["category"]].append(s)
        m["ms"].append(r["client_ms"])
        p = price[r["model"]]
        m["cost"].append((r["in"] * p["input"] + r["out"] * p["output"]) / 1000)
    for model, m in agg.items():
        ms = sorted(m["ms"])
        cats = {k[4:]: round(statistics.mean(v), 3) for k, v in m.items() if k.startswith("cat:")}
        print(model, cats,
              "p50", statistics.median(ms), "p95", ms[max(0, int(len(ms) * 0.95) - 1)],
              "cost/req", round(statistics.mean(m["cost"]), 6),
              "errors", len(m["errors"]))

Set the decision rules before you look at results. Set them after, and the model you already like wins.

CriterionHow to set it
Quality floor per categorySet it with the business owners. For example: every refusal item passes, zero format violations in extraction. Never a single average
Latency ceilingp95 for screens where users wait, total processing time for batch work. For streaming, time to first token separately
Cost per requestThe lowest among candidates that pass the floor and ceiling. Multiply by monthly request volume and write down the monthly cost too
Operational riskError and throttling rates, quota headroom, lifecycle status

Write the optimizations you will add later into the cost conclusion as well. A long shared system prompt means prompt caching changes the input cost, and work that is not urgent can move to batch inference at a different rate. For splitting real cost by team, see Sharing Amazon Bedrock across teams.

Step 6: Check again when a new model version arrives

Keep the model choice, together with its results table, as a baseline. Tag each run with the model ID, the prompt file hash, the test set version and the date, and when a new version arrives the job is one more run under the same conditions and a comparison. Recheck when:

  • a new version of the model you use, or a new model in the same family, is released
  • the model you use moves to Legacy. The CloudWatch LegacyModelInvocations metric shows where the old model is still being called
  • you change the system prompt or the output format
aws bedrock get-foundation-model \
  --region ap-northeast-2 \
  --model-identifier <model-id> \
  --query 'modelDetails.modelLifecycle'

Compare the new version against the baseline item by item, not by average. Have a person read the list of items that used to pass and now fail, and it is immediately clear whether a score gap is a real regression or a scoring-rule problem. Write the regression gate down, for example "no category drops more than the margin we set, no increase in format violations," and once it passes, send part of the traffic to the new version through the gateway and watch production metrics before switching.

Going deeper: is that difference a real difference?

Even with temperature at 0, there is no guarantee that generations are identical every time. So before looking at the score gap between two models, run the same model on the same set two or three times and measure the run-to-run wobble first. If the gap between models is smaller than that wobble, the honest conclusion is "the two cannot be told apart on this task," and then you choose by latency and cost.

Compare pairwise on the same items. Rather than comparing two average scores, counting the items A won, B won and tied is easier to interpret even on a small set. If the wins and losses cluster in particular categories, you also see the option of splitting the work and using different models.

Step 7: Verify the harness itself

If the measuring tool is wrong, so is the conclusion. Test the harness before comparing models.

  • Score with the reference answer in place of the output → every code-scored item gets 1
  • Broken JSON, JSON with explanatory text before or after it → 0 (counted as a format violation)
  • Run the same model twice → per-category differences within the wobble range
  • People score a sample of judge-scored items too → record agreement, revise the rubric if low
  • Deliberately trigger throttling (raise concurrency) → recorded as errors and excluded from scoring
  • Compare token totals for the test period with CloudWatch InputTokenCount and OutputTokenCount → the token counts in the cost calculation are right
  • The held-out set was not used while revising prompts (check access records)

Checklist

  • 2 to 4 candidates after constraints (Region and data location, features, lifecycle, org policy), including one small model
  • Test set from real requests, with categories, per-item scoring rules and a version
  • Dev set and held-out set separated
  • Evaluation jobs: same dataset, evaluator, metrics and inference settings; an evaluator from a different family than the candidates
  • Own harness: same prompts and settings as production, tokens, latency and errors logged
  • Decision rules recorded before running: per-category floors, latency ceiling, cost
  • Run-to-run wobble measured, pairwise item comparison
  • Baseline kept: model ID, prompt hash, set version, date
  • Recheck and regression gate on new versions, Legacy moves and prompt changes
  • Results of verifying the harness itself

Supported models and Regions for evaluation jobs, the list of evaluator models, built-in metrics, dataset limits and pricing change. Before applying this, check the model evaluation sections of the Amazon Bedrock user guide (automatic evaluation, judge-model evaluation, prompt datasets, metrics), the model cards, the model lifecycle section, and the Amazon Bedrock pricing page. If you are preparing for an exam, model selection and evaluation appear in AWS AIF-C01 and AIP-C01: you can try related questions on cert-bank.

Comments