Laravel Machine Learning Anybody?

RMAG news

I am building a new library for Laravel developers to ease the pain of building complex Machine Learning applications. This is not a wrapper around OpenAI.

You should be able to do the following:

Use “php artisan” to provision open-source LLMs like Llama3, this will set up the CUDA and Python dependencies.
Spin up a RAG service in minutes including Qdrant as the vector store.
Build multi-agent workflows in PHP.
Convert text to vector embeddings.
Build semantic classifiers.
Full support for OpenAI as well.

So essentially in your PHP code, you can easily do vector embeddings and LLM queries using a clean PHP API:

<?php
use MlToolKitServicesRagService;
use MlToolKitServicesLlm;

// “products”: A namespace similar to a MySQL table
// “mixedbread-ai/mxbai-embed-large-v1”: Any supported embedding model
// “qdrant”: Vector DB backend.

$rag = new RagService(
“products”,
“mixedbread-ai/mxbai-embed-large-v1”,
“qdrant”
);

// Pass in text
$rag->train(“sometext”);

// Create an LLM
// “Llama3” : Any support model
// 0.5 : Temperature

$llm = new Llm(“Llama3”, 0.5);
$llm->setSystemPrompt(“You are a very helpful assistant…”);

$question = “What is the Capital city of France?”;

$rag->setIntent(“Use this tool when the user asks about geographical information”);
$response = $llm->withTools([
$rag,
])->ask($question);

Leave a Reply

Your email address will not be published. Required fields are marked *