onemoreangle / llm-unchained
A PHP library for interacting with different LLM providers
Requires
- php: >=8.2
- oskarstark/enum-helper: ^1.5
- phpdocumentor/reflection-docblock: ^5.4
- phpstan/phpdoc-parser: ^2.1
- psr/cache: ^3.0
- psr/log: ^3.0
- symfony/clock: ^6.4 || ^7.1
- symfony/http-client: ^6.4 || ^7.1
- symfony/property-access: ^6.4 || ^7.1
- symfony/property-info: ^6.4 || ^7.1
- symfony/serializer: ^6.4 || ^7.1
- symfony/type-info: ^7.2.3
- symfony/uid: ^6.4 || ^7.1
- webmozart/assert: ^1.11
Requires (Dev)
- codewithkyrian/chromadb-php: ^0.2.1 || ^0.3
- mongodb/mongodb: ^1.21
- php-cs-fixer/shim: ^3.70
- phpstan/phpstan: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^11.5
- probots-io/pinecone-php: ^1.0
- rector/rector: ^2.0
- symfony/console: ^6.4 || ^7.1
- symfony/css-selector: ^6.4 || ^7.1
- symfony/dom-crawler: ^6.4 || ^7.1
- symfony/dotenv: ^6.4 || ^7.1
- symfony/event-dispatcher: ^6.4 || ^7.1
- symfony/finder: ^6.4 || ^7.1
- symfony/process: ^6.4 || ^7.1
- symfony/var-dumper: ^6.4 || ^7.1
Suggests
- codewithkyrian/chromadb-php: For using the ChromaDB as retrieval vector store.
- mongodb/mongodb: For using MongoDB Atlas as retrieval vector store.
- probots-io/pinecone-php: For using the Pinecone as retrieval vector store.
- symfony/css-selector: For using the YouTube transcription tool.
- symfony/dom-crawler: For using the YouTube transcription tool.
Conflicts
- mongodb/mongodb: <1.21
This package is auto-updated.
Last update: 2025-04-07 06:36:29 UTC
README
PHP library to incorporate LLMs (Large Language Models) into your applications.
Warning
This project is unstable and under development
Origin
This project originates from a direct fork/clone of the llm-chain project. The foundational work by the authors is gratefully acknowledged and appreciated.
llm-unchained
was created primarily because the process of adding features for real-world use cases using llm-chain
was found to be significantly hampered by overly restrictive design constraints (architectural as well as code style). These choices consistently slowed development progress. llm-unchained
seeks to provide a balance that allows developers (myself included) to prototype more quickly and to provide the needed functionality and integrations more rapidly and with less friction.
Requirements
- PHP 8.2 or higher
Installation
The recommended way to install llm-unchained is through composer:
composer require onemoreangle/llm-unchained
Examples
See examples folder to run example implementations using this library.
Depending on the example you need to export different environment variables
for API keys or deployment configurations or create a .env.local
based on .env
file.
Documentation
For documentation in addition to the examples, please consult the documentation of the original llm-chain for now, but be aware that the APIs, classes, and methods may differ from the original llm-chain
project.
Note The examples within this repository should always be up to date with the current state of the codebase, so they are the best source of truth on how to use the library.
Contributing
Currently, this project is maintained by the author but collaborations are definitely welcome, so please feel free to open issues or pull requests.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Fixture Licenses (from original project)
For testing multi-modal features, the repository contains binary media content, with the following owners and licenses:
tests/Fixture/image.jpg
: Chris F., Creative Commons, see pexels.comtests/Fixture/audio.mp3
: davidbain, Creative Commons, see freesound.org