Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Techorama NL 2024: ‘Talk to your systems’ - Int...

Techorama NL 2024: ‘Talk to your systems’ - Integrating Gen AI into your architectures with structured LLM output

Yeah, talking to your data (aka RAG) is the 'Hello World' use case for LLMs. *But* there is much more to explore. Based on their understanding of the human language, LLMs can be used to drive innovative user interactions for applications and systems. In this session, Christian demonstrates how to use structured data output with data schemas and function calling to interconnect your APIs with the power of LLMs. Discover how to unlock the potential of your solutions by harnessing the transformative nature of Generative AI. Join this session and let's talk to your systems!

Christian Weyer

October 09, 2024
Tweet

More Decks by Christian Weyer

Other Decks in Programming

Transcript

  1. ‘Talk to your systems’ Integrating Gen AI into your architectures

    with structured LLM output Christian Weyer | Co-Founder & CTO | Thinktecture AG | [email protected]
  2. § Technology catalyst § AI-powered solutions § Pragmatic end-to-end architectures

    § Microsoft Regional Director § Microsoft MVP for AI § Google GDE for Web Technologies [email protected] @christianweyer https://www.thinktecture.com 'Talk to your systems' Integrating Gen AI into your architectures with structured LLM output Christian Weyer Co-Founder & CTO @ Thinktecture AG 2
  3. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 3 Talk to your systems Why? What? How?
  4. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output TALK TO YOUR SYSTEMS WHY? 4
  5. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 5 Human language rocks Extending access to software
  6. One possible UX pattern 'Talk to your systems' Integrating Gen

    AI into your architectures with structured LLM output A language-enabled “UI” 6
  7. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 7 LLMs Use wisely
  8. § LLMs are always part of end-to-end architectures § Client

    apps (Web, desktop, mobile) § Services with APIs § Databases § etc. § An LLM is ‘just’ an additional asset in your architecture § Enabling human language understanding & generation § It is not the Holy Grail for everything § Enable human language as a first-class citizen 'Talk to your systems' Integrating Gen AI into your architectures with structured LLM output End-to-end architectures with LLMs 8 Clients Services LLMs Desktop Web Mobile Service A Service B Service C API Gateway Monitoring LLM 1 LLM 2
  9. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output It’s just HTTP APIs Inference, FTW 9
  10. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 10 Your LLM OpenAI & beyond
  11. § Llama, Mistral, Qwen families show big potential § Success

    factors § Use case § Parameter size § Quantization § Processing power needed § CPU optimization on its way § Local inference runtimes with APIs § E.g. llama.cpp, ollama, llamafile, vLLM 'Talk to your systems' Integrating Gen AI into your architectures with structured LLM output Open-source LLMs thrive 11 § Local UIs § E.g. Open WebUI
  12. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output TALK TO YOUR SYSTEMS HOW? 12
  13. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output Most convenient platform for developers today to work with Gen AI 13
  14. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 14 Prompting Talk to me!
  15. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 15 JSON Mode Give it structure!
  16. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 16 ‘Function’ Calling Give it schema!
  17. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 17 Strict Mode Make it robust!
  18. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 18 Pydantic & Instructor Make my life easy!
  19. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 19 Talking to systems No auto-magic
  20. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output TALK TO YOUR SYSTEMS WHAT? 20
  21. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output 21 End-to-End examples Talking to your applications
  22. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output Talk to Thinktecture 22 Angular PWA Speech-to-Text Internal Gateway (Python FastAPI) LLM / SLM Text-to-Speech Transcribe spoken text Transcribed text Check for experts availability with text Extract { experts, booking times } from text Structured JSON data (Tool calling) Generate response with availability Response Response with experts availability 🗣 🔉 Speech-to-text for response Response audio Internal Business API (node.js – veeeery old) Query Availability API Availability When is CL…? CL will be…
  23. Filling Angular forms with human language input protected readonly formGroup

    = this.fb.group({ firstName: [’’], lastName: [’’], addressLine1: [’’], addressLine2: [’’], city: [’’], state: [’’], zip: [’’], country: [’’] }); 'Talk to your systems' Integrating Gen AI into your architectures with structured LLM output Smart Form Filler OK, nice – so here is my address then:: Peter Schmitt, Rheinstr. 7 in Schkeuditz – postcode is 04435, BTW. 23 Smart Form Filler (TS code & LLM)
  24. 'Talk to your systems' Integrating Gen AI into your architectures

    with structured LLM output TALK TO YOUR SYSTEMS RECAP 24
  25. § Human language enables new powerful use cases & access

    to our software § Always use structured output § Structured output is the secret sauce for integrating LLMs into your application architectures § Consider applying the Maybe pattern § Brings more robustness § Function Calling can be flaky § Especially with smaller models § Do not use frameworks that ‘auto-magically’ map Function Calling results to local code § Always validate return data! § Instructor is a helpful library to boost LLM use cases § Implements lots of best practices § Supports any LLM / SLM § Integrates with FastAPI 'Talk to your systems' Integrating Gen AI into your architectures with structured LLM output Recap & Recommendations 25