Sunday, June 22, 2025

Overview of NLP Libraries in PHP

 

1. OpenAI Integrations for PHP

OpenAI PHP Client on the editor

One of the most powerful Natural Language Processing (NLP) libraries available for PHP developers is the OpenAI PHP Client. This library provides an easy-to-use interface for integrating OpenAI’s language models, including GPT-based models, into PHP applications. The OpenAI PHP Client is designed to simplify communication with OpenAI’s API.

OpenAI PHP Extension

Official website: https://openai-php.com

The OpenAI PHP is an extension that allows PHP developers to integrate the powerful capabilities of OpenAI into their applications. Activating the extension on the web server will allow users to quickly access the services offered by OpenAI without additional libraries in PHP.

2. General NLP/AI Frameworks for PHP

EasyAI-PHP

EasyAI-PHP is an open-source initiative designed to significantly simplify the entry into artificial intelligence for PHP-developers (so basically Lang-Chain for PHP). This project integrates advanced AI models and utilities, allowing developers to incorporate complex AI functionalities with minimal coding.

LLPhant

LLPhant - A comprehensive PHP Generative AI Framework

TransformersPHP

State-of-the-art Machine Learning for PHP. Run Transformers natively in your PHP projects

3. NLP Agent & Workflow Frameworks

LLM Agents PHP SDK (PHP LLM-based AI Agents Library)


The LLM Agents PHP SDK is a robust PHP library designed to facilitate the creation and management of Language Model (LLM)-based agents. It offers a comprehensive framework that enables developers to build autonomous agents capable of performing complex tasks, making informed decisions, and interacting seamlessly with various tools and APIs.
  • Agent Creation: Define and configure LLM-based agents with customizable behaviors.
  • Tool Integration: Connect agents with various tools and APIs for extended functionality.
  • Memory Management: Enable agents to retain and recall information for better context.
  • Prompt Handling: Manage prompts efficiently to guide agent responses.
  • Extensible Architecture: Easily add new agent types, tools, and capabilities.
  • Multi-Agent Support: Allow multiple agents to collaborate on complex tasks.

4. NLP Utility Libraries

DeepL-php (PHP client library for the DeepL API)

The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations. This opens a whole universe of opportunities for developers: any translation product you can imagine can now be built on top of DeepL's best-in-class translation technology.

Sunday, March 02, 2025

 

New Telegram Channel: AI & ML with PHP

 We’re excited to announce the launch of our new Telegram channel: AI & ML with PHP! If you're interested in Artificial Intelligence (AI), Machine Learning (ML), and how they integrate with PHP, this is the place for you.

What You’ll Find in Our Channel

Our goal is to bring together developers, AI enthusiasts, and PHP programmers to explore the possibilities of AI & ML in PHP. Here’s what you can expect:


  • AI & ML Tutorials for PHP Developers
  • Code Snippets & Hands-On Examples
  • Latest News & Trends in AI & ML
  • Tips for Using AI in PHP Projects
  •  Engaging Discussions & Q&A Sessions

Why Should You Join?

AI and ML are shaping the future of technology, and PHP is still one of the most widely used languages in web development. Combining them opens up new possibilities for automation, data analysis, and intelligent applications. Whether you’re a beginner or an expert, our channel will keep you updated, informed, and inspired.

Join Us Today

Be part of our growing community and take your PHP skills to the next level with AI & ML. Click below to join now:

t.me/aimlphp

Let’s build the future of AI-powered PHP applications together.

Saturday, November 02, 2024

Announcing New Online Book: “Artificial Intelligence with PHP”

I’m thrilled to announce my new project - online book "Artificial Intelligence with PHP"! This book is designed for developers, tech enthusiasts, and anyone interested in diving into artificial intelligence with a specific focus on PHP. AI is a transformative field that touches everything from daily convenience to the world’s most complex problems, and PHP, a language loved for web development, can be an excellent tool to explore it.












In AI with PHP, we’ll cover essential topics in AI, machine learning, deep learning, and neural networks — all with practical PHP examples. From the foundational principles of AI to the intricacies of deep learning algorithms, this book will guide you step-by-step. Whether you’re curious about how AI models make decisions or eager to build your own neural network, there’s something here for you. 

Here’s a sneak peek at some of the core topics: 
  • Artificial Intelligence Fundamentals – A primer on AI concepts, terms, and history, tailored to PHP developers. 
  • Machine Learning Basics – Understand core algorithms and explore how data shapes the models we create. 
  • Deep Learning and Neural Networks – Delve into advanced AI, from creating neural networks to implementing deep learning architectures. 
  • PHP Code Examples – Hands-on code samples to apply AI concepts in real-world scenarios using PHP libraries like Rubix ML, PHP-ML and others.

One of the most exciting aspects of AI with PHP is that it’s both open-source and open for collaboration! The book is still a work in progress, and I invite anyone with a passion for AI, PHP, or both to contribute. Whether you’re an experienced developer, a newcomer to AI, or just enthusiastic about the field, your input can help make this resource richer and more valuable for everyone. As a contributor, you’ll have the chance to shape content, suggest new sections, and help others learn alongside you. 

AI has never been more accessible, and with PHP as our toolkit, we can tackle exciting AI projects together. I can’t wait to share this journey with you. Stay tuned for more updates, sample chapters, and release dates. Let’s explore the future of AI — together, with PHP, in a truly collaborative, open-source way! 

The official website of the book (v0.1): 
https://apphp.gitbook.io/artificial-intelligence-with-php

The GitHub repository with practical examples: 
https://github.com/apphp/ai-with-php-examples

Saturday, March 06, 2021

New version 1.4.1 of ApPHP MVC Framework is released

 


ApPHP MVC Framework is designed to provide modern and rapid development of websites, web applications and web services. It implements the the Model-View-Controller (MVC) design pattern and principles, including separation of display, logic, and data layers. It provides an architecture, components and tools for developers to build a complex web applications faster and safer. There are many changes and improvements in new version. You can review all recent changes here.

Friday, November 27, 2020

Laravel - Specify Custom Folders for Migration Files

By default in Laravel you have all migration files in on folder, that called database/migrations/

It's cool, but if your project has grown, you may found this folder includes a lot of files and it's not easy to support them. The best solution is to create sub-directories (according to your needs or per version) and create/put your migrations files in specific directory.

This is the standard way how we use migration files:


 

 


 

 

 

 

 

 

 

Let's try to improve this. For example you may decide to separate migration files according to the version of your script, so the structure of your migration directory will look like this:








 

Looks much better, right? Instead of a long list of migration files.

So when you start new version, you need to create a new directory, name it with the next version number and all migrations, related to this version create only in new directory.

Is this enough? Not really.

But default Laravel waiting you place migration files directly in database/migrations/ directory, not in sub-directories. So we just need to inform Laravel from where it has to take migration files. Let's do it.

We have to open AppServiceProvider.php file, and add in the boot() method following code, that will tell to Laravel from where take migration files.

/*
|--------------------------------------------------------
|  Register custom migration paths
|  We specify sub-directory for each version, like:
|      - database/migrations/0.8.1/
|      - etc.
| You may use DIRECTORY_SEPARATOR instead of /
|-------------------------------------------------------- */ $this->loadMigrationsFrom([ database_path().'/migrations/0.8.1', database_path().'/migrations/0.8.2', database_path().'/migrations/0.8.3', ]);

Next time you will add a new directory, just remember to update this list of default directories.