DEV Community

Quinn Li
Quinn Li

Posted on

Deadline Work Does Not Belong on a Free Lane

Free capacity is a discount only when nobody is waiting on the clock. The moment a job has a merge window, a customer callback, or a page that must clear before standup, queue delay becomes the invoice. Token stickers stop mattering.

You already know a cheaper model is not cheap if it strands a release. This note is about the fork that comes before the first token: which jobs may sit on a best-effort lane, and which jobs you should refuse to start there at all.

Sticker price lies because it hides the other meter. Tokens are billed in thousands. Delay is billed in people. A thirty-minute stall on a patch that unblocks five reviewers is not a rounding error. It is a meeting you just bought with “free.”

Think of two highway lanes that look identical until it rains. The unclocked lane is a frontage road. Batch evals, prompt diffs, overnight summaries, and chaos rehearsals can idle there. The clocked lane is the expressway you pay for because a missed window costs more than the toll. Mixing them is how a quiet Tuesday turns into a war room.

Agents make the mix-up worse. A loop that “just calls the model” assumes the lane is hot. Free capacity is not hot. It is leftover. Leftover moves when someone else shows up. If your agent retries, summarizes, then retries again while it waits, you are not saving money. You are burning the clock and the token budget on a job that should never have entered that queue.

Label this next part as a rehearsal, not a production forecast. You need a number you can argue with, not a dashboard fantasy. The only question the scorer answers is: how many minutes of delay equal one paid run? If expected wait is longer than that break-even, the free lane is the expensive one.

# rehearsal_only.py — labeled example, not live metrics
from dataclasses import dataclass

@dataclass(frozen=True)
class Job:
    name: str
    clocked: bool           # merge window, page, customer wait
    delay_usd_per_min: float
    paid_run_usd: float
    free_run_usd: float     # usually 0; still count your own time later
    expected_wait_min: float
    replayable: bool

def delay_invoice(job: Job) -> float:
    return job.delay_usd_per_min * job.expected_wait_min

def break_even_minutes(job: Job) -> float:
    premium = job.paid_run_usd - job.free_run_usd
    if job.delay_usd_per_min <= 0:
        return float("inf")
    return premium / job.delay_usd_per_min

def admit_free_lane(job: Job) -> str:
    if job.clocked:
        return "paid"  # never start a clocked job on leftover capacity
    if not job.replayable:
        return "paid"  # free lanes can vanish mid-flight
    if job.expected_wait_min > break_even_minutes(job):
        return "paid"
    return "free"

if __name__ == "__main__":
    jobs = [
        Job("ci-gate", True, 4.00, 1.20, 0.0, 25, True),
        Job("prompt-sweep", False, 0.05, 2.40, 0.0, 90, True),
        Job("customer-draft", True, 6.50, 0.80, 0.0, 12, False),
        Job("nightly-summaries", False, 0.02, 3.10, 0.0, 180, True),
    ]
    print(f"{'job':22} {'lane':5} {'wait':>6} {'break_even':>11} {'delay$':>8}")
    for j in jobs:
        lane = admit_free_lane(j)
        be = break_even_minutes(j)
        be_s = "inf" if be == float("inf") else f"{be:.1f}m"
        print(f"{j.name:22} {lane:5} {j.expected_wait_min:5.0f}m {be_s:>11} {delay_invoice(j):8.2f}")
Enter fullscreen mode Exit fullscreen mode

Run it as a dry argument, then replace the dollar guesses with numbers your team already believes. A reviewer-hour at $4/min is crude. It is still better than pretending wait is free. Notice ci-gate: twenty-five minutes of expected wait against a $1.20 paid run. The break-even is a fraction of a minute. The free lane loses before the prompt is even built.

$ python rehearsal_only.py
job                    lane    wait  break_even   delay$
ci-gate                paid     25m        0.3m   100.00
prompt-sweep           free     90m       48.0m     4.50
customer-draft         paid     12m        0.1m    78.00
nightly-summaries      free    180m      155.0m     3.60
Enter fullscreen mode Exit fullscreen mode

Those printed minutes are inputs you typed, not a benchmark I measured on your cluster. Change them. If your on-call hour is worth more than a reviewer hour, the paid lane wins even faster. If a nightly summary can slip to morning, the free lane is doing its actual job: soaking work that has no audience yet.

Admission control has to happen before enqueue, not after the first timeout. Starting on free and migrating mid-flight is how you pay twice. You spend tokens on a partial run, then you spend them again on the paid lane, and the clock kept running through both. The gate below refuses that bargain. It reads a job ticket and exits non-zero when someone tries to aim a clocked job at leftover capacity.

# admit_gate.py — CI / wrapper. Fail closed on a clock.
import os, sys, json, pathlib

ALLOWED_FREE = {"free", "best-effort", "spare"}

def load_ticket(path: str) -> dict:
    data = json.loads(pathlib.Path(path).read_text())
    for key in ("name", "clocked", "replayable", "lane"):
        if key not in data:
            raise SystemExit(f"ticket missing {key}")
    return data

def main() -> int:
    ticket = load_ticket(sys.argv[1] if len(sys.argv) > 1 else "job.json")
    requested = os.environ.get("MODEL_LANE", ticket["lane"]).lower()
    using_free = requested in ALLOWED_FREE
    if ticket["clocked"] and using_free:
        print(f"refuse: {ticket['name']} is clocked; do not start on {requested}")
        return 2
    if using_free and not ticket["replayable"]:
        print(f"refuse: {ticket['name']} cannot be replayed if the spare box vanishes")
        return 3
    print(f"admit: {ticket['name']} -> {requested}")
    return 0

if __name__ == "__main__":
    raise SystemExit(main())
Enter fullscreen mode Exit fullscreen mode

Keep the ticket boring. One file per job. No poetry in the JSON. Clocked is a boolean you set when a human is blocked, not when a sprint goal exists on a slide.

{
  "name": "ci-gate",
  "clocked": true,
  "replayable": true,
  "lane": "paid",
  "deadline": "2026-09-09T16:00:00Z"
}
Enter fullscreen mode Exit fullscreen mode

Wire it in the same shell that used to export a model endpoint and hope. Hope is not a lane. The wrapper below is loud on purpose. If someone exports a free lane for a clocked ticket, the build dies before it spends a token.

# labeled example — put in front of your runner
export MODEL_LANE="${MODEL_LANE:-paid}"
python admit_gate.py job.json || exit $?

if [ "$MODEL_LANE" = "paid" ]; then
  python run_job.py --endpoint "$PAID_ENDPOINT" --ticket job.json
else
  python run_job.py --endpoint "$FREE_ENDPOINT" --ticket job.json
fi
Enter fullscreen mode Exit fullscreen mode

Where does leftover capacity still earn its keep? On the unclocked side. Eval sweeps that can rerun. Prompt diffs you will throw away. Logbook summaries nobody will read until tomorrow. That is the traffic you want off the paid endpoint so the expressway stays empty for the clock.

Disclosure: This article was prepared as part of MonkeyCode's product outreach. MonkeyCode currently offers free model access and a free server option. Treat both as best-effort leftover, the frontage road in the analogy, not an SLA. Use them to drain replayable batch work, or to run the scorer and the gate until the numbers feel less fake. Do not aim a merge-blocking agent at that spare box and then act surprised when the queue breathes.

Expected wait is the input people want to skip. Do not skip it. If you have no histogram, start with a mean you already observe on idle nights versus weekday noon, and mark it guess. A guessed wait that you write down beats an implicit wait of zero. Recalculate when a job slips. The scorer is a conversation starter, not a prophet.

Delay dollars are also a guess, and that is fine if you pick a conservative one. Take fully loaded engineer cost, divide by minutes in a focus block, and only count people who are actually blocked. A waiting CI that nobody is watching is unclocked, even if the pipeline is “important.” A waiting CI that is holding a release train is clocked even if the model call costs pennies.

Replayability is the third switch and the one free lanes punish you for ignoring. If the prompt carries a one-time secret, a customer transcript you cannot resend, or a tool call that already mutated production, the job is not a candidate for leftover capacity. The box can disappear. Your partial side effects will not. Paid lane, or no model call.

Limitations pile up quickly, which is the point of an ops note. This rehearsal does not know your GPU queue, your region, or your vendor’s fair-use mood. It does not estimate tokens. It will happily recommend the paid lane for almost every clocked job, even when the paid endpoint is itself slow. If both lanes are congested, you do not have a discount problem. You have a capacity problem, and a scorer will not mint new machines.

You should not use this approach if your work cannot leave the building, if a shared free server is a data-policy violation, or if “replayable” is a story you tell without a stored ticket. You should not use it as a license to dump secrets onto spare hardware. You should not use it to justify an agent that polls a best-effort model until a human deadline explodes. The gate exists to make that agent fail closed.

Skip it too if you have no clocked work. Some teams only run overnight batches. For them the free lane is the product. Paying to skip a queue nobody is watching is how you light money on fire in the other direction. The wrong bet has two faces. One is parking a release on leftover capacity. The other is buying an expressway for a job that can sleep.

A small habit keeps the two faces apart. Write the ticket first. Run the gate. Then pick an endpoint. If you find yourself negotiating after the first timeout, you already lost the accounting. The migration will feel responsible. It is just a more expensive way to admit you used the wrong lane.

If you need a spare box for work that can slip and replay, MonkeyCode’s free server option is a reasonable place to park that unclocked lane while you keep paid capacity for the clock. That is the whole invitation. Measure the wait. Protect the deadline. Let leftover capacity do leftover work.

Top comments (0)