cookbook · product · pricing-quote
Recipe · product

Quotes that never lie about price.

A local .kolm file that drafts a pricing quote from a customer profile (seats, usage, term, region, discount tier). The verifier reads your canonical price-table.json at compile time and rejects any output where a line-item price disagrees with the table by more than $0.

base modelqwen2.5-coder-7b
gold pairs120 (60 train / 60 eval)
k-score floor0.90
artifact size2.4 GB
compile time~32 min
spec sourceprice-table reconciler

What this recipe does

LLMs make up numbers. Pricing quotes can't have made-up numbers. This recipe is the only way we know to ship a free-form pricing assistant without a chance of hallucinated discounts: every price the model emits is reconciled against your price-table.json at compile time, and any candidate that fails the reconcile is dropped from the training set.

The model learns the structure of a quote (line items, tier logic, term math, applicable discounts) but is never asked to invent prices. The verifier confirms every output matches the table to the cent.

The spec

{
  "output_kind": "json",
  "schema": {
    "required": ["line_items", "subtotal", "discount", "total", "term_months", "valid_until"],
    "properties": {
      "line_items": { "type": "array", "items": {
        "required": ["sku", "qty", "unit_price", "line_total"],
        "properties": {
          "sku": { "type": "string" },
          "qty": { "type": "integer" },
          "unit_price": { "type": "number" },
          "line_total": { "type": "number" }
        }
      } },
      "subtotal": { "type": "number" },
      "discount": { "type": "number" },
      "total": { "type": "number" },
      "term_months": { "enum": [12, 24, 36] },
      "valid_until": { "type": "string", "format": "date" }
    }
  },
  "verifier": {
    "price_table": "price-table.json",
    "reconcile_unit_price": true,
    "reconcile_line_math": true,
    "reconcile_total_math": true,
    "discount_tier_must_match_profile": true
  }
}

Gold pairs (1 of 120 shown)

input
{
  "company": "Northwind Logistics",
  "seats": 45,
  "plan": "team",
  "term_months": 24,
  "region": "us-east",
  "discount_tier": "early-renewal"
}
output - reconciled to price-table.json
{
  "line_items": [
    {"sku": "team-seat-monthly", "qty": 1080, "unit_price": 49.00, "line_total": 52920.00}
  ],
  "subtotal": 52920.00,
  "discount": 7938.00,
  "total": 44982.00,
  "term_months": 24,
  "valid_until": "2026-06-09"
}

Compile

kolm compile "draft pricing quote, reconcile to price-table" \
  --base qwen2.5-coder-7b \
  --pairs pairs.jsonl \
  --price-table price-table.json \
  --verifier reconcile-strict \
  --k-floor 0.90 \
  --output pricing-quote.kolm

ok wrote pricing-quote.kolm
   k_score=0.94  signature=hmac-sha256

K-score gate

K-score 0.94 held-out 60 quotes · price-reconcile 100% · tier-match 100% · line-math 100% · CRO-rated useful 92%

The 100% reconcile rate is by construction: the verifier rejects any candidate output whose unit prices don't appear in price-table.json verbatim. We do not let the model have a "creative" pass on numbers — only on which SKUs apply to which customer profile.

Run-time profile

M2 MacBook
1.6s
RTX 5090
390ms
iPhone 15 Pro
4.4s
CPU x86 (server)
5.6s

Deploy

# salesforce flow — runs in the apex action that builds the quote pdf:
String profile = JSON.serialize(opportunityProfile);
String quote   = KolmRuntime.run('pricing-quote.kolm', profile);
PriceTable.reconcile(quote, priceTableJson);  // belt-and-suspenders
QuotePdf.fromJson(quote);