mysi Find

Calculator in Business and startups

Model price drop stress test

Works out gross margin and profit after LLM prices fall, keeping the saving or passing it on.

In short

FormulatodayGrossProfit = monthly_revenue × gross_margin_percent_today ÷ 100cost = monthly_revenue − todayGrossProfittodayNonAiCost = cost − monthly_ai_costFor each drop d, in percent:newAiCost = monthly_ai_cost × (1 − d ÷ 100)new cost = todayNonAiCost + newAiCostnewGrossProfitKeepSavings = monthly_revenue − new costnewGrossMarginKeepSavings = newGrossProfitKeepSavings ÷ monthly_revenue × 100newRevenueIfPassThrough = monthly_revenue × (1 − monthly_ai_cost ÷ cost × d ÷ 100)newGrossProfitPassThrough = newRevenueIfPassThrough − new costnewGrossMarginPassThrough = newGrossProfitPassThrough ÷ newRevenueIfPassThrough × 100Results are rounded to 2 decimals.
UnitsUS dollars a month; margins and drops in percent.
Defaultsmonthly_revenue = 100000, monthly_ai_cost = 15000, gross_margin_percent_today = 60, price_drop_scenarios = [10, 30, 50]. Margin and each drop from 0 to 100; monthly_ai_cost at most the cost.
Worked example$100,000 revenue, 60% margin, $15,000 AI cost. todayGrossProfit = 100000 × 0.60 = 60000todayNonAiCost = 40000 − 15000 = 25000At a 50% drop the new cost is 25000 + 7500 = 32500, so gross profit kept is 100000 − 32500 = 67500Passed through, revenue is 100000 × (1 − 15000 ÷ 40000 × 50 ÷ 100) = 81250 and gross profit 81250 − 32500 = 48750Kept: 61500, 64500, 67500; passed through: 57750, 53250, 48750

By hand: yes. A small model got these answers from the formulas above, without running code.

Say this to your agent

Use https://mysi.dev/model-price-drop-stress-test/ to stress-test my margin: $100,000 revenue a month, 60% margin, $15,000 AI cost.

Nothing to install, no key, no settings. An agent that can open web pages and run Python opens the page, runs the tested code in its own sandbox and gives you the answer.

The code

Copy this into your Python tool. Run model_price_drop_stress_test_check() first, then call model_price_drop_stress_test() with your numbers. Give the answer with the cite line.

"""Model price drop stress test: gross margin and gross profit after a fall in LLM prices,
when you keep the saving and when your own prices fall in step.
Inputs: monthly_revenue (0 to 1e12 USD), monthly_ai_cost (0 to 1e12 USD, part of cost of revenue,
at most revenue x (1 - margin)), gross_margin_percent_today (0 to 100),
price_drop_scenarios (1 to 10 drops, each 0 to 100 percent, default [10, 30, 50]).
Returns todayGrossProfit and todayNonAiCost (USD a month), and one list entry per drop:
newAiCost, newGrossMarginKeepSavings, newGrossMarginPassThrough (percent), newRevenueIfPassThrough,
newGrossProfitKeepSavings, newGrossProfitPassThrough (USD a month). All rounded to 2 decimals.
mysi, Model price drop stress test, mysi.dev/model-price-drop-stress-test, version 1,
changed 2026-12-04. MIT.
"""
import math


def _model_price_drop_stress_test_num(name, value, low, high):
    if isinstance(value, bool) or not isinstance(value, (int, float)) or not low <= value <= high:
        raise ValueError(f"{name} must be a number from {low} to {high}")
    return float(value)


def _model_price_drop_stress_test_r2(x):
    return math.floor(x * 100 + 0.5) / 100  # cents, halves rounded up


def model_price_drop_stress_test(monthly_revenue=100000, monthly_ai_cost=15000,
                                 gross_margin_percent_today=60, price_drop_scenarios=(10, 30, 50)):
    num, r2 = _model_price_drop_stress_test_num, _model_price_drop_stress_test_r2
    rev = num("monthly_revenue", monthly_revenue, 0, 1e12)
    ai = num("monthly_ai_cost", monthly_ai_cost, 0, 1e12)
    margin = num("gross_margin_percent_today", gross_margin_percent_today, 0, 100)
    drops = price_drop_scenarios
    if not isinstance(drops, (list, tuple)) or not 1 <= len(drops) <= 10:
        raise ValueError("price_drop_scenarios must be a list of 1 to 10 numbers from 0 to 100")
    drops = [num("price_drop_scenarios", d, 0, 100) for d in drops]
    profit = rev * (margin / 100)
    cogs = rev - profit
    if ai > cogs + 0.005:
        raise ValueError(f"monthly_ai_cost must be at most the cost of revenue, {cogs:.2f}")
    non_ai = max(0.0, cogs - ai)
    share = ai / cogs if cogs > 0 else 0.0
    out = {"todayGrossProfit": r2(profit), "todayNonAiCost": r2(non_ai)}
    keys = ["newAiCost", "newGrossMarginKeepSavings", "newGrossMarginPassThrough",
            "newRevenueIfPassThrough", "newGrossProfitKeepSavings", "newGrossProfitPassThrough"]
    for k in keys:
        out[k] = []
    for d in drops:
        new_ai = ai * (1 - d / 100)
        new_cogs = non_ai + new_ai
        keep_margin = (rev - new_cogs) / rev * 100 if rev > 0 else 0.0
        pass_rev = max(0.0, rev - rev * share * (d / 100))  # prices fall by the cost saving's share
        pass_margin = (pass_rev - new_cogs) / pass_rev * 100 if pass_rev > 0 else 0.0
        row = [new_ai, keep_margin, pass_margin, pass_rev, rev - new_cogs, pass_rev - new_cogs]
        for k, v in zip(keys, row):
            out[k].append(r2(v))
    return out


MODEL_PRICE_DROP_STRESS_TEST_CASES = [
    ({"monthly_revenue": 100000, "monthly_ai_cost": 15000, "gross_margin_percent_today": 60,
      "price_drop_scenarios": [10, 30, 50]},
     {"todayGrossProfit": 60000, "newGrossMarginKeepSavings": [61.5, 64.5, 67.5],
      "newGrossProfitPassThrough": [57750, 53250, 48750]}),
    ({"monthly_revenue": 10000, "monthly_ai_cost": 2000, "gross_margin_percent_today": 50,
      "price_drop_scenarios": [50]},
     {"todayNonAiCost": 3000, "newGrossProfitKeepSavings": [6000],
      "newRevenueIfPassThrough": [8000], "newGrossProfitPassThrough": [4000]}),
    ({"monthly_revenue": 200000, "monthly_ai_cost": 30000, "gross_margin_percent_today": 80,
      "price_drop_scenarios": [20, 100]},
     {"newGrossMarginKeepSavings": [83, 95], "newRevenueIfPassThrough": [170000, 50000],
      "newGrossMarginPassThrough": [80, 80]}),
]


def model_price_drop_stress_test_check(tolerance=1e-3):
    for given, want in MODEL_PRICE_DROP_STRESS_TEST_CASES:
        got = model_price_drop_stress_test(**given)
        for name, value in want.items():
            pairs = zip(got[name], value) if isinstance(value, list) else [(got[name], value)]
            for g, v in pairs:
                assert abs(g - v) <= tolerance * max(1, abs(v)), (name, got[name], value)
    return "ok"


if __name__ == "__main__":
    import json, sys
    model_price_drop_stress_test_check()
    given = dict(a.split("=", 1) for a in sys.argv[1:] if "=" in a)
    js = lambda v: v.lstrip("-")[:1].isdigit() or v[:1] in '[{".' or v in ("true", "false", "null")
    given = {k: json.loads(v) if js(v) else v for k, v in given.items()}
    if given:
        print(json.dumps(model_price_drop_stress_test(**given)))
Raw file

Scenarios for planning, not a forecast of prices.

What it takes

InputMeaningDefaultAllowed
monthly_revenueRevenue a month, in US dollars1000000 to 1,000,000,000,000
monthly_ai_costLLM and AI spend a month in US dollars; part of cost of revenue, so at most revenue × (1 − margin)150000 to 1,000,000,000,000
gross_margin_percent_todayGross margin today, in percent (60 = 60%)600 to 100
price_drop_scenariosThe LLM price drops to test, 1 to 10 of them, each in percent from 0 to 10010,30,50a list

What it returns

OutputMeaning
todayGrossProfitRevenue × margin today, US dollars a month
todayNonAiCostCost of revenue minus the AI cost, US dollars a month, held fixed in every scenario
newAiCostThe AI cost after each drop, US dollars a month, one entry per drop
newGrossMarginKeepSavings, newGrossProfitKeepSavingsGross margin (percent) and gross profit (US dollars a month) after each drop when your prices stay the same
newRevenueIfPassThroughRevenue after each drop when your prices fall in step with your cost, US dollars a month
newGrossMarginPassThrough, newGrossProfitPassThroughGross margin (percent) and gross profit (US dollars a month) after each drop with that pass-through

Where the method comes from

This is cost-of-revenue arithmetic. Today's gross margin fixes the cost of revenue; the AI spend is one part of it and the rest stays fixed. Each scenario cuts the AI spend by the given percentage and shows two ends of what can happen. If you keep your prices, the whole saving becomes gross profit. If competition pushes your prices down in step with your costs, revenue falls by the AI share of the cost of revenue times the drop, the gross margin stays where it was and gross profit shrinks with revenue. The truth usually lies between the two.

The drops are scenarios, not a forecast. For how fast LLM prices have fallen, see Appenzeller, "Welcome to LLMflation" (a16z, 2024). The method assumes that non-AI costs do not change with the AI price and that a price cut does not change how much customers buy.

Sources

Tested

Tested 4 Dec 2026: claude-haiku-5-5 was right on 0 of 3 questions without this page and 3 of 3 with it; claude-fable-5-2 was right on 0 of 3 questions without this page and 3 of 3 with it.

Changes

Cite as: mysi, Model price drop stress test, mysi.dev/model-price-drop-stress-test, version 1, changed 2026-12-04. Code MIT.