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.
- 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.
- Classic ML / traditional models – start with php-ai/php-ml and RubixML/RubixML.
- LLM-powered apps & agents – see LLMs & AI APIs, Embeddings & Vector Search, and framework integrations (Laravel/Symfony).
- RAG (Retrieval-Augmented Generation) – combine php-rag with vector databases like pgvector or Meilisearch.
- Numerical computing & math – explore Math, Statistics & Linear Algebra for tensors, matrices, and statistics.
- Production integration – use Interop & Model Serving and framework integrations to wire models into real apps.
These are opinionated defaults you can reach for when you just want something that works in production.
- General ML: 🌟 RubixML/RubixML for end-to-end ML pipelines.
- LLM clients: 🌟 openai-php/client and 🌟 google-gemini-php/client for major model providers.
- Embeddings & vector search: 🌟 LLPhant/LLPhant with 🌟 pgvector/pgvector, 🌟 pgvector/pgvector-php, 🌟 meilisearch/meilisearch-php or 🌟 algolia/algoliasearch-client-php.
- Data processing: 🌟 flow-php/flow for typed ETL-style pipelines.
- Interop with Python ML: 🌟 swoole/phpy to call into the Python ecosystem when needed.
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.
- What is this?
- How to use this list
- Recommended core stack
- Legend
- Machine Learning
- Deep Learning & Neural Networks
- Natural Language Processing
- Computer Vision, Image & Video Processing
- Math, Statistics & Linear Algebra
- LLMs & AI APIs
- Embeddings & Vector Search
- Data Processing
- Interop & Model Serving
- Tools & Utilities
- Laravel & Framework Integrations
- Symfony & Framework Integrations
- Resources
Core PHP libraries for supervised/unsupervised learning, classification, regression, and clustering.
- dr-que/polynomial-regression – Polynomial regression for PHP
⚠️ php-ai/php-ml – Core machine learning algorithms for PHP- php-ai/php-ml-examples – Practical examples for PHP-ML
PHP libraries for neural networks, deep learning architectures, and advanced learners built on tensors.
- 🌟 RubixML/RubixML –
High-level ML framework with pipelines and datasets
Text processing, tokenization, language detection, sentiment analysis and other NLP tasks in PHP.
⚠️ angeloskath/php-nlp-tools – Natural Language Processing tools- CodeWithKyrian/transformers-php – Hugging Face–style Transformer inference in PHP using ONNX
- friteuseb/nlp_tools – Extension for NLP methods and text analysis
⚠️ patrickschur/language-detection – Language detection library- voku/stop-words – Stop word lists for many languages
- yooper/php-text-analysis – Sentiment analysis and NLP tools
Image manipulation, preprocessing, and computer vision workloads from PHP.
- aschmelyun/subvert - Generate subtitles, summaries, and chapters from videos in seconds
- Intervention/image – Image manipulation library for CV preprocessing
- jcupitt/vips – Fast image processing library with PHP bindings
- php-opencv/php-opencv – OpenCV bindings for PHP
Numerical computing, matrix operations, statistics, and related math foundations for ML and data science in PHP.
- 🌟 brick/math — Arbitrary-precision arithmetic for PHP (BigInteger, BigDecimal, BigRational)
- markrogoyski/math-php – Math library for linear algebra, statistics, and calculus
- mcordingley/LinearAlgebra – Stand-alone linear algebra library
⚠️ NumPHP/NumPHP – Math library for scientific computing- rindow/rindow-math-matrix – Foundational package for scientific matrix operations
- RubixML/numpower – High-performance numerical computing library inspired by NumPy
- 🌟 RubixML/Tensor –
N-dimensional tensors for numerical computing
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
- cognesy/instructor-php – Structured-output helper for LLM responses
- FunkyOz/mulagent – Multi-agent orchestration framework for LLM applications
⚠️ HosonoDE/EasyAI-PHP – High-level AI integration library for PHP that simplifies using LLMs- 🌟 google-gemini-php/client –
Google Gemini API client
- 🌟 kambo-1st/langchain-php
A PHP port of the LangChain framework for building composable LLM-powered applications
- 🌟 llm-agents-php/agents -
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)
- mzarnecki/php-rag – PHP RAG toolkit for connecting vector search and LLMs in retrieval-augmented workflows
- 🌟 openai-php/client –
Official OpenAI PHP client
- orhanerday/open-ai – Popular OpenAI API wrapper
- sarfraznawaz2005/ai-team — Package to build and run collaborative teams of AI members with role/task assignments
- skito/aipi-php – Universal API client for common AI models in PHP, offering a unified interface to interact with multiple LLM providers
- 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
- Gioni06/GPT3Tokenizer – PHP tokenizer compatible with GPT-3 style models
- yethee/tiktoken-php – PHP implementation of OpenAI’s tiktoken tokenizer for token counting and optimization
Libraries for generating embeddings and performing vector similarity search from PHP applications.
- 🌟 algolia/algoliasearch-client-php –
Algolia search client
- llm-agents-php/vector-storage – LLM Agents Vector Storage
- 🌟 LLPhant/LLPhant –
Comprehensive PHP generative AI framework supporting LLMs, embeddings, vector search and more
- 🌟 meilisearch/meilisearch-php –
Client for Meilisearch search engine
- 🌟 openai-php/laravel –
Laravel OpenAI integration
- 🌟 pgvector/pgvector –
Vector similarity search extension for PostgreSQL
- 🌟 pgvector/pgvector-php –
PHP client for pgvector on PostgreSQL
- redis-applied-ai/redis-vector-php — PHP client for Redis Vector Library (RedisVL) to support vector similarity search and AI-oriented queries
- voyanara/milvus-php-sdk – PHP SDK for Milvus vector database API v2
ETL, data pipelines, serialization, and transformation utilities for preparing data for ML and analytics in PHP.
- 🌟 cocur/slugify —
Converts strings into URL-friendly slugs, includes integrations for many frameworks
- 🌟 flow-php/flow –
Data processing and ETL framework for PHP with typed pipelines
- league/csv – CSV data processing
- spatie/data-transfer-object – Strongly typed DTOs
- symfony/serializer – Data normalization & serialization
Bridging PHP with native libraries, external services, and runtimes for deploying and serving ML and LLM models.
- ankane/onnxruntime-php – Run ONNX models from PHP
- 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
- grpc/grpc-php – gRPC client for model services
- 🌟 neuron-core/neuron-ai –
PHP agentic AI framework for building and orchestrating LLMs, RAG etc
Supporting tools, debugging helpers, logging, and HTTP/CLI utilities commonly used in ML and AI workflows.
- 🧪 apphp/pretty-print – Pretty-print PHP arrays and numeric data for ML debugging
- nunomaduro/collision – CLI error handling (useful for ML tools)
- psr/log – Logging standard
- 🌟 swoole/phpy –
Bridge for calling Python from PHP via a runtime bridge
- symfony/console – CLI applications
- symfony/http-client – Robust HTTP client for AI APIs
- 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
- jeremysalmon/LaravelLLMContext – Laravel package for managing and applying contextual data in LLM interactions
- 🌟 laravel/scout –
Search abstraction (useful for vector search)
- moe-mizrak/laravel-openrouter – Laravel package to integrate OpenRouter LLM API
- openai-php/laravel – Official OpenAI Laravel integration
- PapaRascal2020/sidekick – Laravel package offering a unified syntax for working with multiple AI provider APIs (OpenAI, Claude, Cohere, Mistral)
- prism-php/prism – Laravel interface for working with LLMs and AI providers
- shawnveltman/laravel-openai – Laravel wrapper for OpenAI
- spatie/laravel-data – Typed DTOs for API & AI responses
- teamtnt/laravel-scout-tntsearch-driver – Local full-text search
- rahasistiyakofficial/laravel-ai-integration — This is a comprehensive, enterprise-ready package that provides seamless integration with multiple AI providers through a unified, elegant API
- openai-php/symfony – OpenAI PHP for Symfony integration
- 🌟 symfony/ai –
Symfony AI: built-in AI components and bundles for Symfony apps
- ONNX Runtime
- tensorflow/tfjs — JavaScript machine learning platform for training and running models in the browser or Node.js (TensorFlow.js)
- Artificial Intelligence with PHP (GitBook) – Guide and reference for doing AI/ML with PHP
- 🌟 AI для PHP-разработчиков — интуитивно и на практике (GitBook) – Russian guide on AI with PHP
- Build Your Own LLM in PHP (GitBook) – Guide to building an LLM from scratch in PHP
- PHP and LLMs (eBook) – Practical book on integrating and using large language models with PHP
This list is licensed under the MIT License – see LICENSE for details.
Contributions are welcome!
Please see CONTRIBUTING.md for details, including criteria for adding new projects (maintenance, documentation, tests, etc).