Awesome PHP AI
A curated list of awesome PHP libraries and tools for AI, Machine Learning, and Natural Language Processing.
Contributions welcome! Read the contributing guidelines to get started.
Full-featured frameworks for building LLM-powered applications.
Repo
Description
Magic
Open-source all-in-one AI productivity platform with agents, workflows, and collaboration.
Prism
Unified interface for working with LLMs in Laravel applications.
Neuron AI
PHP Agentic Framework for production-ready AI applications with RAG and multi-agent workflows.
LLPhant
Comprehensive PHP Generative AI Framework using OpenAI GPT-4. Inspired by Langchain.
langchain-php
Building applications with LLMs through composability in PHP.
Vizra ADK
Build, test, and deploy intelligent AI agents the Laravel way.
Resonance
High-performance PHP framework optimized for IO-intensive LLM applications.
LLM Chain
PHP library for building LLM-based and AI-based features and applications.
Lugha
PHP Generative AI Framework to build chatbots, RAG systems and AI-powered applications.
EasyAI-PHP
Simplifies AI entry for PHP developers (LangChain-style). Based on PHP 8.1+.
EleLLM
A PHP framework that makes working with LLMs more pleasurable and accessible.
Client libraries and provider integrations.
Repo
Description
OpenAI PHP
Supercharged community-maintained PHP API client for OpenAI.
OpenAI PHP SDK
Most downloaded PHP SDK for OpenAI GPT-3, DALL-E, and ChatGPT with streaming support.
Gemini PHP
Community-maintained PHP API client for Gemini AI.
WordPress PHP AI Client
Provider-agnostic PHP AI client SDK for any generative AI model.
Ollama PHP
PHP client for Ollama, enabling local LLM deployment and interaction.
grok-php/laravel
Integrate Grok AI into Laravel with an elegant, developer-friendly package.
Laravel OpenRouter
Laravel integration for OpenRouter's unified LLM API interface.
AI Access
Flexible PHP library for Gemini, OpenAI, Anthropic, DeepSeek, Grok via consistent interface.
Anthropic PHP
Community-maintained PHP API client for Anthropic (Claude) API with streaming, tool use, and batch processing.
aipi-php
Universal API client for common AI models.
Sidekick
Laravel package with common syntax for Claude, Mistral, Cohere and OpenAI APIs.
LLM-Port-Laravel
Drop-in replacement wrapper for popular LLMs in Laravel.
Natural Language Processing
Structured Output & Validation
Repo
Description
Instructor PHP
Unified LLM API, structured data outputs with LLMs, and agent SDK - in PHP.
instructrice
Typed LLM outputs in PHP. Supports GPT, Claude, Gemini or any OpenAI-compatible provider.
AI Agents & Orchestration
Repo
Description
LLM Agents
Build and manage LLM-based autonomous agents that perform complex tasks.
ai-team
Create teams of AI members that collaborate to achieve common goals.
mulagent
Multi-agent orchestration with routines and handoffs.
Repo
Description
cocur/slugify
Converts strings into slugs.
NlpTools
Collection of NLP tools and APIs for working with text.
transformers-php
Toolkit for PHP developers to add machine learning magic easily.
CTX Generator
Tool that solves context management when working with LLMs - organizes codebase info for AI assistants.
TOON PHP
Token-Oriented Object Notation - compact data format for reducing token consumption with LLMs.
php-ai-tool-bridge
AI integration to interact with your own code and services.
single-file-php-ai
Drop-in, single-file PHP chat interface for Ollama/OpenAI. No Node.js, no Docker.
mcp-php
Setting up a Model Context Protocol (MCP) Server in Laravel.
prompt-generator
Prompt generator for LLM agents with interceptors.
php-llm-documents
Brings LLM functionality for document processing.
fabric-pattern
Slim PHP wrapper for Daniel Miessler's fabric pattern.
php-llm-json-adapter
JSON output adapter for LLMs that lack native function calling.
fireworksai-adapter
Adapter for open-source models hosted by fireworks.ai.
Repo
Description
Rubix ML
Machine learning library for building algorithms and models.
php-ml
A PHP machine learning library.
Repo
Description
opencv/opencv-php
OpenCV bindings for PHP for image processing and computer vision.
Repo
Description
php-rag
LLM-powered text generation with database-backed retrieval.
redis-vector-php
Redis Vector Library for LLM applications, based on Predis.
vector-storage
LLM Agents Vector Storage.
Repo
Description
ai-commit
Automagically generate conventional git commit messages with AI.
Laragenie
AI bot for the command line that reads and understands Laravel codebases.
Repo
Description
Subvert
Generate subtitles, summaries, and chapters from videos in seconds.
Repo
Description
Google Cloud AI
Google Cloud AI services in PHP.
DeepL PHP
Official PHP library for the DeepL language translation API.
AWS Rekognition
Amazon Rekognition API for image and video analysis.
Tutorials & Documentation
Repo
Description
brick/math
Arbitrary precision mathematics in PHP.
php-ai/php-ds
PHP data structures extension for performance.
Contributions are welcome! Please follow these steps:
Fork the repository
Add your library/tool to the appropriate section
Include the library name, GitHub link, and a brief description
Submit a pull request
Please ensure your submission is relevant to PHP and AI/ML/NLP.
To the extent possible under law, the contributors have waived all copyright and related rights to this work.