Slide 1

Slide 1 text

Intelligent Forms Christian Liebel @christianliebel Consultant Spice up your Angular Forms with AI & LLMs

Slide 2

Slide 2 text

Hello, it’s me. Intelligent Forms Spice up your Angular Forms with AI & LLMs Christian Liebel X: @christianliebel Bluesky: @christianliebel.com Email: christian.liebel @thinktecture.com Angular, PWA & Generative AI Slides: thinktecture.com /christian-liebel

Slide 3

Slide 3 text

Overview Intelligent Forms Spice up your Angular Forms with AI & LLMs Generative AI Text OpenAI GPT Mistral … Speech OpenAI Whisper tortoise-tts … Images DALL·E Stable Diffusion … Audio/Music Musico Soundraw …

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) Intelligent Forms Spice up your Angular Forms with AI & LLMs 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 Intelligent Forms Spice up your Angular Forms with AI & LLMs Large Language Models

Slide 6

Slide 6 text

Use cases beyond chat bots…? Intelligent Forms Spice up your Angular Forms with AI & LLMs Large Language Models

Slide 7

Slide 7 text

Just transfer the 17.34 euros to me, my IBAN is DE02200505501015871393. I am with Hamburger Sparkasse (HASPDEHH). Data Extraction Intelligent Forms Spice up your Angular Forms with AI & LLMs Use Case Nice, here is my address: Peter Müller, Rheinstr. 7, 04435 Schkeuditz

Slide 8

Slide 8 text

Just transfer the 17.34 euros to me, my IBAN is DE02200505501015871393. I am with Hamburger Sparkasse (HASPDEHH). Data Extraction Intelligent Forms Spice up your Angular Forms with AI & LLMs Use Case Nice, here is my address: 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: [''], }); Intelligent Forms Spice up your Angular Forms with AI & LLMs Idea Nice, here is my address: Peter Müller, Rheinstr. 7, 04435 Schkeuditz Smart Form Filler (LLM)

Slide 10

Slide 10 text

DEMO Intelligent Forms Spice up your Angular Forms with AI & LLMs Idea

Slide 11

Slide 11 text

Form Field Prompt Generator Model Backend Response Parser Intelligent Forms Spice up your Angular Forms with AI & LLMs Architecture

Slide 12

Slide 12 text

Intelligent Forms Spice up your Angular Forms with AI & LLMs Form Field “Try to determine the country based on the input.” “If present, put the department in this field.”

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 Intelligent Forms Spice up your Angular Forms with AI & LLMs 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" } Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt Generator

Slide 15

Slide 15 text

Cloud backends Intelligent Forms Spice up your Angular Forms with AI & LLMs Model Backend

Slide 16

Slide 16 text

Local backend (WebLLM) Intelligent Forms Spice up your Angular Forms with AI & LLMs Model Backend

Slide 17

Slide 17 text

https://webllm.mlc.ai/ Intelligent Forms Spice up your Angular Forms with AI & LLMs WebLLM

Slide 18

Slide 18 text

Intelligent Forms Spice up your Angular Forms with AI & LLMs

Slide 19

Slide 19 text

Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt API Operating System Website HTML/JS Browser Internet Apple Intelligence Gemini Nano

Slide 20

Slide 20 text

Part of Chrome’s Built-In AI initiative – Exploratory API for local experiments and use case determination – Downloads Gemini Nano into Google Chrome – Model can be shared across origins – Uses native APIs directly – Fine-tuning API might follow in the future Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt API https://developer.chrome.com/docs/ai/built-in

Slide 21

Slide 21 text

Demo: Smart Form Filler Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt API DEMO

Slide 22

Slide 22 text

Comparison 22.98 33.96 19.08 38.75 564.63 0 100 200 300 400 500 600 WebLLM (Mistral-7b, M1) WebLLM (Mistral-7b, M3) OpenAI (GPT-4) Azure OpenAI (GPT-4) Groq (Mixtral-8x7b) Tokens/sec Intelligent Forms Spice up your Angular Forms with AI & LLMs Performance WebLLM/Groq: Own tests (23.03.2024), OpenAI/Azure OpenAI: https://mcplusa.com/comparing-performance-of-openai-gpt-4-and-microsoft-azure-gpt-4/ (31.08.2023)

Slide 23

Slide 23 text

Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt Parser Assistant message • { "firstName": "Peter", "lastName": "Müller" }

Slide 24

Slide 24 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) Intelligent Forms Spice up your Angular Forms with AI & LLMs Prompt Parser

Slide 25

Slide 25 text

– Super accurate – Versatile thanks to layered architecture – Runs in the browser, locally, or in the cloud – Very fast execution is possible via Groq https://github.com/thinktecture-labs/smart-form-filler Intelligent Forms Spice up your Angular Forms with AI & LLMs Summary

Slide 26

Slide 26 text

Q&A Intelligent Forms Spice up your Angular Forms with AI & LLMs

Slide 27

Slide 27 text

Thank you for your kind attention! Christian Liebel @christianliebel christian.liebel@thinktecture.com