WhoBuilt

Iterating on LLM apps at scale Learnings from Discord

Nov 22, 2024· 18 min· 3.9K views·Watch on YouTube

Speaker

Ian Webster, who led LLM product teams at Discord and maintains Promptfoo, shares lessons from building and operating LLM products at Discord at AI Engineer.

Safety risks at Discord scale

Webster describes Clyde AI, a chatbot launched to more than 200 million Discord users. He says the main launch challenges were security, legal, safety, and policy concerns, including harmful responses to children. At that scale, even a failure that occurs once in a million interactions could happen around 200 times.

Keep evals small and testable

Webster recommends treating evaluations as unit tests: break systems into small checks for specific steps, such as moderation, tool use, or end-to-end behavior. For a casual chat style, Discord used a simple check that the response began with a lowercase letter, which he says delivered over 80% of the desired result for about 1% of the effort. For web search, he suggests testing tool selection separately from summarization on fixed context.

Build an eval culture

Webster says evaluations should run locally, be easy to understand, and let developers run dozens each day. Discord attached an eval to every pull request, sometimes as a link and, where practical, through CI/CD. The team built Promptfoo as a local CLI with declarative configuration.

Observe behavior and manage prompts

Discord sent LLM metrics and simple production model-graded evaluations to Datadog, which the team already used for product monitoring. Privacy constraints prevented them from feeding live user data back into evaluation sets, so they relied on dogfooding and publicly shared examples of failures and successes. They versioned prompts in Git and used Retool for nontechnical configuration; Webster also describes occasionally inserting a GPT-4 response to help smaller models stay on persona in long chats.

Red-team before launch

Webster recounts a “Grandma” jailbreak that led Clyde to provide a napalm recipe, and argues that pre-deployment risk assessment deserves more attention alongside live filtering. Promptfoo's risk assessment covered areas such as brand and legal risk, while adversarial LLMs tested application-specific jailbreaks. The team also considered risks including PII leaks, hallucinations, hijacking, and political opinions.

Takeaways

  • Treat evals like unit tests: make them small, local, understandable, and fast to run.
  • Start with simple deterministic checks; add complexity only when basic metrics leave a meaningful gap.
  • Attach evaluation results to every pull request so changes are checked routinely.
  • Track LLM metrics in the observability system your team already uses.
  • Red-team application-specific risks before launch, since prompts and tools can create new jailbreak paths.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • previously at
    Ian Webster previously at Discord
    Led LLM engineering and developer platform teams
    “I led the developer platform team ... Eventually, I moved on to LLM products”
    YouTube
    Verified2 sources· Talk, Web· archived
  • feature
    Promptfoo: Open-source library for evals and red teaming
    “an open-source library for evals and red teaming”
    YouTube
    Unverified1 source· Talk
  • feature
    Clyde AI: Agent and RAG chatbot
    “this agent and RAG called Clyde AI. It was basically a chatbot”
    YouTube
    Unverified1 source· Talk
  • launched
    to over 200 million users
    “a chatbot that launched to over 200 million users on Discord”
    YouTube
    Unverified1 source· Talk
  • feature
    Promptfoo: CLI that runs evals completely locally
    “It's a CLI that does evals and runs completely locally”
    YouTube
    Unverified1 source· Talk
  • uses
    for LLM observability
    “at Discord, we used ... Datadog for our LLM observability”
    YouTube
    Unverified1 source· Talk
  • uses
    as the source of truth for prompt versioning
    “We used Git as a source of truth for versioning”
    YouTube
    Unverified1 source· Talk
  • uses
    for configuration
    “we used Retool for configuration”
    YouTube
    Unverified1 source· Talk

Related talks