LLPhant: a PHP framework for LLM apps and vector stores
LLPhant - A comprehensive PHP Generative AI Framework using OpenAI GPT 4. Inspired by Langchain
At a glance
- What is it?
- LLPhant gives PHP developers an OpenAI-first toolkit for chat, embeddings, RAG pipelines and agents, wrapped as a Composer package that works inside Symfony and Laravel. It is a good fit when your application already lives in PHP; it is the wrong tool when you need a provider the framework has not wired up.
- Who is it for?
- Adopt LLPhant if your application is already PHP and you want chat, embeddings and retrieval behind one Composer dependency rather than hand-rolled HTTP calls to OpenAI. Do not adopt it if you need a provider outside the supported list, or if you expect the README alone to teach you the API; the documentation lives in the docs directory and at llphant.readthedocs.org.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly PHP, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What LLPhant solves for PHP teams
Most generative AI tooling assumes Python or TypeScript. A PHP shop that wants a chat endpoint, an embedding index or a retrieval-augmented answer usually ends up writing its own HTTP client against the OpenAI API, then rebuilding the same prompt assembly and document splitting logic on every project. LLPhant packages that layer as a Composer library, and the README frames the goal narrowly: "as simple as possible, while still providing you with the tools you need to build powerful apps." The audience is therefore PHP developers working inside Symfony or Laravel, both of which the README names as compatible.
The project positions itself against LangChain and LlamaIndex, listing both under the projects it learned from, and it credits the OpenAI PHP SDK as its main client. That lineage matters for expectations: this is a port of a familiar shape into PHP, not a new abstraction. If you have used LangChain, the concepts (chat models, embeddings, vector stores, agents) transfer directly. If you have not, the library still assumes you know what an embedding is and why you would store one.
How the pieces fit together
The repository layout separates concerns in a way that is visible without reading the source: src/ holds the library, examples/ holds runnable demonstrations, and docs/ holds the written documentation. The example directories are the most informative part of the tree for judging scope, because they show the intended end-to-end shapes rather than isolated classes. Three stand out: examples/qa-chatbot-laravel-vercel-ai/, which pairs the library with Laravel and the Vercel AI SDK; examples/doctrine-odm-vector-search/, which shows vector search backed by Doctrine ODM; and examples/TermwindCliOutputUtils/, which suggests the project is also used to build command-line interfaces.
The dependency direction is worth stating plainly. LLPhant sits above the OpenAI PHP SDK and below your application. Your code constructs a model object, feeds it prompts or documents, and receives text or vectors back. Retrieval is assembled from parts: you embed documents, store the vectors somewhere, embed the query, and pass the retrieved chunks into a prompt. The library provides the connectors, not a hosted service. Nothing in the README suggests a server component, a database of its own, or a background worker, so the operational surface stays inside your existing PHP deployment.
Provider support is explicit and closed-ended. The README lists OpenAI, Anthropic, Mistral, Ollama, llmman, LM Studio, Atlas Cloud, and any service compatible with the OpenAI API such as LocalAI. Ollama is called out as the route to running models locally, with Llama 2 named as an example. That list is the boundary of what you get without writing an adapter yourself.
Installing LLPhant and running a first call
The README states PHP 8.1 or higher as a requirement and points at Composer as the install path. The package name on Packagist is theodo-group/llphant, which is worth noting because the repository is LLPhant/LLPhant; the vendor prefix differs from the GitHub organisation.
composer require theodo-group/llphantOne wrinkle appears immediately. The GD extension is required, and the README offers an escape hatch for setups where adding it is inconvenient: the --ignore-platform-req=ext-gd option. Use it only if you understand that you are skipping a platform requirement rather than satisfying it.
composer require theodo-group/llphant --ignore-platform-req=ext-gdIf you want unreleased work rather than the tagged release, the README gives a dev-main install. This is the branch the project itself develops on, so treat it as moving.
composer require theodo-group/llphant:dev-mainThe README also warns that you may need to check the requirements for the OpenAI PHP SDK, since it is the main client. In practice that means your first debugging session is likely to be about credentials and HTTP configuration rather than about LLPhant itself. For a first real use, the honest starting point is the examples directory rather than the README: examples/qa-chatbot-laravel-vercel-ai/ is the closest thing to a complete application, and reading it before writing your own wiring will save you from guessing at constructor arguments the README does not show.
Where LLPhant stops short
The README is thin in a way that matters. It documents installation and provider support, and then defers: "Find documentation in the docs directory or online at https://llphant.readthedocs.org." There is no quickstart snippet in the README itself, no configuration example, and no listing of environment variables. A developer evaluating the library from the repository front page alone cannot tell how to instantiate a chat model or where the API key goes. That is a real friction point, and it is not hidden by the project; it is simply the shape the README has taken.
The second limitation is provider coverage. The list is longer than most PHP equivalents, but it is still a list. Anything outside OpenAI, Anthropic, Mistral, Ollama, llmman, LM Studio, Atlas Cloud, or an OpenAI-compatible endpoint is your problem to solve. If your organisation has standardised on a provider in that gap, LLPhant is the wrong tool and you should not spend time bending it.
Third, the abstraction is a convenience layer, not a guarantee. Because the library sits on top of the OpenAI PHP SDK, the features available to you track that SDK's surface, and the README explicitly sends you to that project's requirements page. Version drift between the two is a category of problem you inherit. None of this makes the library a bad choice; it makes it a choice with a documented centre of gravity.
LLPhant compared with calling the SDK directly
The real alternative for most PHP teams is not another framework. It is the OpenAI PHP SDK on its own, which LLPhant already depends on. The difference in approach is the level at which you work. With the SDK alone you get a typed client for the OpenAI API: you send messages, you receive completions, and you manage conversation state, retries and prompt construction yourself. With LLPhant you get that plus the vocabulary of a framework, meaning model abstractions that can be swapped across the supported providers, embedding helpers, and the retrieval pieces needed to build a question-answering flow over your own documents.
The trade is control against assembly. Direct SDK use means no layer between you and the API, so every parameter the provider offers is reachable and every failure is legible. LLPhant means fewer decisions, but also fewer escape hatches, and a bug in the abstraction costs you a debugging session inside someone else's code. For a single chat feature, the SDK alone is probably enough. For a document-grounded assistant where you would otherwise write chunking, embedding and retrieval by hand, the framework earns its place. The examples/doctrine-odm-vector-search/ directory is the clearest signal of which side of that line the project is aiming at.
Maintenance, licence and upgrade cost
The repository is not archived, and the last push was on 2026-09-07. The release history is short and recent: 1.0.0 on 2026-07-06, 1.0.1 on 2026-07-26, and 1.0.2 on 2026-09-07, the same day as the last push. The project crossed into 1.x only in July 2026, which means the API is young enough that minor releases can still move things. Pinning a specific version and reading the release notes before upgrading is the sensible posture, and the README's own dev-main option is a reminder that the main branch is ahead of the tags.
Licensing is MIT, stated in the repository and in LICENSE.md. In practical terms that is a permissive licence: you can use the library in commercial and closed-source applications. This is not legal advice, and if your organisation has a policy review for third-party dependencies, MIT is usually the easiest category to clear. The one thing to check is the licence of the OpenAI PHP SDK and any vector store client you pair with it, since those are separate projects with their own terms. Maintenance cost on your side is mostly the cost of the provider SDK underneath, not of LLPhant itself.
Editorial conclusion
Adopt LLPhant if your application is already PHP and you want chat, embeddings and retrieval behind one Composer dependency rather than hand-rolled HTTP calls to OpenAI. Do not adopt it if you need a provider outside the supported list, or if you expect the README alone to teach you the API; the documentation lives in the docs directory and at llphant.readthedocs.org. Before committing, verify on your own machine that composer require theodo-group/llphant resolves under your PHP version and that the ext-gd requirement is acceptable, then read the docs for the vector store you intend to use, because that choice decides how much of the retrieval pipeline you still have to build.
Frequently asked questions
How do I install LLPhant in a PHP project?
Install it with Composer using the package name theodo-group/llphant, on PHP 8.1 or higher. If the GD extension is missing and you do not want to add it, the README offers the --ignore-platform-req=ext-gd flag, and dev-main is available for unreleased features.
Which LLM providers does LLPhant support?
The README lists OpenAI, Anthropic, Mistral, Ollama, llmman, LM Studio and Atlas Cloud, plus any service compatible with the OpenAI API such as LocalAI. Ollama is the documented route for running models locally.
Does LLPhant work with Laravel and Symfony?
Yes. The README states the framework is compatible with Symfony and Laravel, and the repository includes examples/qa-chatbot-laravel-vercel-ai/ as a Laravel-based example application.
Where is the LLPhant documentation?
The README points to the docs directory in the repository and to https://llphant.readthedocs.org. The README itself covers installation and provider support rather than API usage.
What licence does LLPhant use?
The repository states MIT and includes LICENSE.md. That permits use in commercial and closed-source applications, though the OpenAI PHP SDK it depends on has its own licence to check separately.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/llphant-llphant)