Pitfalls and Best Practices for Production LLM Applications

humanloop · Tech · 2023 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production LLM application development and LLMOps platform practice

Humanloop observed that teams building LLM applications often treat prompts, retrieval choices, model selection, evaluation, and production feedback less rigorously than traditional software artifacts, which causes teams to abandon viable use cases, thrash between approaches, or deploy costly and hard-to-monitor systems.

Constraints:

Architecture

Humanloop frames a production LLM app as traditional application software wrapped around an LLM block: a base model, a prompt template, and a data-selection or retrieval strategy. The recommended operating system around that block includes prompt-management infrastructure, structured evaluation during development and production, user-feedback capture, regression checks before prompt/model changes, and selective fine-tuning when prompt engineering and retrieval have reached their limits. For sensitive fine-tuned data, the talk treats access isolation and adapter-style separation as an open design area rather than a solved pattern.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  Traditional_application_shell["Traditional application shell"] --> LLM_block["LLM block"]
  LLM_block --> Base_or_fine_tuned_model["Base or fine-tuned model"]
  LLM_block --> Prompt_template["Prompt template"]
  LLM_block --> Context_selection_strategy["Context selection strategy"]
  Context_selection_strategy --> Prompt_template
  Prompt_template --> Prompt_management_system["Prompt management system"]
  Prompt_management_system --> Evaluation_and_monitoring_loop["Evaluation and monitoring loop"]
  Evaluation_and_monitoring_loop --> Production_feedback_capture["Production feedback capture"]
  Production_feedback_capture --> Evaluation_and_monitoring_loop
  Evaluation_and_monitoring_loop --> Fine_tuning_data_flywheel["Fine-tuning data flywheel"]
  Fine_tuning_data_flywheel --> Base_or_fine_tuned_model
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Traditional application shell Hosts the product workflow and invokes the LLM block from normal software. LLM block
LLM block Combines model choice, prompt template, and context-selection strategy into the LLM application unit. Base or fine-tuned model, Prompt template, Context selection strategy
Base or fine-tuned model Provides the generation capability, from hosted frontier models to custom fine-tuned smaller models. LLM block, Fine-tuning data flywheel
Prompt template Stores the instructions or template text into which application data is inserted. Prompt management system, LLM block
Context selection strategy Retrieves or selects relevant data, such as code context or RAG results, to include in the prompt. Prompt template
Prompt management system Versions prompts, records experiments, coordinates domain-expert and engineering collaboration, and controls promotion toward production. Prompt template, Evaluation and monitoring loop
Evaluation and monitoring loop Evaluates prompts, retrieval, model changes, production outcomes, and regressions. Production feedback capture, Prompt management system, Fine-tuning data flywheel
Production feedback capture Collects explicit votes, implicit actions, corrections, telemetry, and logs from production users. Evaluation and monitoring loop
Fine-tuning data flywheel Filters successful model outputs or feedback data into task-specific fine-tuning sets. Base or fine-tuned model

Data flow

A user request enters traditional application code; the app selects relevant context through retrieval or another selection strategy; the selected data is inserted into a prompt template; the configured base or fine-tuned model generates an output; production feedback, implicit actions, corrections, and logs feed evaluation and monitoring; successful feedback can later be filtered into fine-tuning data for task-specific models.

4 supporting quotes
“llm apps are composed of traditional software with blocks you know what I call an llm block which is a combination of some kind of base model”transcript, stated
“which is a set of instructions or a template into which data is going to be fed and some selection strategy for getting that data”transcript, stated
“they rely very heavily on end user feedback in production so they're looking at um when you get a suggestion from GitHub co-pilot was that suggestion accepted”transcript, stated
“people will generate data from their existing model they'll filter that data based on some success criteria and that criteria might be explicit user feedback”transcript, stated

Why this architecture

The architecture separates the pieces that are easy to conflate: model choice, prompt design, retrieval/context selection, feedback capture, evaluation, and deployment control. Humanloop argues that teams succeed when they measure these parts explicitly, preserve prompt and experiment history, start simple with strong models and prompts, and only introduce chains, agents, or fine-tuning after evidence shows they are needed.

4 supporting quotes
“fundamentally in order to get something to work well you've got to get all three of these pieces right”transcript, stated
“the importance of having objective evaluation if you can't measure things then you can't improve them”transcript, stated
“record a history of everything you're trying throughout experimentation right the way through from when you're playing in the playground”transcript, stated
“start with the best model that you can get your hands on so typically this is one of the the largest LM gpd4 cloud from anthropic whatever it might be”transcript, stated

Models used: GPT-4 · Claude · Anthropic models · OpenAI models · GPT-3.5 · custom fine-tuned open source models · Flan-T5 · Flan-UL2 · Falcon

Scale

Alternatives considered (roads not taken)

Eyeball prompt behavior in playgrounds without objective evaluation

Rejected because: Humanloop says this causes teams to give up too early or thrash among retrieval systems, chains, agents, and prompts without knowing whether quality is improving.

“they start off in the open AI playground and they're eyeballing a couple of examples they're trying things out”transcript, stated
“people just trying a lot of different things one after another changing the retrieval system trying chains trying agents doing different prompting strategies”transcript, stated

Store prompts only in ad hoc documents, spreadsheets, notebooks, or code

Rejected because: Ad hoc stores lose experiment history, while code-only prompt management creates friction for domain experts who need to collaborate on prompt design.

“prompt templates end up being stored in Excel or if they're collaborating with non-technical teammates they maybe put them on that in Google Docs as well”transcript, stated
“if you put everything into git and you should definitely do that but you don't also have a way for the non-technical experts to contribute to that or change it”transcript, stated

Start production design with complicated chains or agents

Rejected because: Humanloop recommends exhausting prompt engineering and strong base models first, because early chains and agents make failures harder to isolate and maintain.

“if you do it too soon it makes it harder to evaluate what isn't isn't working because you have multiple different places that you're changing things”transcript, stated
“I would only go to agents or chains if you're in a situation more complex chains if you're in a situation where reasoning is really important”transcript, stated

Rely indefinitely on the largest hosted model instead of task-specific fine-tuning

Rejected because: For narrow tasks, Humanloop says smaller fine-tuned models can reduce cost and latency while using proprietary feedback data to improve task performance.

“the consequences of not doing this that's what my slide says our increased cost and latency Reliance on models are larger than you need”transcript, stated
“fine-tuning can be very effective and we see this kind of often underestimated and people are very surprised when they try this”transcript, stated

Share one fine-tuned model across users with different training-data permissions

Rejected because: The speaker treats cross-permission fine-tuned model sharing as unsolved and suggests separate models or adapter-style isolation as possible mitigations.

“I don't think there is a very clear-cut solution to this yet I think this is like something that people are still working on”transcript, stated
“you might want to have something like adapters um so these are like lightweight things like low rank basically changes to the model”transcript, stated

Patterns

eval-driven-development (evaluation)

Humanloop recommends making objective evaluation and regression checks the organizing principle for prompt iteration, production monitoring, retrieval quality, and model changes.

“evaluation matters like at various different stages of building these applications and so some people have it in some of these but not in all”transcript, stated
“if you make any changes um it's hard to avoid regressions you know these are the same problems you have with traditional software”transcript, stated

prompt-versioning (prompt-ops)

The talk treats prompt templates as production artifacts that need experiment history, model configuration, access control, collaboration, and deployment management.

“you should be storing what was the history alongside the model config and making it genuinely easily accessible”transcript, stated
“it's difficult to have the right level of access controls to who can deploy things to production or not”transcript, stated

observability-tracing (operations)

Production feedback, logs, telemetry, implicit actions, and corrections are treated as operating signals for monitoring quality and improving the system.

“plan ahead for when things are in production what are the feedback signals they're going to need to be able to monitor things or measure performance”transcript, stated
“votes are like the simplest one that we you know you'll see in applications things like thumbs up thumbs down but also actions so implicit signals”transcript, stated

rag-retrieval (retrieval)

The talk identifies retrieval-augmented generation as a common, legitimate LLM chain where query-relevant context is selected before generation.

“it's becoming increasingly common to do things like retrieval augmentation followed by generation where our user query comes in you search for something”transcript, stated
“retrieval augmented generation where your first sort of calling from a database of some kind putting that into a prompt template and then calling the model”transcript, stated

fine-tuning-adaptation (model-adaptation)

Humanloop recommends considering fine-tuned smaller models after prompt engineering reaches its limit, especially when proprietary feedback data can improve a narrow task.

“the next thing that I might consider would be fine-tuning smaller models to try and improve performance or latency”transcript, stated
“if you are fine-tuning and you're capturing feedback data in production then actually this can give you a bit of a data flywheel”transcript, stated

safety-policy-enforcement (safety)

For telemetry and private fine-tuning data, the talk puts user permission and access boundaries ahead of model reuse convenience.

“as long as people know up front what they're signing up for and you always get the permissions from users to capture Telemetry then then I think it's fine”transcript, stated
“some of that data you gather may be private to you know maybe a subsection of your company but now it's stored in the weights of your model somehow”transcript, stated

Tradeoffs

Use objective evaluation and feedback capture instead of rapid eyeballing.

Chose component-level evaluation and production feedback signals over playground eyeballing and unstructured logs.

Rationale: Structured evaluation prevents false negatives, unmeasured thrash, and regression-prone prompt/model changes.

“if you can't measure things then you can't improve them and kind of everything else in terms of all the effort you pour into your applications can go to waste”transcript, stated
“they dump logs to a database with the intention of looking at those letters for driving performance improvements and they end up not looking at them”transcript, stated

Adopt prompt management tooling that includes non-engineers.

Chose prompt systems with experiment history and cross-functional access over Git-only or document-only prompt storage.

Rationale: Git gives version control, but domain experts need a usable way to collaborate on prompt engineering without losing deployment discipline.

“Domain experts often have valuable contributions to make to prompt engineering but may not be comfortable with Git workflows.”summary, stated
“it needs to be accessible to both non-technical and Technical team members because if you separate this into code then you end up alienating a really key stakeholder”transcript, stated

Start with best available models and prompt engineering before complex orchestration.

Chose strong base models and simple prompt/retrieval workflows first over early multi-step chains and agents.

Rationale: Simple baselines are easier to evaluate and maintain; complex chains are reserved for cases where reasoning needs justify the added moving parts.

“don't over optimize costs and latency don't over optimize the complexity of you know stuff early on”transcript, stated
“more complicated ones I would discourage people from starting there unless they've already explored Alternatives and and seen how well they work”transcript, stated

Fine-tune smaller models for narrow tasks when data exists.

Chose task-specific fine-tuned models over continued reliance on the largest general hosted model.

Rationale: Narrow fine-tunes can use proprietary feedback data to improve cost, latency, and performance on the actual task rather than paying for broad general capabilities.

“the very largest models are very general in their capabilities but if you're trying to generate a sales email or you're trying to answer questions about a legal document”transcript, stated
“as a result they have lower costs lower latency and better performance”transcript, stated

Treat telemetry and private fine-tuning data as consent and access-control problems.

Chose explicit permission and access separation over silent telemetry capture or shared fine-tuned models across permission boundaries.

Rationale: Feedback improves services, but only when users understand and permit telemetry, and private training data should not become indirectly available through model weights.

“where it's a bit Sinister is if they were capturing these things without permission so for me that's the that's the ethical line that I wouldn't want to cross”transcript, stated
“it's either been in cases where the training data was like publicly available like find where they were fine-tuning on you know search results”transcript, stated

Gotchas (what bit them)

Teams abandon or thrash viable LLM applications when they lack objective evaluation.

Root cause: Prompt and retrieval changes are judged by eyeballing examples rather than by component-level metrics and production feedback.

Resolution: Evaluate during prompt iteration, evaluate components such as retrieval separately, monitor production outcomes, and use feedback to avoid regressions.

“they don't put into place as systematic a process for measuring things as they might otherwise”transcript, stated
“they may be not look at evaluating the quality of the retrievals versus things that are a result of the prompt”transcript, stated

Prompt work loses institutional memory when it lives in playgrounds, notebooks, spreadsheets, or scattered documents.

Root cause: Teams treat prompts as informal text instead of production artifacts with history, model configuration, and collaboration controls.

Resolution: Use prompt management infrastructure that records experiments and makes the history accessible to technical and non-technical contributors.

“it's really easy to lose histories of experimentation so you're trying lots of stuff you're implicitly learning a lot in that process”transcript, stated
“you want it to record a history of everything you're trying throughout experimentation”transcript, stated

Premature chains and agents make production failures harder to diagnose.

Root cause: Multiple prompts and steps introduce combinatorial complexity before teams know whether a simpler model, prompt, or retrieval setup works.

Resolution: Start with the strongest available model and push prompt engineering first; move to chains or agents only when the task truly requires reasoning and simpler alternatives have been tested.

“I have five different prompts in a chain so which one of those is affecting outcomes it becomes harder to maintain things over time”transcript, stated
“focus on the limits of what you can do with prompt engineering initially push that as far as you humanly can”transcript, stated

Teams underestimate fine-tuning because frontier models feel sufficient.

Root cause: Teams assume small models need too much data or cannot compete with GPT-class hosted models on narrow production tasks.

Resolution: Try fine-tuning smaller models when proprietary examples and feedback data exist for a narrow task, then compare cost, latency, and task performance.

“people have gotten so used to the power of these very large models that there's a tendency to assume that fine-tuning smaller models will either require more data”transcript, stated
“smaller model you're getting the benefits of increased cost and you know well lower cost”transcript, stated

Fine-tuning on private data can blur access-control boundaries.

Root cause: Training data may be memorized or embedded in a shared model's weights even when not everyone should access the underlying documents.

Resolution: Avoid sharing fine-tuned models across unauthorized groups; consider separate fine-tunes or adapter-style access separation while recognizing the problem is not fully solved.

“some of that data you gather may be private to you know maybe a subsection of your company but now it's stored in the weights of your model somehow”transcript, stated
“Beyond fine-tuning separate models or not using instruction tuned models I don't think there is a very clear-cut solution to this yet”transcript, stated

Evaluation

The talk argues for evaluation at three levels: development-time prompt iteration, production monitoring of user outcomes, and regression checks before prompt/model changes. It highlights GitHub Copilot's production feedback loop as a concrete exemplar.

Metrics: End-user acceptance of model suggestions · Whether accepted code remains in the codebase at later time intervals · Explicit votes such as thumbs up or thumbs down · Implicit user actions · User corrections or edited generated text · Component-level retrieval quality · Regression checks after prompt or model changes · Cost, latency, and task performance for fine-tuned models

3 supporting quotes
“does it stay in your code at various different time intervals later so they're really getting a very strong signal of was the code they generated actually useful”transcript, stated
“explicit and implicit sources of user feedback in production in addition to human feedback during development and use that for monitoring Improvement and development”transcript, stated
“you know upgrading from one model to the next or something like that how do you know that you aren't causing problems or you know causing regressions”transcript, stated

Outcomes

The talk is advisory rather than a single deployment report, but it draws from Humanloop's year-plus of platform operation and several hundred customer projects. Its strongest concrete scale examples are GitHub Copilot's million-plus users and a fine-tuning case using about 3,500 data points.

4 supporting quotes
“there's really five or sorry four that I'm going to talk about here there's a fifth one I'll sneak in later”transcript, stated
“one of the most successful applications of llms out there well over a million users and serving a quite critical audience software engineers”transcript, stated
“that is now better for performance in their Niche than anything that you could get from the closed model providers”transcript, stated
“we need in this case our own set of you know tools that are appropriate for the job that have been designed from the bottom up from first principles with LMS in mind”transcript, stated