Skip to content

A curated list of PHP libraries and tools for AI, Machine Learning, and Natural Language Processing. Find everything you need to integrate modern AI capabilities into your PHP applications.

Notifications You must be signed in to change notification settings

garyblankenship/awesome-php-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Awesome PHP AI Awesome

A curated list of awesome PHP libraries and tools for integrating AI, Machine Learning, and Natural Language Processing into your PHP applications. Contributions are welcome!

Table of Contents

Libraries

Natural Language Processing

General NLP

  • cocur/slugify - Converts a string into a slug (NLP utility).
  • JPMorgan Chase - Zemanta-PHP-ML - A general-purpose machine learning library for PHP. Implements many different algorithms for classification, regression, and clustering.
  • NlpTools - NlpTools is a collection of Natural Language Processing tools written in PHP. It provides a set of APIs to work with text easily.

LLM Inferencing

  • ai-team** - A package allowing to create team of AI members that can work and collaborate together to achieve a common goal.
  • deepseek-php/deepseek-php-client - ⚡️ Supercharged community-maintained PHP API client that allows you to interact with DeepSeek API.
  • 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). Based on PHP 8.1+, this project integrates advanced AI models and utilities, allowing developers to incorporate complex AI functionalities with minimal coding.
  • Elasticsearch ChatGPT PHP** - Use ChatGPT to search in Elasticsearch using natural language
  • fireworksai-adapter** - The adapter integrates open-source models hosted by fireworks.ai into Modelflow AI.
  • instructrice** - Typed LLM Outputs in PHP. Supports GPT, Claude, Gemini or any OpenAI compatible provider!
  • Instructor PHP** - Extract structured data from LLM outputs with type safety and validation.
  • langchain-php** - Building applications with LLMs through composability in PHP
  • laravel-llm-prompt** - laravel-llm-prompt manager
  • laravel-prompt-alchemist** - Versatile LLM Tool Use (Function Calling) package for Laravel, compatible with all LLMs, enabling LLM to execute actual code functions (unlike LLMs' built-in capabilities).
  • Laravel OpenRouter** - Laravel integration for OpenRouter's unified LLM API interface.
  • LaravelLLMContext** - Artisan Command to Generate LLM Context for a Laravel Project
  • llm** - Provides Laravel integrations for various LLM providers
  • LLM Agents** - LLM Agents is a PHP library for building and managing Language Model (LLM) based agents. It provides a framework for creating autonomous agents that can perform complex tasks, make decisions, and interact with various tools and APIs.
  • LLM Chain** - Comprehensive PHP library for building LLM-powered applications.
  • LLM Chain Bundle** - Symfony bundle for seamless integration of the LLM Chain library.
  • LLM-Port-Laravel** - Wrapper around the most popular LLMs that allows drop-in replacement of large language models in Laravel.
  • llm-magic** - LLM-agnostic AI toolkit for Laravel
  • Lugha** - Lugha is a PHP Generative AI Framework to build chatbot, RAG systems and AI-powered applications
  • mcp-php** - Setting Up a Model Context Protocol (MCP) Server in Laravel
  • mulagent** - The orchestration of multiple agents involves the use of routines and handoffs. Simplifying, a routine is a series of steps to follow to achieve a goal, and a handoff is the transition from one agent to another, like a switchboard transferring a phone call.
  • Ollama PHP** - PHP client for Ollama, enabling local LLM deployment and interaction.
  • Orhanerday/OpenAi - OpenAI PHP SDK : Most popular library for OpenAI in PHP.
  • php-llm-json-adapter** - When using LLMs from the system, you often expect to get output results in JSON: OpenAPI's GPT API has a mechanism called Function Calling, which can return JSON, but Google's Gemini does not seem to have that functionality.
  • php-llms** - A practical guide and toolkit for PHP developers integrating LLMs into existing projects.
  • Prism** - A unified interface for working with LLMs in Laravel applications.
  • prompt-generator** - Prompt generator for LLM agents with interceptors
  • Resonance** - High-performance PHP framework optimized for IO-intensive LLM applications.
  • Sidekick** - Say hello to Sidekick! A Laravel package that provides a common syntax for using Claude, Mistral, Cohere and OpenAi APIs.
  • simple-llm-php - Minimalist wrapper around the OpenAI API to get you up and running with LLM inferencing.
  • Taskallama** - Taskallama is a Laravel package that provides seamless integration with Ollama's LLM API. It simplifies generating AI-powered content, from professional task writing to conversational agents, with minimal effort. Whether you're building a task management system, an HR assistant for job posts, or blog content generation, Taskallama has you covered.
  • team-reflex/openai-php - OpenAI PHP provides bindings to the OpenAI API for PHP projects.
  • transformers-php** - Transformers PHP is a toolkit for PHP developers to add machine learning magic to their projects easily.
  • Transformers-php - Provides an interface to run transformer models in PHP.
  • aipi-php** - Universal API client for common AI models

Retrieval-Augmented Generation (RAG) / Vectors / Embeddings

  • Embeddings-php - Create, store, and compare word and text embeddings.
  • fabric-pattern** - Slim PHP wrapper for Daniel Miessler's fabric pattern
  • php-llm-documents** - PHP LLM Documents is a powerful PHP library that brings LLM (Large Language Model) functionality into the PHP ecosystem.
  • php-rag** - Application using LLM (Llama3/GPT-4) for text generation with database-backed retrieval.
  • Vesp-ai/sdk-php - Official SDK for querying Vespa vector databases
  • weaviate-php - Weaviate is an open source vector database. Weaviate makes it easy to use state-of-the-art ML models in your applications without needing to be a machine learning expert.

Machine Translation

  • DeepL PHP** - Official PHP library for the DeepL language translation API.

Other NLP

  • NlpTools - NlpTools is a collection of Natural Language Processing tools written in PHP. It provides a set of APIs to work with text easily.

Machine Learning

  • php-ml** - A PHP machine learning library.
  • Rubix ML** - Machine learning library for building algorithms and models.
  • TensorFlow PHP** - PHP bindings for TensorFlow.

Computer Vision

  • opencv/opencv-php** - OpenCV bindings for PHP for image processing and computer vision.

Search

  • sajari/engine-php - A PHP (and Go, and Node) client for the Sajari search engine, allowing full-text unstructured data search through simple method calls.

Data Manipulation

  • brick/math** - Handles arbitrary precision mathematics in PHP.
  • php-ai/php-ds** - PHP data structures extension for performance.
  • redis-vector-php** - Redis Vector Library (RedisVL) enables Redis as a real-time database for LLM applications, based on Predis PHP client

Command Line Tools

  • ai-commit** - Automagically generate conventional git commit messages with AI. - 使用 AI 自动生成约定式 git 提交信息。
  • Laragenie** - An AI bot made for the command line that can read and understand any codebase from your Laravel app.

Video Processing

  • Subvert** - Generate subtitles, summaries, and chapters from videos in seconds

API Clients

  • AWS Rekognition** - Amazon Rekognition API for image and video analysis.
  • DeepL PHP** - Official PHP library for the DeepL language translation API.
  • Deepseek PHP Client** - ⚡️ supercharged community-maintained PHP API client that allows you to interact with deepseek API.
  • Google Cloud AI** - Google Cloud AI services in PHP.
  • OpenAI PHP** - OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
  • OpenAI PHP SDK** - OpenAI PHP SDK : Most downloaded, forked, contributed, huge community supported, and used PHP (Laravel , Symfony, Yii, Cake PHP or any PHP framework) SDK for OpenAI GPT-3 and DALL-E. It also supports chatGPT-like streaming. (ChatGPT AI is supported)

Learning Resources

  • Fun With OpenAI and Laravel** - Fun With OpenAI and Laravel In this series, you'll get your feet wet with a variety of fun examples that demonstrate how to interact with OpenAI using PHP and Laravel. We'll begin by assuming that you know nothing, and then slowly work our way up one episode at a time!
  • PHP LLM Examples** - Examples demonstrating GenAI and LLM usage in PHP.
  • PHP-ML Tutorials** - Learn how to use PHP-ML for machine learning.
  • Rubix ML Docs** - Comprehensive documentation for Rubix ML.

Contributing

Have a PHP AI library, tool, or resource to share? Feel free to submit a PR!

About

A curated list of PHP libraries and tools for AI, Machine Learning, and Natural Language Processing. Find everything you need to integrate modern AI capabilities into your PHP applications.

Resources

Stars

Watchers

Forks