AI › AI Tools

Comparing release-note summary prompts with Promptfoo

Run two release-note prompts against one local Ollama model and read JSON schema and factual failures side by side in Promptfoo.

Comparing release-note summary prompts with Promptfoo

I added more instructions to a Jekyll release-note prompt. The model moved the Ruby requirement into breaking changes and returned objects where the app expected strings. I ran both prompts through Promptfoo to see exactly what changed.

I ran Promptfoo 0.126.0 on Node.js 22.23.3 with Ollama 0.40.18. This evaluation made real local HTTP requests to qwen2.5:1.5b.

Give both prompts the same release notes

When I streamed a Jekyll summary into React, SmolLM2 skipped the Ruby 2.7 minimum. For this comparison, I reused the same Jekyll excerpt and ran both prompts on Qwen2.5 1.5B. Promptfoo takes the templates under prompts, the model under providers, and the inputs and expected values under tests. With one provider, I get a column per prompt and a row per input. Promptfoo quick start · Web viewer

I used two inputs. Jekyll 4.4.0 raised the Ruby minimum, let users select the lines that Liquid highlights in a code block, and added csv, base64, and json as explicit runtime dependencies. The second input describes a synthetic 1.2.0 release that adds CSV export and has no breaking changes. The Jekyll case checks where the runtime requirement goes. The synthetic case checks what the model does with an empty category. Jekyll 4.4.0 release notes

Change the prompt and keep the provider settings fixed

The short prompt specifies the JSON fields and their types. The detailed prompt also tells the model to keep technology and dependency names and put increases in the minimum runtime under breaking_changes. Promptfoo substitutes each test’s vars.notes into {{notes}} before sending the request. Both columns use the provider under the same configuration. Prompt configuration · Ollama provider

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# live.yaml
prompts:
  - label: Short JSON instruction
    raw: |
      Summarize these release notes in a JSON object with version (string),
      features (string array), and breaking_changes (string array).
      {{notes}}
  - label: Required facts and fields
    raw: |
      Return a JSON object with version (string), features (string array),
      and breaking_changes (string array). Copy the exact version.
      Preserve each feature, its technology name, and every dependency name.
      Put minimum runtime version increases in breaking_changes and include
      the runtime name and version. Use [] if the notes say there is no
      breaking change. Use only facts from these notes.
      {{notes}}
providers:
  - id: 'ollama:chat:qwen2.5:1.5b'
    config:
      format: json
      temperature: 0
      seed: 42
      num_predict: 320

I ran Ollama on 127.0.0.1:4432 and pulled the model to that instance. I set the provider’s format to json for both prompts so they both ran in JSON mode. Ollama also accepts a full JSON Schema as a generation constraint. I kept that option out of the comparison so I could see which field types each prompt produced under the same mode. Model tag · Ollama structured outputs

Score the response shape and the required facts

I registered two assertions under defaultTest.assert. The is-json assertion checks the three required keys and their types against an external JSON Schema. The JavaScript assertion checks the exact version, required feature terms, and the expected contents of the breaking changes array. The companion experiment on JSON summary checks has the relevant pieces of both files. Promptfoo assertions

1
2
3
4
5
6
7
8
defaultTest:
  assert:
    - type: is-json
      value: file://summary.schema.json
      metric: JSON schema
    - type: javascript
      value: file://release-facts.cjs
      metric: Release facts

Under tests, each entry has a description and vars. Put the release notes under vars.notes and give vars.expected a version and a featureTerms list. The Jekyll case also sets breakingTerm: 'Ruby 2.7'. The synthetic case omits that key so the check expects an empty array. I installed the CLI in the temporary project with npm install --save-exact promptfoo@0.126.0. I made a .promptfoo directory in that project and pointed PROMPTFOO_CONFIG_DIR at it so the evaluator and viewer would use the same local database. Configuration reference

1
2
3
4
5
OLLAMA_BASE_URL=http://127.0.0.1:4432 \
  npx --no-install promptfoo eval -c live.yaml \
  --max-concurrency 1 --no-cache --no-table -o live-results.json

npx --no-install promptfoo view

I ran one request at a time and disabled the Promptfoo cache to generate a fresh answer for each cell. I used the JSON export to compare the raw outputs and the local viewer to inspect individual cells. Run view as a separate command if your shell is configured to stop after a nonzero exit.

Read the four real model responses

The Ollama log showed four POST /api/chat requests, all HTTP 200. All four outputs parsed as JSON. The evaluation recorded 1 pass, 3 failures, and 0 errors. The CLI returned 100 because the outputs failed checks. The HTTP status tells me whether I received a response. The assertion results tell me what that response contains. CLI exit codes

InputShort instructionDetailed instruction
Jekyll 4.4.0Passed the schema. It put Ruby 2.7 in features and left breaking_changes empty.It placed the runtime in breaking changes and used object elements in the arrays. Both assertions failed.
Synthetic CSV export 1.2.0Passed both checks with a CSV export feature and an empty breaking_changes array.It returned object elements and put version 1.1.0 in breaking changes, even though the input never mentioned it. Both assertions failed.

Promptfoo results showing Ruby 2.7 in features for the short prompt and a string type error at features[0] for the detailed prompt Figure 1. The local Promptfoo viewer shows real responses from Ollama. In the Jekyll row, the left cell leaves Ruby 2.7 out of breaking changes. The right cell fails the schema because its first feature is an object.

I checked the full responses in live-results.json. The detailed Jekyll answer contained Ruby and 2.7 as separate values in a breaking-change object. The detailed response to the synthetic CSV release added version 1.1.0, which was absent from the source. My fact check expects a list of strings. Once the schema fails, I open the output before interpreting its missing-term messages. The short Jekyll answer has the right shape, so its factual failure points to the field I should inspect.

Use the failure to pick the next test

What I want to checkHow I’d run it
Whether wording changes the generated answerHold the model and notes fixed and vary the prompt.
Whether the checks catch a known errorFeed them fixed responses with deliberate mistakes.
Whether the application can depend on a schemaTest the provider’s schema constraint separately and validate the returned value.

The observed result covers one model and two inputs. Before choosing a prompt for a release pipeline, I would add more cases with unchanged compatibility, runtime upgrades, and long notes. I keep the exact input, generated response, and failed field with each result so I can tell whether a later edit fixes the problem I observed.

This post is licensed under CC BY 4.0 by the author.