Practical Lessons Learned from Building and Deploying GenAI Applications

bolbeck · Tech · 2023 · source Agentic: yes · promotional bias: low · 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 GenAI application architecture and operations

Bolbeck needed to explain the practical operational burden that appears when teams add LLMs and agents to ordinary applications: model choice, hosting, hallucination control, RAG data quality, fine-tuning risk, evaluation, prompt lifecycle, agent latency, cost, and observability all become production concerns.

Constraints:

Architecture

The talk proposes a production GenAI stack with explicit layers: choose and host models locally or in the cloud; evaluate candidate models continuously with tools such as Ollama, Hugging Face, OpenRouter, and LangSmith; improve quality through prompt engineering, guardrail classifiers, RAG, and selective fine-tuning; externalize prompts in repositories such as LangChain Hub so experts can test and commit prompt changes; build agents that route user tasks through LLM assistants and tool/function calls; optimize agent latency with parallel calls and branching; model token/provider costs before deployment; and instrument agent traces so probabilistic failures can be debugged.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  AI_application_frontend["AI application frontend"] --> Model_selection_layer["Model selection layer"]
  Model_selection_layer --> Hosting_layer["Hosting layer"]
  Hosting_layer --> Cost_model["Cost model"]
  AI_application_frontend --> Prompt_repository["Prompt repository"]
  Prompt_repository --> Domain_expert_workflow["Domain expert workflow"]
  AI_application_frontend --> Main_LLM["Main LLM"]
  Guardrail_classifier["Guardrail classifier"] --> Main_LLM
  RAG_vector_database["RAG vector database"] --> Main_LLM
  Fine_tuning_workflow["Fine-tuning workflow"] --> Model_selection_layer
  Evaluation_toolkit["Evaluation toolkit"] --> Model_selection_layer
  Main_LLM --> Agent_assistant["Agent assistant"]
  Agent_assistant --> Tool_function_layer["Tool/function layer"]
  Parallel_execution_layer["Parallel execution layer"] --> Agent_assistant
  Agent_assistant --> Observability_platform["Observability platform"]
  Observability_platform --> Evaluation_toolkit
  Cost_model --> Agent_assistant
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
AI application frontend Receives user requests and connects traditional application code to LLM-powered behavior. Model selection layer, Prompt repository, Agent assistant, Main LLM
Model selection layer Chooses between hosted APIs, local models, open-source models, and new releases based on use-case performance. Evaluation toolkit, Hosting layer
Hosting layer Runs models locally, on-premises, or in cloud/GPU environments using tools such as Ollama, Modal, SkyPilot, or cloud providers. Cost model, Model selection layer
Cost model Estimates per-call, daily, monthly, GPU, provider, and token costs for production workloads. Model selection layer, Agent assistant
Prompt repository Externalizes prompts so non-technical experts can test, modify, and commit prompt changes. AI application frontend, Domain expert workflow
Domain expert workflow Lets subject-matter experts revise prompts without code changes. Prompt repository
Guardrail classifier Runs as a secondary LLM before or after the main LLM to classify questions or answers as safe or bad. Main LLM
RAG vector database Stores company information chunks and retrieves relevant context for user questions. Main LLM
Main LLM Generates answers, executes prompt-engineered tasks, or serves inside the agent assistant. Guardrail classifier, RAG vector database, Agent assistant
Fine-tuning workflow Optional additional training path for domain data, with risk of cost and quality degradation. Model selection layer
Evaluation toolkit Uses Ollama, Hugging Face, OpenRouter, and LangSmith-style tracking to compare models and application runs. Model selection layer, Observability platform
Agent assistant LLM-powered controller that decides which tools/functions to call to satisfy a user request. Tool/function layer, Observability platform, Cost model
Tool/function layer Executes translation, audio generation, database lookup, and other real-world actions selected by the assistant. Agent assistant
Parallel execution layer Uses concurrent calls and branching to reduce agent latency when independent tool calls can run together. Agent assistant, Tool/function layer
Observability platform Records agent traces, node order, metadata, inputs, outputs, and errors for debugging. Agent assistant, Evaluation toolkit

Data flow

A user request enters an AI application whose model, hosting provider, and quality controls have been selected through evaluation. For direct chat or RAG flows, prompts and retrieved company data go to an LLM, while guardrail classifiers may run before or after the main call. For agentic flows, the assistant LLM decides which tools or functions to call, may run some calls in parallel, and returns the final answer. Prompt updates are externalized through a hub so domain experts can test and commit changes. LangSmith-style traces record node order, metadata, inputs, outputs, errors, and tool calls for debugging.

4 supporting quotes
“the moment you add AI to your application you all you have to start worrying about all the stuff that's in Gray in the diagram on the right”transcript, stated
“guardrail is basically you take a secondary llm and put it to run in front or before your main llm”transcript, stated
“when somebody gives you a question you pass it to the assistant and the system basically has an llm embedded”transcript, stated
“it has metadata it has the inputs and the outputs all that is crucial”transcript, stated

Why this architecture

The stack is layered because each production risk requires a different control: local and cloud hosting for exploration versus deployment, evaluation tools for constant model churn, guardrails and RAG for answer quality, prompt repositories for collaboration and future-proofing, agents and tools for real-world action, parallel branches for latency, cost modeling for economics, and observability for debugging probabilistic multi-node behavior.

4 supporting quotes
“you have to constantly be evaluating not only the model that you have already running but also the molds are coming out”transcript, stated
“promp should never be encoded in your code”transcript, stated
“all of a sudden if you have an agent that is integrating with four or five llms and each one of them takes let's say three seconds to run”transcript, stated
“I can't tell you how hard it is uh to try to figure out what an agent is doing once you get multiple nodes that are interacting with each other”transcript, stated

Models used: GPT-3.5 · GPT-4V · OpenAI o1 · DeepSeek V3 · Claude · Llama 3 · Llama 3.1 70B · Llama 3.3 70B · Mistral · Llama Guard

Scale

Alternatives considered (roads not taken)

Assume AI coding tools will build the whole application

Rejected because: The speaker says coding assistants can help and produce code, but they do not build the full application for you.

“you can just take a prompt put it into an llm and you will and the llm will code your website for you in about a minute or so”transcript, stated
“it'll give you some code and it'll get you going but it won't build everything for you”transcript, stated

Pick models based on benchmarks alone

Rejected because: The speaker warns that better benchmark scores do not mean the model works for the application.

“they really great at certain benchmarks but that doesn't mean they're going to work uh with the rest of the application that you built”transcript, stated
“you have to constantly be evaluating not only the model that you have already running”transcript, stated

Hardcode prompts in application code

Rejected because: Externalized prompts let domain experts edit, test, and commit prompts without coding and make model upgrades easier.

“if you do that you're short changing yourself externalizing your prompt”transcript, stated
“promp should never be encoded in your code”transcript, stated

Use a single expensive frontier model for every call

Rejected because: The cost example shows a dramatic monthly difference when replacing OpenAI o1 with Llama 3.3 70B if the cheaper model can do the task.

“do you really need the power of a very pricey llm or can you do the same thing with a cheaper llm”transcript, stated
“we go from three over $3 per Co to 52 cents per go”transcript, stated

Run agent tool calls serially when they are independent

Rejected because: The speaker recommends platforms that support concurrent calls and branching to reduce wall-clock latency.

“allows to do things like concr calls and branching uh in these agents”transcript, stated
“instead of these things taking eight seconds all of a sudden it takes six”transcript, stated

Debug agents with only print statements or a debugger

Rejected because: Probabilistic multi-node behavior made the lower-case John failure hard to diagnose without traces.

“we could have put the debugger and print statements all that and we still have be very very hard”transcript, stated
“we realized that eventually because because we had the traces”transcript, stated

Patterns

eval-driven-development (quality)

The speaker recommends evaluating models and applications at each step of development and continuously comparing new models.

“you should evaluate and uh your models and your application at each step of the development life cycle”transcript, stated
“you have to constantly be evaluating not only the model that you have already running”transcript, stated

prompt-versioning (operations)

Prompts are externalized so experts can edit and commit them, and teams can adjust quickly when model versions change.

“externalizing your prompts and I know that for all of us it's really easy to just take a prompt put it in the code”transcript, stated
“all they have to do is just uh commit those prompts and that will flow directly into your application”transcript, stated

tool-use-orchestration (architecture)

Agents are described as assistants that decide which functions/tools to call until they can answer the user.

“tools are this fancy name for functions it will start calling functions um until it gets to the answer”transcript, stated
“the assistant is making those decisions all by itself which is a a really really powerful um concept”transcript, stated

observability-tracing (operations)

Agent traces record the sequence of LLM/tool calls, metadata, inputs, outputs, and errors so non-deterministic failures can be debugged.

“we have our agent traces on the left um of the screen”transcript, stated
“it has metadata it has the inputs and the outputs all that is crucial”transcript, stated

cost-aware-routing (operations)

The talk models per-call token economics and recommends choosing the cheapest model/provider that can satisfy the task.

“the choice of the mobile and and the provider that you're going to use in your in your application is really really important”transcript, stated
“can you do the same thing with a cheaper llm or two that may not be quite as powerful but they can do the task”transcript, stated

model-routing (architecture)

The speaker compares local, open-source, provider-routed, and expensive frontier models during exploration and deployment.

“open router will basically take your prompt and it will run it against a number of models or a model of you're choosing”transcript, stated
“they will run it until the one that's against the one that's cheaper”transcript, stated

safety-policy-enforcement (safety)

Guardrails run a secondary LLM classifier before or after the main model to reject unsafe or unwanted questions and answers.

“this secondary llm is basically a classifier that will classify the question”transcript, stated
“classifying that your questions and it also could be the the answers of your own LM as either good or bad”transcript, stated

rag-retrieval (architecture)

The RAG pattern stores company information in a vector database and retrieves relevant context for the LLM.

“you break it into chunks and you start it in the vector database”transcript, stated
“provide that information to your U llm and tell the llm here's the information you can use to answer that question”transcript, stated

latency-optimization (operations)

Agent graphs use concurrent calls and branching to reduce end-user wait time when multiple tools are involved.

“you have an agent that is integrating with four or five llms and each one of them takes let's say three seconds to run then all of a sudden you have uh a process that takes 12 15 seconds”transcript, stated
“things like concr calls and branching uh in these agents”transcript, stated

fine-tuning-adaptation (modeling)

Fine-tuning is presented as an option, but one with cost, time, and quality-regression risks.

“F tuning is basically you do additional training uh to an llm”transcript, stated
“we could actually degrade the llm quality responses”transcript, stated

Tradeoffs

Use local tools for exploration and cloud/GPU platforms for deployment

Chose Ollama/local exploration plus cloud providers, Modal, or SkyPilot for hosting over one hosting mode for every stage.

Rationale: Local tools are cheap for exploration, while production deployment requires thinking about GPUs, cloud availability, containers, and cost optimization.

“Ola will allow you to um download a bunch of uh models into your machine where you can play with those models for free”transcript, stated
“Sky pilot is great to minimize your cost as they will spread the your clusters and your containers into multiple uh clouds”transcript, stated

Externalize prompts

Chose LangChain Hub-style prompt repositories over hardcoded prompts in application code.

Rationale: Externalized prompts let experts collaborate and make it easier to retest prompts against changing model versions.

“externalizing your prompt uh in tools like uh repositories like like Lang chain Hub”transcript, stated
“when they're ready and they're happy with that they're getting the correct uh prompts all they have to do is just uh commit those prompts”transcript, stated

Use guardrails despite their overhead when safety matters

Chose secondary LLM classifiers over single unchecked model call.

Rationale: The guardrail can classify unsafe questions or bad answers, but the team must account for added latency, cost, and errors.

“take a secondary llm and put it to run in front or before your main llm”transcript, stated
“adds latency because you're making a secondary call”transcript, stated

Use RAG when company context matters

Chose chunked company data in a vector database over asking the base model without proprietary context.

Rationale: RAG lets the model answer with company information, but it creates a data-quality dependency.

“take a lot of information that you have in your company you break it into small chunks of information”transcript, stated
“is really dependent on the type of information you've provided in your vector database”transcript, stated

Parallelize independent agent tool calls

Chose concurrent calls and branching over purely serial agent execution.

Rationale: Parallel execution can reduce elapsed time when independent tasks such as translation and audio generation do not depend on each other.

“calling uh a couple of things in in parallel”transcript, stated
“instead of these things taking eight seconds all of a sudden it takes six”transcript, stated

Choose cheaper models when they meet the task

Chose Llama 3.3 70B-style cheaper model in the example over OpenAI o1 for every call.

Rationale: The modeled call-center workload drops from nearly $300,000 per month to nearly $50,000 per month if the cheaper model is sufficient.

“what happens if we replace open a 01 with Lama 3.37 TV just from a price perspective”transcript, stated
“we go all from almost $300,000 per month to almost $50,000 per month”transcript, stated

Instrument agent traces from the start

Chose LangSmith-like observability over debugger/print-only investigation.

Rationale: Multi-node probabilistic failures are hard to reconstruct after the fact, while traces show node order, inputs, outputs, and errors.

“it keeps track of the errors right all the information that was in and out of that llm”transcript, stated
“build it because you are going to need it”transcript, stated

Gotchas (what bit them)

AI increases the application architecture surface area immediately.

Root cause: Teams must handle models, fine-tuning, prompts, RAG, hallucination prevention, model churn, GPU hosting, and cost in addition to ordinary front-end/back-end/infrastructure work.

Resolution: Plan AI systems as full production architectures rather than adding a single LLM call to a traditional app.

“we were building front ends backends um infrastructure SC all the stuff that we normally build”transcript, stated
“the moment you add AI to your application you all you have to start worrying about all the stuff that's in Gray”transcript, stated

Correct chatbot answers remain hard even when building the chatbot is easy.

Root cause: LLMs can produce fluent but wrong answers and may ignore prompt instructions.

Resolution: Layer prompt engineering, guardrails, RAG, fine-tuning when justified, and continuous evaluation instead of relying on raw model output.

“building the chatbot is easy making sure that that chatbot gives you the correct answers is really hard”transcript, stated
“even then the LM may choose to ignore them”transcript, stated

Guardrails are not free or deterministic.

Root cause: A secondary LLM classifier adds another API call, latency, cost, and probabilistic errors.

Resolution: Use guardrails where needed, but account for extra latency/cost and evaluate their mistakes.

“adding this secondary LM adds latency because you're making a secondary call”transcript, stated
“it also has additional cost and like anything else with llms uh it may or may not be right”transcript, stated

RAG quality collapses if the vector database contains stale information.

Root cause: The LLM answers from whatever context retrieval supplies, even if that content is outdated.

Resolution: Treat data curation and vector-store freshness as operational requirements.

“if you put all information that's no longer relevant well guess what what LM is going to reply to you is with information that's no longer relevant”transcript, stated
“so data is extremely important in this case”transcript, stated

Fine-tuning can make model quality worse.

Root cause: New training data can cause forgetting or confusion with existing knowledge.

Resolution: Use fine-tuning selectively and evaluate whether it actually improves the target behavior.

“doesn't really uh guarantee that you're going to get good results”transcript, stated
“you may actually forget some of the information it already had or it may get confused”transcript, stated

Agent latency multiplies across sequential LLM/tool calls.

Root cause: Each LLM call can take seconds, and agents may call four or five LLMs/tools in one process.

Resolution: Use concurrent calls, branching, and careful graph design to keep user-facing latency within expectations.

“each one of them takes let's say three seconds to run then all of a sudden you have uh a process that takes 12 15 seconds”transcript, stated
“our users nowadays are used to running things on the web and take those things taking only milliseconds”transcript, stated

Agent failures can appear only after many successful runs.

Root cause: Probabilistic models add unknowns to an otherwise deterministic application flow.

Resolution: Record traces with node order, inputs, outputs, metadata, and errors so edge-case failures can be diagnosed.

“things that were running a 100 times with no issue will start failing out 100 1001st item”transcript, stated
“because we had the traces um that the user was entering lower cap John instead of just Capal J”transcript, stated

Evaluation

The speaker frames evaluation as continuous and lifecycle-wide. Teams should use local tools such as Ollama for early model exploration, Hugging Face for open-source model and code examples, OpenRouter to compare models/providers cheaply during testing, and LangSmith to record runs and compare model performance over time. The same discipline applies after deployment because new models appear frequently and may not work for the existing application.

Metrics: Use-case-specific model performance · Prompt behavior across model versions · Run histories and model performance over time · Latency per LLM/tool call · Per-call, daily, and monthly token cost · Provider/model output speed in tokens per second · Error traces, inputs, outputs, and node order for agent runs

4 supporting quotes
“evaluation you you really should be doing this at each step of the way”transcript, stated
“open router will basically take your prompt and it will run it against a number of models”transcript, stated
“lsmith which is created by the creators of uh L chain”transcript, stated
“record uh a number of Bruns that you have with your llms you can compare over time”transcript, stated

Outcomes

The talk gives several concrete scale anchors: 18 months of GenAI work, over 15 years of IT experience, chatbots buildable in an hour or two, agent calls taking seconds each, a call-center example with 3,000 calls/day and 15 tool calls/call, o1 token prices of $15 and $60 per million tokens, 1,500 input and 3,000 output tokens, nearly $300,000/month versus nearly $50,000/month, A100 GPU costs of four to five dollars/hour, and Llama 3.1 70B served at over 1,000 or even 2,000 tokens/second by some providers.

6 supporting quotes
“over the last year and a half”transcript, stated
“this call center takes 3,000 calls a day and each one of those calls requires 15 uh function calls or tool calls”transcript, stated
“which turn is almost $300,000 per month”transcript, stated
“we go all from almost $300,000 per month to almost $50,000 per month”transcript, stated
“because we had the traces um that the user was entering lower cap John instead of just Capal J”transcript, stated
“there's no no no technique that will guarantee that the answer of your chat B is going to be good”transcript, stated