1 of 26

LLPhant

The PHP framework for generative AI

https://llphant.io

2 of 26

Fabrizio Balliano

  • In love with PHP since 1999
  • Freelance PHP developer
  • Full time Magento since 2011
  • Former maintainer of OpenMage
  • Founder of MahoCommerce�

fabrizioballiano.commahocommerce.com

3 of 26

Let's talk AI in PHP...

at a PHP conference...

so let's start with...

4 of 26

Python!

meme from "IT Crowd"

you HAVE to watch it!

5 of 26

no but seriously

6 of 26

7 of 26

* mandatory meme of every talk ever ;-)

8 of 26

Here comes the

LLPhant

by Maxime Thoonsen @ Theodo

MIT licensed

�inspired by LangChain/LLamaIndex

9 of 26

Why do we need a framework...

...when we have PHP clients for LLM platforms?�

  • The AI world is changing too quickly
  • every client is coded differently
  • we may want to mix&match
  • we need more than just asking stuff to ChatGPT

10 of 26

let's see what this fuzz is about

11 of 26

1. LLPhant is multi vendor

Supporting OpenAI, Anthropic, Mistral, Ollama,�and all services compatible with the OpenAI API such as LocalAI

12 of 26

2. LLPhant is feature rich

13 of 26

3. LLPhant is extremely easy

14 of 26

4. Chat

15 of 26

5. Tools: probably the most important thing

16 of 26

6. Embedding

The right definition:� embeddings are vectors stored in an index within a vector database*

The wrong (but also kinda right) definition:� Add "stuff" to an LLM

* https://pub.aimind.so/llm-embeddings-explained-simply-f7536d3d0e4b

17 of 26

The magic of vectorialization

18 of 26

man is to king as woman is to queen

19 of 26

king - man = queen - woman Warsaw - Poland = Rome - Italy

20 of 26

6. Embedding (process overview)

21 of 26

6. Embedding (how to)

22 of 26

6. Embedding (supported VectorStores)

23 of 26

Embedding vs Tools

24 of 26

7. AutoPHP: a simple agentic approach

25 of 26

Demo time!

26 of 26

Questions & Feedback