PHPackages                             artisan-build/llm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. artisan-build/llm

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

artisan-build/llm
=================

A package that wraps several LLM providers for Laravel

047PHP

Since Jun 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/artisan-build/llm)[ Packagist](https://packagist.org/packages/artisan-build/llm)[ RSS](/packages/artisan-build-llm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

A package that wraps several LLM providers for Laravel
======================================================

[](#a-package-that-wraps-several-llm-providers-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/263f0204534bab90bd0385892c3e2fb6b2d2191ab4d95c8b55cceb50142328b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6172746973616e2d6275696c642f6c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/artisan-build/llm)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e53802704c7265df62be9a5c128d2d0e44df56405a425bbea9f625ff449652bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6172746973616e2d6275696c642f6c6c6d2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/artisan-build/llm/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/fac3d7edb8a89ecbecefbd6209947bc3f1b5016e4442b5a8b1b65f8e2666c888/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6172746973616e2d6275696c642f6c6c6d2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/artisan-build/llm/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9f6615c5205cea22c8bde1c7255590762633fe0de27f39056d1aa89e58e67f87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6172746973616e2d6275696c642f6c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/artisan-build/llm)

First of all, I want to acknowledge the amazing work that Nuno and Sandro have done managing the openai-php projects including the Laravel wrapper that this package replaces for us. We wrote this package to meet a few specific needs:

1. We need to allow users to bring their own keys and the way the client is created in the openai-php/laravel package makes that impossible.
2. We wanted to add hooks before the request is made and after the response is received.
3. We wanted to simplify the use of Azure and OpenRouter.ai

If none of those apply to you, then the openai-php/laravel package is a great choice, and you'll get no additional benefit from using this instead.

Support us
----------

[](#support-us)

You can support our open-source work by sponsoring [Len Woodward](https://github.com/sponsors/ProjektGopher). Since Ed lives in Europe where taxes are a bit more complicated, he doesn't participate in the sponsorship program, but you are welcome to buy him a beer if you see him at a conference.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require artisan-build/llm
```

You can publish the config file with:

```
php artisan vendor:publish --tag="llm-config"
```

This is the contents of the published config file:

```
return [
    'azure' => [
        'deployment_id' => env('AZURE_DEPLOYMENT_ID'),
        'resource_id' => env('AZURE_RESOURCE_ID'),
        'version' => env('AZURE_VERSION'),
    ],
    'openai' => [
        'api_key' => env('OPENAI_API_KEY'),
        'organization' => env('OPENAI_ORGANIZATION'),
    ],
    'openrouter' => [
        'api_key' => env('OPEN_ROUTER_API_KEY'),
    ],
    'request_timeout' => env('OPENAI_REQUEST_TIMEOUT', 30),
]
```

Usage
-----

[](#usage)

For the full documentation, please visit [our documentation site](https://artisan.build/docs/llm)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ed Grosvenor](https://github.com/edgrosvenor)
- [Len Woodward](https://github.com/projektgopher)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/55eed7400c452edf7e7adfa4f1c6676b65b5ce1867fff6bddcb80b1bb45360af?d=identicon)[edgrosvenor](/maintainers/edgrosvenor)

---

Top Contributors

[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (9 commits)")

### Embed Badge

![Health badge](/badges/artisan-build-llm/health.svg)

```
[![Health](https://phpackages.com/badges/artisan-build-llm/health.svg)](https://phpackages.com/packages/artisan-build-llm)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
