apphp/awesome-php-ml

Awesome list of Machine Learning, Artificial Intelligence, NLP, LLM and Data Science libraries for PHP.

Maintainers

Package info

github.com/apphp/awesome-php-ml

pkg:composer/apphp/awesome-php-ml

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 80

Open Issues: 0

0.4.0 2026-03-14 12:36 UTC

This package is auto-updated.

Last update: 2026-03-14 12:39:35 UTC


README

Awesome GitHub stars Resources Last commit License Link Check

The most comprehensive curated list of Machine Learning, Artificial Intelligence, NLP, LLM and Data Science libraries for PHP.

Inspired by awesome-php and the broader Awesome ecosystem.

Goal: make it easy to build intelligent systems with PHP — from classic ML to modern LLM-based workflows.

Contents

Requirements

PHP Version Requirements:

  • Minimum: PHP 7.4+ (most libraries)
  • Recommended: PHP 8.1+ for best performance and features
  • Latest features: PHP 8.2+ for some cutting-edge libraries

Common dependencies:

  • Extensions: mbstring, curl, json, gd (for image processing)
  • Optional: redis, pdo_pgsql (for vector search), ffi (for native bindings)

Memory considerations:

  • Basic ML: 256MB+ RAM
  • Neural networks: 512MB+ RAM
  • Large datasets: 1GB+ RAM recommended

What is this?

  • Curated list of PHP libraries and tools for Machine Learning, AI, NLP, LLMs and Data Science.
  • Focused on code-first resources: packages, SDKs, frameworks, and building blocks.
  • Aimed at PHP developers who want to add intelligent features to existing apps or build new AI-powered systems.

How to use this list

Quick Start

For beginners new to PHP ML/AI:

# Install a core ML library
composer require rubix/ml
composer require php-ai/phpml

# Install LLM client
composer require openai-php/client

# Install vector search for RAG
composer require llphant/llphant

Basic examples:

  • Classification: Use RubixML/RubixML with KNearestNeighbors for simple classification tasks
  • LLM integration: Use openai-php/client to call GPT models from PHP
  • Text analysis: Use php-ai/php-ml for sentiment analysis and tokenization
  • Vector search: Use LLPhant/LLPhant with pgvector for semantic search

Example "recipes"

Recommended core stack

These are opinionated defaults you can reach for when you just want something that works in production.

Legend

Not all projects are tagged yet – we’re gradually adding markers as the ecosystem evolves. Treat them as rough guidance, not strict rules.

  • 🌟 – widely used / production-ready projects
  • 🧪 – experimental or research-oriented projects
  • ⚠️ – projects with limited maintenance, older APIs, or niche usage; review before using in new projects

Machine Learning

Core PHP libraries for supervised/unsupervised learning, classification, regression, and clustering.

Deep Learning & Neural Networks

PHP libraries for neural networks, deep learning architectures, and advanced learners built on tensors.

  • 🧪 rindow/rindow-neuralnetworks – Deep learning framework for PHP providing neural network layers, training utilities, and GPU/accelerated backends via the Rindow numerical computing ecosystem
  • 🌟 RubixML/RubixMLGitHub stars High-level ML framework with pipelines and datasets

Natural Language Processing

Text processing, tokenization, language detection, sentiment analysis and other NLP tasks in PHP.

Computer Vision, Image & Video Processing

Image manipulation, preprocessing, and computer vision workloads from PHP.

Math, Statistics & Linear Algebra

Numerical computing, matrix operations, statistics, and related math foundations for ML and data science in PHP.

  • 🌟 brick/mathGitHub stars Arbitrary-precision arithmetic for PHP (BigInteger, BigDecimal, BigRational)
  • 🌟 Hi-Folks/statisticsGitHub stars Probability distributions and statistical functions library for PHP
  • 🌟 markrogoyski/math-phpGitHub stars Math library for linear algebra, statistics, and calculus
  • mcordingley/LinearAlgebra – Stand-alone linear algebra library
  • ⚠️ NumPHP/NumPHP – Math library for scientific computing
  • 🧪 phpmlkit/ndarray – Multidimensional array (ndarray) implementation for PHP inspired by NumPy, useful for numerical computing and machine learning workloads
  • 🧪 rindow/rindow-math-matrix – Foundational package for scientific matrix operations
  • 🌟 RubixML/numpower – High-performance numerical computing library inspired by NumPy
  • 🌟 RubixML/TensorGitHub stars N-dimensional tensors for numerical computing

LLMs & AI APIs

Clients, SDKs, and frameworks for calling hosted LLMs and other AI providers from PHP.

  • 🧪 adrienbrault/instructrice — Typed LLM outputs in PHP with flexible schema support (OpenAI, Claude, Gemini, etc.) and type-safe handling of structured responses
  • ArdaGnsrn/ollama-php – A PHP client library for the Ollama LLM server, enabling completions, chat, model management, and embeddings via Ollama’s API
  • Clarifai/clarifai-php-grpc – Official Clarifai gRPC PHP client for accessing Clarifai’s AI APIs (vision and text recognition)
  • cognesy/instructor-php – Structured-output helper for LLM responses
  • deepseek-php/deepseek-php-client – PHP client library for integrating with the DeepSeek AI API, providing a fluent API for model queries, streaming results, and support for multiple HTTP clients and models
  • elastic/elasticsearch-chatgpt-php – Experimental PHP library that uses ChatGPT to translate natural language into Elasticsearch DSL queries and perform semantic search over your indices
  • FunkyOz/mulagent – Multi-agent orchestration framework for LLM applications
  • 🌟 google-gemini-php/clientGitHub stars Gemini PHP is a community-maintained PHP API client that allows you to interact with the Gemini AI API
  • ⚠️ HosonoDE/EasyAI-PHP – High-level AI integration library for PHP that simplifies using LLMs
  • 🧪 carmelosantana/php-agents – PHP framework for building AI agents with tool use, provider abstraction and multi-model support
  • 🌟 kambo-1st/langchain-php GitHub stars A PHP port of the LangChain framework for building composable LLM-powered applications
  • 🌟 llm-agents-php/agentsGitHub stars LM Agents is a PHP library for building and managing Language Model (LLM) based agents
  • llm-agents-php/prompt-generator – Prompt generator for LLM agents with interceptors
  • ModelFlow-AI (GitHub org) – Collection of PHP packages for unified access to AI models, embeddings, and chat (OpenAI, Mistral, Ollama)
  • mozex/anthropic-php – Community-maintained PHP API client for the Anthropic (Claude) AI API, supporting messages, streaming, tool use, and batch processing
  • mzarnecki/php-rag – PHP RAG toolkit for connecting vector search and LLMs in retrieval-augmented workflows
  • 🌟 openai-php/clientGitHub stars Official OpenAI PHP client
  • 🌟 orhanerday/open-aiGitHub stars Popular OpenAI PHP SDK
  • 🌟 prism-php/prism – Laravel package offering a unified, expressive interface for integrating Large Language Models (LLMs) and AI tools across multiple providers in your application
  • prism-php/bedrock – AWS Bedrock provider for the Prism PHP framework, adding Bedrock LLM and embeddings support to Laravel Prism integrations
  • sarfraznawaz2005/ai-team — Package to build and run collaborative teams of AI members with role/task assignments
  • SearchAugmentedLLM – PHP search-augmented LLM tool that performs web search, extracts, chunks and ranks content to provide context for LLM responses (ideal for RAG applications)
  • skito/aipi-php – Universal API client for common AI models in PHP, offering a unified interface to interact with multiple LLM providers
  • softcreatr/php-mistral-ai-sdk – PHP SDK for the Mistral AI API, providing an easy wrapper to call Mistral’s LLM and AI endpoints (chat, embeddings, fine-tuning etc.)
  • takaaki-mizuno/php-llm-json-adapter — Adapter to normalize and return LLM responses as structured JSON using JSON Schema, with support for multiple providers (OpenAI, Gemini, Bedrock, Ollama)
  • thojou/php-llm-documents — PHP library for LLM-based document processing (splitting, embeddings, vector store, search) inspired by LangChain/DocTran
  • utopia-php/agents – Simple, lightweight PHP library for AI agent orchestration with multi-provider support (OpenAI, Anthropic, Deepseek, Perplexity, XAI)

Speech & Text-to-Speech

  • b7s/fluentvox – Fluent PHP API for state-of-the-art text-to-speech and voice cloning (Resemble AI’s Chatterbox), with CLI, GPU acceleration, and multilingual support
  • b7s/whisper-php – PHP wrapper/client for Whisper speech-to-text (ASR), enabling audio transcription via Whisper models

Tokenizers & Prompt Utilities

Embeddings & Vector Search

Libraries for generating embeddings and performing vector similarity search from PHP applications.

Data Processing

ETL, data pipelines, serialization, and transformation utilities for preparing data for ML and analytics in PHP.

Interop & Model Serving

Bridging PHP with native libraries, external services, and runtimes for deploying and serving ML and LLM models.

  • 🌟 ankane/onnxruntime-phpGitHub stars Run ONNX models from PHP
  • 🌟 deepl-phpGitHub stars Official PHP client library for the DeepL API, enabling high-quality language translation via DeepL’s AI/ML service
  • distantmagic/resonance – Asynchronous PHP framework with built-in support for serving and integrating machine learning and LLM models
  • FFI – Native C/C++ bindings for ML inference
  • 🧪 garyblankenship/mcp-php – PHP example of a Model Context Protocol (MCP) server for connecting LLMs with application logic
  • 🌟 googleapis/google-cloud-phpGitHub stars Official PHP client library for Google Cloud APIs (including ML/AI services like Vision, Translate, AutoML, Vertex AI, etc.)
  • grpc/grpc-php – gRPC client for model services
  • 🧪 HossamBalaha/Deep-Learning-Classification-System-using-PHP-and-Keras – Example system showing how to integrate a Keras deep learning classifier with a PHP backend
  • logiscape/mcp-sdk-php – PHP SDK for building Model Context Protocol (MCP) clients and servers to connect LLMs with external tools and services
  • 🌟 neuron-core/neuron-aiGitHub stars PHP agentic AI framework for building and orchestrating LLMs, RAG etc
  • nlpcloud/nlpcloud-php — PHP client for the NLP Cloud API (access NLP/ML services like NER, sentiment analysis, summarization, text generation, embeddings, translation, and more)

Tools & Utilities

Supporting tools, debugging helpers, logging, and HTTP/CLI utilities commonly used in ML and AI workflows.

Laravel & Framework Integrations

LLM & AI clients

  • artisan-build/llm — Laravel integration for multiple LLM providers (OpenAI, Azure, OpenRouter, etc.), simplifying usage of large language models in Laravel apps
  • BorahLabs/LLM-Port-Laravel – Laravel package for interchangeable LLM providers, allowing drop-in replacements of large language models
  • Capevace/llm-magic – Laravel-centric LLM toolkit with support for AI features like chat and structured data extraction
  • coding-wisely/taskallama – Laravel package for seamless integration with the Ollama LLM API for AI-powered content generation, task assistance, conversation and embeddings
  • grok-php/laravel – Laravel package for integrating Grok AI models
  • 🌟 laravel/aiGitHub stars The Laravel AI SDK: a unified, expressive Laravel API for interacting with AI providers (LLMs, images, embeddings, agents, tools)
  • 🌟 laravel/boostGitHub stars Official Laravel Boost: a development server and AI context provider that accelerates AI-assisted code generation by giving AI tools detailed insight into your Laravel app (MCP server, schema inspection, docs + guidelines)
  • maestroerror/laragent – AI agent development framework for Laravel: define agents, tools, workflows, and manage LLM interactions with an Eloquent-style API
  • moe-mizrak/laravel-openrouter – Laravel package to integrate OpenRouter LLM API
  • mozex/anthropic-laravel – Laravel integration for the Anthropic (Claude) AI API with Facades, config publishing, and testing fakes
  • 🌟 neuron-core/neuron-laravelGitHub stars Laravel integration for Neuron Core to build and orchestrate AI/LLM workflows
  • atlas-php/atlas – Laravel AI application framework for structuring agents, tools, prompts, and pipelines on top of Prism PHP
  • 🌟 openai-php/laravelGitHub stars Laravel OpenAI integration
  • PapaRascal2020/sidekick – Laravel package offering a unified syntax for working with multiple AI provider APIs (OpenAI, Claude, Cohere, Mistral)
  • 🌟 php-mcp/laravelGitHub stars – Laravel package for building Model Context Protocol (MCP) servers and exposing application tools to LLMs
  • shawnveltman/laravel-openai – Laravel wrapper for OpenAI
  • rahasistiyakofficial/laravel-ai-integration — This is a comprehensive, enterprise-ready package that provides seamless integration with multiple AI providers through a unified, elegant API

Data & DTO tools

Search & vector search

Symfony & Framework Integrations

Resources

General

Courses & Tutorials

  • Fun With OpenAI and Laravel – Laracasts series showing how to integrate OpenAI into Laravel apps
  • Laravel Cloud Skills – Interactive learning platform for building and deploying Laravel applications, including modern AI and cloud workflows

ML / AI Platforms

  • ONNX Runtime – Cross-platform, high performance ML inferencing and training accelerator
  • tensorflow/tfjs — JavaScript machine learning platform for training and running models in the browser or Node.js (TensorFlow.js)

Learning Resources

License

This list is licensed under the MIT License – see LICENSE for details.

Contributing

Contributions are welcome!
Please see CONTRIBUTING.md for details, including criteria for adding new projects (maintenance, documentation, tests, etc).

↑ Back to top