Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
The biggest mistake in shipping AI features is committing a quarter of roadmap before validating that the model can actually do the job at acceptable quality. The fix is a time-boxed spike: a day or two of throwaway code that proves (or disproves) feasibility on real examples from your domain. AI features are uniquely prone to looking trivial in a demo and falling apart on your actual messy data, so a spike de-risks the bet cheaply. Sizing the bet this way — spike, then commit — is how mature teams avoid sinking weeks into a feature the model was never going to nail.
A minimal spike: run the real task on a handful of representative examples and eyeball pass/fail. The goal is a fast feasibility signal, not production code.
Use these three in order. Each builds on the one before.
In one paragraph, explain what a feasibility 'spike' is and why it matters before building an AI feature.
Walk me through how to design a quick spike that tells me whether the model can do my task on real data.
After a spike that passes 70% of the time, how would you decide whether the gap is closeable and worth committing to?
// A throwaway spike: does the model do the job on YOUR examples?
// npm i openai
import OpenAI from "openai";
const client = new OpenAI();
const examples = [
{ input: "real messy ticket #1 from your DB", expected: "billing" },
{ input: "real messy ticket #2 from your DB", expected: "bug" },
{ input: "real messy ticket #3 from your DB", expected: "feature_request" },
];
let passed = 0;
for (const ex of examples) {
const res = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{ role: "system", content: "Classify the ticket as billing, bug, or feature_request. Reply with only the label." },
{ role: "user", content: ex.input },
],
});
const got = res.choices[0].message.content.trim();
if (got === ex.expected) passed++;
console.log(ex.expected, "->", got);
}
console.log("spike pass rate:", passed + "/" + examples.length);node main.js