Chains and agents

LLMOps Concepts

Max Knobbout, PhD

Applied Scientist, Uber

LLM lifecyle: Chains and agents

Overview of the LLM application lifecycle phases

LLMOps Concepts

From prompts to applications

Prompt template for dish calorie classification

 

  • To use this template, we need:
    • Examples
    • Input
  • We go through a few steps:
    1. Receiving input
    2. Searching examples
    3. Prompt creation
    4. Output retrieval
    5. Output parsing
LLMOps Concepts

A chain using our template

 

A LLM application using a chain where we retrieve similar dishes from database

LLMOps Concepts

The need for chains

 

A playful image of three cartoon characters drawing a chain

 

 

  • Develop sophisticated applications
  • Establish a modular design, enhancing scalability and operational efficiency
  • Unlock endless possibilities for customization
LLMOps Concepts

Agents

 

 

A playful image of a cartoon riding a robot mouse

 

  • Agents consist of:
    • Multiple actions (or tools)
    • An LLM deciding which action to take

 

  • Useful when:
    • There are many actions
    • The optimal sequence of steps is unknown
    • We are uncertain about the inputs
LLMOps Concepts

Agents

An agent architecture where we have two actions

LLMOps Concepts

Agents

An agent architecture where we have two actions

LLMOps Concepts

Agents

An agent architecture where we have two actions

LLMOps Concepts

The difference between chains and agents

 

 

Chains 🔗 Agents 🤖
Nature Deterministic Adaptive
Complexity   Low High
Flexibility Low High
Risk Lower (due to predictability)                 Higher (due to adaptability)                
LLMOps Concepts

The development cycle

Development cycle where we have added the activity of prompt engineering

LLMOps Concepts

The development cycle

Development cycle with chain and agents.

LLMOps Concepts

The development cycle

Development cycle where we added the activity of chain and agent development

LLMOps Concepts

Let's practice!

LLMOps Concepts

Preparing Video For Download...