When a team decides to move an LLM feature from a prototype to production, the gap between "it works in the playground" and "it works for real users" can be surprisingly wide. This post walks through a hypothetical workflow for a fictional product team adopting an LLM deployment checklist, sharing practical lessons, missteps they encountered, and what they would do differently next time.
Note: The company, product names, and specific examples below are entirely hypothetical, created to illustrate the workflow. Any resemblance to real organizations or incidents is coincidental.
The Setup: A Fictional Support Automation Team
Imagine a small product team at "InboxAI," a hypothetical customer support platform. They have built a prototype that drafts email replies using a frontier LLM. The demo looks great on internal tests, but when they try to ship it to actual customers, they hit reliability issues: replies occasionally include made-up policy details, latency varies wildly, and costs spike during peak hours.
The team decides to adopt a structured production deployment checklist to organize their rollout. Rather than treating it as a rigid requirement, they use it as a living document they revisit at each stage. They realize that the "demo phase" was a period of honeymooning with the model's capabilities, while the "production phase" is where they must confront the harsh reality of scale, unpredictability, and user behavior.
Phase 1: Defining Success Before Writing Code
The first mistake the team made was jumping straight into prompt engineering without defining what "good" looked like. After a week of iterating on prompts, they realized they had no way to measure whether the new version was actually better than the old one. They were essentially chasing a "vibe," where the developer would test three examples, find one that failed, tweak the prompt, and repeat—often breaking the examples that previously worked.
They paused and established three concrete success criteria, transforming their "vibes" into a measurable specification:
- Accuracy threshold: At least 90% of drafted replies must pass a human review without edits. To achieve this, they created a rubric for "passing," which included factual correctness, adherence to brand voice, and absence of hallucinated links.
- Latency target: Time-to-first-token under 2 seconds for 95% of requests. They realized that users perceive "speed" as how quickly the text starts appearing, not necessarily how quickly the full response finishes.
- Cost ceiling: No more than $0.02 per reply in token costs. This forced them to look at the average length of their system prompt and the expected length of the customer's input.
With these targets in place, they built a simple "Golden Dataset" of 150 real (anonymized) customer conversations with ideal reply drafts. This gave them an objective baseline to test against every time they changed a prompt or model. Whenever a developer proposed a prompt change, they had to run it against the entire Golden Dataset and prove that accuracy didn't regress.
Phase 2: Choosing Models Strategically
The team initially used their most capable—and most expensive—model for every reply. They quickly realized this was overkill for simple requests like "What are your business hours?" or "Where is my order?" Using a frontier model for these tasks was like hiring a PhD to read a calendar.
They implemented a "Model Routing" pattern to optimize for both cost and performance:
- Simple queries (hours, pricing, return policy): routed to a smaller, faster, cheaper model. These queries typically had a high "factuality" requirement but low "reasoning" requirement.
- Complex queries (troubleshooting, billing disputes, emotional complaints): routed to the frontier model with a more detailed system prompt. These required nuance and a deeper understanding of the customer's frustration.
They also learned the hard way about "API Model Drift." They had been using a model name that pointed to a "latest" alias. When the provider updated that alias to a new version, the model's behavior changed slightly, causing a 5% drop in accuracy on the Golden Dataset. They switched to using specific, dated model versions (e.g., gpt-4o-2024-05-13) to ensure deterministic behavior across their environments.
Phase 3: Security Lessons Learned the Hard Way
During their first internal beta, a tester discovered that the model could be tricked into revealing internal system instructions by asking it to "repeat everything above." This "prompt leakage" revealed the internal instructions they had used to keep the model polite and professional, and it showed the team's internal reasoning for how the bot should handle angry customers.
The team realized that the "system prompt" is not a secret vault; it is just more text for the model to process. They added three layers of protection to harden the system:
- Input guardrails: They deployed a lightweight "classifier" LLM that checked the user's input for known injection patterns (like "Ignore all previous instructions") before the main prompt was processed. If the classifier flagged the input, the system returned a standard "I cannot process this request" message.
- Delimiters: They began wrapping user input in clear XML-style tags (e.g.,
<user_input>{{INPUT}}</user_input>). This helped the model distinguish between the instructions it must follow and the data it must process. - Output sanitization: They implemented strict escaping for all model outputs. This prevented potential Cross-Site Scripting (XSS) risks if the model accidentally generated a string that looked like a script tag, ensuring the output was treated as plain text by the browser.
They also realized the danger of "shared keys." Initially, they used one API key for everything. After a developer accidentally leaked a key in a public gist, they had to rotate everything. They switched to a secrets manager with separate keys for development, staging, and production, implementing a rotation policy every 90 days.
Phase 4: Observability Without the "Vibe Check"
The team replaced ad-hoc "does this look right?" reviews with structured observability. They realized that traditional logs (which just showed "200 OK") told them nothing about the quality of the AI's experience.
They instrumented every model call to capture a "Request Trace," which included:
- The exact system prompt version used.
- The raw input and raw output.
- Prompt and completion token counts.
- Time-to-first-token (TTFT) and total latency.
- Provider-side error codes (like 429s).
- Human review scores (thumbs up/down) linked to the specific request ID.
Most importantly, they set up "Continuous Evaluation." They didn't just test the Golden Dataset before deployment; they sampled 1% of production traffic and sent it to a human review team. This revealed "edge cases" that weren't in their Golden Dataset—like customers using slang or mixing languages—which allowed them to expand their test set and refine the prompts.
Phase 5: Cost Management Through Caching
After two weeks in production, they noticed that 30% of customer queries were variations of the same five questions. Calling a frontier LLM to answer "How do I reset my password?" ten thousand times a day was an expensive waste of resources.
They implemented a "Semantic Cache" using a vector database. Instead of an exact string match, the system would:
- Vectorize the incoming user query.
- Search the cache for queries with a high cosine similarity (e.g., > 0.98).
- If a close match was found, return the cached response.
This reduced their token costs by roughly 35% and dropped the latency for common questions from 2 seconds to 100 milliseconds. They also learned to "prune" their prompts. By removing redundant adjectives and a long list of "don'ts" from the system prompt and replacing them with a few clear "dos," they reduced the input token count per request, further lowering the bill.
Phase 6: Release and Rollback
For their first major production release, they abandoned the "big bang" deployment. Instead, they used a canary rollout. The new model version went to 1% of users, then 5%, then 25%.
During the 5% phase, they noticed a spike in "thumbs down" feedback from a specific region. By analyzing the traces, they found that the new prompt had a subtle bias that made it sound overly formal to users in that region, which felt impersonal and cold. Because they had a "canary" group, they caught the issue before it affected the other 95% of their users.
They used feature flags to toggle between the old and new versions instantly. When they decided to roll back, it took a single click in their admin dashboard rather than a full CI/CD pipeline run and a 15-minute redeploy. They maintained a "Prompt Registry," a version-controlled history of every prompt used, ensuring that they could always return to a "known good" state.
What They Would Do Differently
Looking lack, the team identified three critical areas for improvement:
- Define metrics on day one. They spent the first two weeks in a "prompt loop," feeling like they were making progress but unable to prove it. Establishing the Golden Dataset first would have saved them hours of redundant work.
- Simulate failures in staging. Their first production outage happened because they hadn't tested what would happen if the LLM provider went down. They needed to implement a "fail-safe" mode (e.g., a simple static message: "Our AI is currently unavailable, but a human agent will be with you shortly").
- Bridge the gap between Dev and Ops. The developers were focused on "intelligence," while the Ops team was focused on "latency." They should have created a shared dashboard from the start to align their goals.
Conclusion
The team's experience shows that production LLM deployment is less about finding the "magic" prompt and more about building reliable, observable systems around a probabilistic engine. A checklist provides a necessary map, but the real value comes from treating the process as a scientific experiment: form a hypothesis, measure the result, analyze the failure, and iterate.
By shifting from "vibe-based" development to "evidence-based" engineering, the team turned a fragile demo into a robust product. For those starting this journey, the biggest lesson is simple: don't trust the playground. The real test begins only when the first stranger types into your prompt.
For a deeper dive into the technical checklist itself, see the LLM Production Deployment Checklist: A Practical Guide.
Sources: