PHPackages                             adeel696/ai-wrapper - 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. adeel696/ai-wrapper

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

adeel696/ai-wrapper
===================

A Laravel AI Wrapper

v1.0.0(1y ago)02MITPHP

Since May 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/adeel696/laravel-ai-wrapper)[ Packagist](https://packagist.org/packages/adeel696/ai-wrapper)[ RSS](/packages/adeel696-ai-wrapper/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel AI Wrapper
==================

[](#laravel-ai-wrapper)

**adeel696/ai-wrapper** is a Laravel package that provides a unified interface to interact with multiple AI providers such as **OpenAI (ChatGPT)**, **Anthropic Claude**, and **Google Gemini** — all from a simple, Laravel-friendly wrapper.

---

🚀 Features
----------

[](#-features)

- 🔌 Unified interface for multiple AI providers
- 🧠 Support for OpenAI, Claude (Anthropic), and Gemini (Google)
- 📦 Works out of the box with Laravel's config and service provider system
- 🔁 Runtime switching of providers and models (`setProvider()`, `setModel()`)
- 🧰 Wrapper methods like `chat`, `summarize`, `translate`, `embed`, and more
- 🧪 Easy to extend with additional providers

---

📦 Installation
--------------

[](#-installation)

```
composer require adeel696/ai-wrapper
```

⚙️ Configuration &amp; 🧪 Usage
------------------------------

[](#️-configuration----usage)

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

Update config/ai.php as needed:

```
return [

    'default_provider' => 'openai',
    'default_model' => 'gpt-3.5-turbo',

    'providers' => [
        'openai' => ['api_key' => env('OPENAI_API_KEY')],
        'anthropic' => ['api_key' => env('ANTHROPIC_API_KEY')],
        'google' => ['api_key' => env('GOOGLE_AI_API_KEY')],
    ],

    'models' => [
        'openai' => ['default' => 'gpt-3.5-turbo'],
        'claude' => ['default' => 'claude-3-opus-20240229'],
        'gemini' => ['default' => 'gemini-pro'],
    ],
];
```

In your .env file, add the relevant API keys:

```
OPENAI_API_KEY=your-openai-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key
GOOGLE_AI_API_KEY=your-google-api-key
```

Import and Initialize
---------------------

[](#import-and-initialize)

```
use adeel696\AiWrapper\AiManager;

$ai = new AiManager();
```

Usage Examples

🔁 Set Provider and Model (Optional)

```
$ai->setProvider('claude')->setModel('claude-3-opus-20240229');
```

💬 Chat (Default Provider)

```
$response = $ai->chat("Tell me about Laravel.");
echo $response;
```

📄 Summarize Text

```
$text = "Laravel is a PHP framework designed for web artisans...";
echo $ai->summarize($text);
```

🌐 Translate Text

```
echo $ai->translate("How are you?", "es");
```

🧠 Embed Text (for semantic search)

```
$vector = $ai->embed("What is AI?");
print_r($vector);
```

🎧 Transcribe Audio

```
$response = $ai->transcribeAudio(storage_path('audio/voice.mp3'));
echo $response;
```

🧩 Stream Output (if supported by provider)

```
$ai->stream("Tell me a joke.", function ($chunk) {
    echo $chunk;
});
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance46

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

407d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17796291?v=4)[Adeel Abbasi](/maintainers/adeel696)[@adeel696](https://github.com/adeel696)

---

Top Contributors

[![adeel696](https://avatars.githubusercontent.com/u/17796291?v=4)](https://github.com/adeel696 "adeel696 (5 commits)")

### Embed Badge

![Health badge](/badges/adeel696-ai-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/adeel696-ai-wrapper/health.svg)](https://phpackages.com/packages/adeel696-ai-wrapper)
```

###  Alternatives

[mettle/sendportal

SendPortal. Open-source self-hosted email marketing. Manage your own newsletters at a fraction of the cost.

2.1k4.4k](/packages/mettle-sendportal)[povils/figlet

Figlet text generator - PHP

627.8k5](/packages/povils-figlet)

PHPackages © 2026

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