Download the PHP package jarir-ahmed/php-llm without Composer

On this page you can find all versions of the php package jarir-ahmed/php-llm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-llm

jarir-ahmed/php-llm

A framework-agnostic unified AI/LLM toolkit for PHP — one fluent API over many LLM, embedding and vector-database providers, plus RAG, agents, memory, cost/token tracking and structured output.

This package merges and extends manik/neuro and manik/cortex (which are the same Laravel package under two names) into a single library with zero framework coupling — no laravel/framework dependency. Works in Laravel, Symfony, WordPress, Slim, or plain PHP.

PHP


What changed vs. neuro/cortex

Area neuro / cortex php-llm
Framework Requires laravel/framework None — pure PHP + Guzzle
Bootstrap ServiceProvider + Facade Client::create() factory
HTTP Illuminate\Support\Facades\Http Guzzle-backed Support\Http (same fluent API) + retry + true SSE streaming
Config Laravel config() Support\Config (dot-access, env fallback)
DB (memory/pgvector) Illuminate\...\DB raw PDO with self-healing tables
Session memory Laravel session SessionStore ($_SESSION / in-memory / pluggable)
Cost tracking flags only Pricing + Usage: real USD estimates per call
Structured output JSON-schema ->structured() (native or instruct+parse)
Providers 7 LLMs + DeepSeek, Groq, Azure OpenAI, OpenRouter
Fluent client shared, stateful builder fresh Generation per call + ask(), conversation()

Install

Requires PHP 8.3+. ext-pdo is only needed for the persistent-memory and pgvector drivers.

Quick start

Any value you don't override falls back to the packaged defaults, which read from environment variables (e.g. OPENAI_API_KEY). So in production you can often just do Client::create().

LLM providers

Provider Key Notes
OpenAI openai
Anthropic anthropic
Google Gemini gemini
Ollama ollama local, no key
xAI Grok grok
Mistral mistral
Cohere cohere
DeepSeek deepseek new
Groq groq new
Azure OpenAI azure new — set base_url (endpoint) + deployment
OpenRouter openrouter new — optional referer/title headers

Cost & token tracking

Every chat() result carries normalized usage and an estimated cost (USD). Prices live in Pricing and are overridable:

Hook every call for logging/metering:

Structured output (JSON)

Uses native response_format JSON-schema on OpenAI-compatible providers, and an instruction + tolerant parser everywhere else.

Streaming

OpenAI-family drivers stream true Server-Sent Events token-by-token via the Guzzle stream body.

Conversations with memory

Memory drivers: session (web), conversation (in-process), persistent (PDO, self-creating table).

Embeddings, vectors & RAG

Vector drivers: qdrant, pinecone, pgvector (PDO), weaviate, milvus, chroma.

Agents & tool calling

Using inside a framework

Nothing framework-specific is required. In Laravel/Symfony just build the client once in a service/container binding:

You can also plug your framework's session and DB in: SessionStore::use($yourStore) and Client::useDatabase('default', $pdo).

Testing without network

For driver-level tests, inject a Guzzle mock: PendingRequest::useClient($guzzleWithMockHandler).

Architecture

Credits

Built on the excellent work of Manik Mia (manik/neuro, manik/cortex). This package re-architects that code to be framework-agnostic and adds cost tracking, structured output, extra providers, and a polished fluent client.

License

MIT.


All versions of php-llm with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.5
psr/http-message Version ^1.1 || ^2.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jarir-ahmed/php-llm contains the following files

Loading the files please wait ...