Slide 1

Slide 1 text

Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Christian Liebel @christianliebel Consultant

Slide 2

Slide 2 text

Hello, it’s me. Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Christian Liebel X: @christianliebel Email: christian.liebel @thinktecture.com Angular & PWA Slides: thinktecture.com /christian-liebel

Slide 3

Slide 3 text

Speech OpenAI Whisper tortoise-tts … Overview Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Generative AI Images Midjourney DALL·E … Audio/Music Musico Soundraw … Text OpenAI GPT Mistral …

Slide 4

Slide 4 text

Large: Trained on lots of data Language: Process and generate text in natural language Models: Programs/neural networks Examples: – GPT (ChatGPT, Bing Chat, …) – Gemini, Gemma (Google) – LLaMa (Meta AI) Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Large Language Models

Slide 5

Slide 5 text

Prompts serve as the universal interface Unstructured text conveying specific semantics Paradigm shift in software architecture Natural language becomes a first-class citizen Caveats Non-determinism and hallucination, prompt injections Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Large Language Models

Slide 6

Slide 6 text

Use cases beyond chat bots…? Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Large Language Models

Slide 7

Slide 7 text

Überweise mir die 17,34 Euro einfach, meine IBAN lautet DE02200505501015871393. Ich bin bei der Hamburger Sparkasse (HASPDEHH). Neulich auf Kleinanzeigen… Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Use Case Passt, dann hier schonmal meine Adresse: Peter Müller, Rheinstr. 7, 04435 Schkeuditz

Slide 8

Slide 8 text

Überweise mir die 17,34 Euro einfach, meine IBAN lautet DE02200505501015871393. Ich bin bei der Hamburger Sparkasse (HASPDEHH). Neulich auf Kleinanzeigen… Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Use Case Passt, dann hier schonmal meine Adresse: Peter Müller, Rheinstr. 7, 04435 Schkeuditz

Slide 9

Slide 9 text

protected readonly formGroup = this.fb.group({ firstName: [''], lastName: [''], addressLine1: [''], addressLine2: [''], city: [''], state: [''], zip: [''], country: [''], }); Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Idea Passt, dann hier schonmal meine Adresse: Peter Müller, Rheinstr. 7, 04435 Schkeuditz Smart Form Filler (LLM)

Slide 10

Slide 10 text

Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Idea DEMO

Slide 11

Slide 11 text

Form Field Prompt Generator Model Backend Response Parser Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Architecture

Slide 12

Slide 12 text

Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Form Field „Versuche das Land anhand der Eingaben zu bestimmen.“ „Wenn vorhanden, schreibe die Abteilung in dieses Feld.“

Slide 13

Slide 13 text

Async Clipboard API Allows reading from/writing to the clipboard in an asynchronous manner Reading from the clipboard requires user consent first (privacy!) Supported by Chrome, Edge and Safari and Firefox (plain- text only) Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Prompt Generator

Slide 14

Slide 14 text

System message • The form has the following setup: { "firstName": "", "lastName": "" } User message • Passt, dann hier schonmal meine Adresse: Peter Müller Assistant message • { "firstName": "Peter", "lastName": "Müller" } Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Prompt Generator

Slide 15

Slide 15 text

Cloud backends Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Model Backend

Slide 16

Slide 16 text

Local backend (WebLLM) Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Model Backend

Slide 17

Slide 17 text

Comparison 22,98 33,96 568,06 909,62 0 100 200 300 400 500 600 700 800 900 1000 WebLLM (Mistral-7b, M1) WebLLM (Mistral-7b, M3) Groq (Mixtral-8x7b) Groq (Llama3-8b) Tokens/sec Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Performance Own tests (WebLLM: 23.03.2024, Groq: 01.05.2024)

Slide 18

Slide 18 text

Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen

Slide 19

Slide 19 text

Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Prompt Parser Assistant message • { "firstName": "Peter", "lastName": "Müller" }

Slide 20

Slide 20 text

Assistant message Parsing the assistant message as text/JSON/… Tool calling Specifying a well-defined interface via a JSON schema called by the LLM (safer, growing support) Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Prompt Parser

Slide 21

Slide 21 text

– Super accurate – Versatile thanks to layered architecture – Runs in the browser, locally, or in the cloud – Very fast execution is possible via Groq – More details? Expert 1:1 Intelligente Formulare Angular Forms mit AI & LLMs aufpeppen Summary

Slide 22

Slide 22 text

Thank you for your kind attention! Christian Liebel @christianliebel [email protected]