DEV Community

Cover image for PHP Library for Working with LLM, Agents and RAG
Sami Maameri
Sami Maameri

Posted on

PHP Library for Working with LLM, Agents and RAG

Hello All,

I kicked of a small PHP package, with the aim of making it easy to work with LLMs, Agents and RAG in PHP.

It's just got a single method/class just now :) (release fast!?)

Wondering if it is something that sound's interesting to the PHP community. Why should Python guys have all the fun!

Would be great to have some sign of interest, and even feature requests, to inspire me to put some more work into it. Have kicked off the package here on github, and it is available on packagist also.

Like I said, it currently just supports one action, which allows you to send a message to OpenAI Chat by doing

$chat = new ChatOpenAI(getenv('OPENAI_API_KEY'));
$response = $chat->sendMessage('Hello, world!');
Enter fullscreen mode Exit fullscreen mode

I know there is the LLPhant library, but this could evolve to be something a little different, perhaps with its own benefits

Any feedback? Feature requests would be great too.

Thanks!

Sami

Top comments (2)

Collapse
 
bogomil profile image
Bogomil Shopov - Бого

is it opensource?

Collapse
 
smaameri profile image
Sami Maameri

Yes