Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Rehmatweb's avatar

chatgpt api integrate in laravel project

I want to get the response from my custom database using openai package? how it is possible? how can i use the package that will train ai model according to my requirements?

0 likes
7 replies
Tray2's avatar

That sounds like a very bad idea, chatgtp should not be a part of the infrastructure.

1 like
kiwi0134's avatar

I'm not sure what exactly you're trying to do. Sounds like an XY-Problem. What is your end goal?

2 likes
Rehmatweb's avatar

@kiwi0134 actually i want to train gprt-3.5 turbo model on my custom data. like chat gpt respond on the general data but not have specific data e.g chatgpt does not know about jimmy location or salary but i have documents that have infromation of specific users. these documents are thousands so i have integrate the openai key. now i want to train the model. my problem is how can i train the model on my customdata? what techniques i will used? i am working in laravel so i want to know is laravel have any package for it?

kiwi0134's avatar

@Rehmatweb First I have to clarify that I'm the exact opposite of an expert about this topic.

I did some basic research and found out, that you probably cannot upload documents to OpenAI to train a custom LLM. But you can develop your own service which makes use of OpenAI in combination with custom data.

Do these help you?

They both look promising to me. Instead of using the UI the tutorials uses, you could build a simple internal endpoint for your service which accepts a query and returns the data.

I also found the following topic here on Laracasts:

But be careful to not mix data of different users, unless wanted.

Rehmatweb's avatar

@kiwi0134 thanks for guidence this article medium.com is related to python

I want to achieve the same goal but in laravel. like GPT-index and such type of packages/libraries are not found in laravel.

kiwi0134's avatar

@Rehmatweb Yes, thats correct. There seems to be no Laravel package to do the same. Despite the idea to develop a small microservice in Python and then use that from Laravel, for example via an internal HTTP request to that microservice.

Rehmatweb's avatar

how can we tune a gpt-3.5-turbo model through customdata in laravel

Please or to participate in this conversation.