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

20 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

  • LLPhant - A comprehensive PHP Generative AI Framework using OpenAI GPT 4. Inspired by Langchain.
  • EleLLM - A PHP framework that makes working with LLMs more pleasurable and accessible.
  • php-llms - A practical guide and toolkit for PHP developers integrating LLMs into existing projects.
  • php-ml - A PHP machine learning library.
  • php-rag - Application using LLM (Llama3/GPT-4) for text generation with database-backed retrieval.
  • cocur/slugify - Converts a string into a slug (NLP utility).
  • Prism - A unified interface for working with LLMs in Laravel applications.
  • Instructor PHP - Extract structured data from LLM outputs with type safety and validation.
  • Resonance - High-performance PHP framework optimized for IO-intensive LLM applications.
  • Ollama PHP - PHP client for Ollama, enabling local LLM deployment and interaction.
  • LLM Chain Bundle - Symfony bundle for seamless integration of the LLM Chain library.
  • LLM Chain - Comprehensive PHP library for building LLM-powered applications.
  • 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.
  • mcp-php - Setting Up a Model Context Protocol (MCP) Server in Laravel
  • transformers-php - Transformers PHP is a toolkit for PHP developers to add machine learning magic to their projects easily.
  • 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.
  • langchain-php - Building applications with LLMs through composability in PHP
  • Lugha - Lugha is a PHP Generative AI Framework to build chatbot, RAG systems and AI-powered applications
  • laravel-llm-prompt - laravel-llm-prompt manager
  • LLM-Port-Laravel - Wrapper around the most popular LLMs that allows drop-in replacement of large language models in Laravel.
  • ai-team - A package allowing to create team of AI members that can work and collaborate together to achieve a common goal.
  • 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).
  • 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.
  • prompt-generator - Prompt generator for LLM agents with interceptors
  • instructrice - Typed LLM Outputs in PHP. Supports GPT, Claude, Gemini or any OpenAI compatible provider!
  • llm - Provides Laravel integrations for various LLM providers
  • 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.
  • LaravelLLMContext - Artisan Command to Generate LLM Context for a Laravel Project
  • llm-magic - LLM-agnostic AI toolkit for Laravel
  • php-llm-documents - PHP LLM Documents is a powerful PHP library that brings LLM (Large Language Model) functionality into the PHP ecosystem.
  • fireworksai-adapter - The adapter integrates open-source models hosted by fireworks.ai into Modelflow AI.
  • 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.
  • fabric-pattern - Slim PHP wrapper for Daniel Miessler's fabric pattern
  • aipi-php - Universal API client for common AI models
  • Sidekick - Say hello to Sidekick! A Laravel package that provides a common syntax for using Claude, Mistral, Cohere and OpenAi APIs.
  • Laravel OpenRouter - Laravel integration for OpenRouter's unified LLM API interface.

Machine Learning

  • 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.

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

Vector Storage

API Clients

  • 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)
  • Google Cloud AI - Google Cloud AI services in PHP.
  • AWS Rekognition - Amazon Rekognition API for image and video analysis.

Learning Resources

  • PHP LLMs Book - Practical guide for PHP developers on integrating LLMs into projects.
  • 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!
  • elasticsearch-chatgpt-php - Use ChatGPT to search in Elasticsearch using natural language
  • 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