WhoBuilt

Lessons from building GenAI based applications

Feb 22, 2025· 33 min· 850 views·Watch on YouTube

Speaker

Founder, architect, consultant, and developer Juan Peredo shares lessons from building GenAI applications over the past year and a half.

AI adds new application responsibilities

Adding AI means teams must make choices about models, prompts, fine-tuning, retrieval, hallucination checks, and hosting. Peredo says model performance needs ongoing evaluation because new releases may not fit an application's needs. Hosting also brings GPU capacity and cost into the picture.

Ground and evaluate model answers

Building a chatbot is straightforward, but ensuring accurate answers is difficult: an LLM answered “33” when asked for three times three. Prompt instructions, guardrail models, RAG, and fine-tuning can help, but none guarantees correctness. RAG depends on relevant source data, while guardrail calls add latency and cost.

Keep prompts flexible and test models

Peredo recommends evaluating models throughout development with tools such as Ollama, Hugging Face, OpenRouter, and LangSmith. Externalized prompts let domain experts revise and test them without editing application code. They also make it easier to check whether prompts still work when changing models.

Balance agent speed and operating cost

Agents can call tools to carry out tasks, such as translating a book and creating its audio, but sequential LLM calls can add substantial latency. Parallel calls can shorten workflows. Peredo's call-center example estimates nearly $300,000 per month for 3,000 daily calls using o1 under his stated token assumptions; switching to Llama 3.3 70B brings the estimate to nearly $50,000.

Trace agent behavior in production

Probabilistic model behavior can make failures hard to reproduce and diagnose. Peredo describes a database lookup that began failing when a user entered “john” in lowercase; adding an instruction to ignore case fixed it. Traces that capture each model call, its inputs, outputs, metadata, and errors help teams find such causes.

Takeaways

  • Evaluate models against your application's actual tasks, including when new models become available.
  • Treat source data quality as a core part of RAG answer quality.
  • Keep prompts external so domain experts can test and revise them.
  • Estimate token and GPU costs at expected usage, and compare models for each task.
  • Capture agent traces with inputs, outputs, and errors to diagnose intermittent failures.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • metric
    Juan Peredo: Over 15 years of experience in the IT industry
    “I have over 15 years of experience in the IT industry.”
    YouTube
    Unverified1 source· Talk
  • feature
    Modal: Deploys Python code to the cloud by building containers
    “Modal will take care of building your containers and pushing them to the cloud.”
    YouTube
    Unverified1 source· Talk
  • uses
    “I've used it to host a lot of my models.”
    YouTube
    Unverified1 source· Talk
  • feature
    SkyPilot: Spreads clusters and containers across multiple clouds to minimize cost
    “it will spread your clusters and containers across multiple clouds to minimize your cost.”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenRouter: Can route a prompt to a lower-cost provider offering the selected model
    “It will run it through the cheapest provider.”
    YouTube
    Unverified1 source· Talk
  • feature
    LangSmith: Records model runs and supports comparing performance over time
    “record a number of runs with your LLMs and compare over time how they have performed.”
    YouTube
    Unverified1 source· Talk
  • metric
    o1: $15 per million input tokens and $60 per million output tokens
    “The price for OpenAI o1 is $15 per million input tokens and $60 per million output tokens.”
    YouTube
    Unverified1 source· Talk
  • metric
    Llama 7B: Replacing OpenAI o1 with Llama 3.3 70B in the example lowers estimated monthly cost from almost $300,000 to almost $50,000
    “from almost $300,000 per month to almost $50,000 per month.”
    YouTube
    Unverified1 source· Talk

Related talks