1tomany / php-ai
A single, unified, framework-independent library for integration with many popular AI providers and large language models
v0.1.0
2026-08-29 21:08 UTC
Requires
- php: >=8.5
- symfony/http-client: ^7.2|^8.0|^8.1
- symfony/serializer: ^7.2|^8.0|^8.1
- symfony/validator: ^7.2|^8.0|^8.1
Requires (Dev)
- fakerphp/faker: ^1.24
- friendsofphp/php-cs-fixer: ^3.93
- phpstan/phpstan: ^2.1.55
- phpunit/phpunit: ^13.1.11
README
This library provides a single, unified, framework-independent library for integration with several popular AI providers and large language models.
Installation
Install the library using Composer:
composer require 1tomany/php-ai
Symfony Bundle
A Symfony bundle is available if you wish to integrate this library into your Symfony applications with autowiring and configuration support.
Supported platforms
- Gemini
- OpenAI
Platform features
| Feature | Gemini | OpenAI |
|---|---|---|
| Files | ||
| Upload | ✅ | ✅ |
| Delete | ✅ | ✅ |
| Indexes | ||
| Create | ✅ | ✅ |
| Read | ✅ | ✅ |
| Delete | ✅ | ✅ |
| Attach file | ✅ | ✅ |
| Read file | ✅ | ✅ |
| Delete file | ✅ | ✅ |
| Prompts | ||
| Compile | ✅ | ✅ |
| Send | ✅ | ✅ |
Indexes
An "Index" is a repository of files that are available through a semantic search (or RAG) API.
| Vendor | Resource |
|---|---|
| Anthropic | N/A |
| OpenAI | VectorStore |
| Gemini | FileSearchStore |
Prompts
A "Prompt" is a general term for data (text, files, schemas, etc) sent to a large language model for inference.
| Vendor | Resource |
|---|---|
| Anthropic | Message |
| OpenAI | Response |
| Gemini | Interaction |
Credits
License
The MIT License