Search by

illegal / laravel-ai

illegalvuppi

A laravel plugin to interact with AI providers

Package info

github.com/illegalstudio/laravel-ai

pkg:composer/illegal/laravel-ai

Fund package maintenance!

nahime0

Statistics

Installs: 32

Dependents: 0

Suggesters: 0

Stars: 7

Open Issues: 0

v0.1.4.1 2023-05-01 11:01 UTC

This package is auto-updated.

Last update: 2026-10-01 08:27:19 UTC


README

Laravel AI logo

Laravel AI

An early experiment in a fast-moving world.

Status: archived License: MIT

Born in 2023 · One interface, many AI providers · Preserved for history

Back in the “distant” year of 2023, Laravel AI began with a simple idea: one interface to connect Laravel applications to different AI providers. It never grew beyond an early experiment. Today, Laravel's official AI SDK brings that vision to life, and does it beautifully. This repository is now archived, kept as a small piece of that history.

Historical documentation

The original documentation is preserved below as a record of the project. This package is no longer maintained.

Read the original documentation

The Laravel AI package provides an interface for connecting your Laravel application with AI services, particularly with OpenAI. With this package, you can easily:

  • Send requests to OpenAI and receive responses
  • Customize the parameters of your requests
  • Keep track of all requests and responses in your database
  • Keep track of the costs of your requests

Installation

You can install the package via composer:

composer require illegal\laravel-ai

After installation, publish the configuration file:

php artisan vendor:publish --provider="[Package Name]ServiceProvider"

Configuration

In the .env file, set your OpenAI API key:

AI_OPENAI_API_KEY=YOUR_API_KEY

Command line tools

This package offers a variety of command line tools that simplify interaction with AI services. Each tool prompts you to specify a provider and a model.

The tools include:

Chat

php artisan ai:chat

This command enables you to initiate a chat with an AI. Once the command is executed, you can begin your conversation.

Completion

php artisan ai:complete

This command allows you to request the AI to complete your text. Once the command is executed, you can provide your prompt and the AI will generate a response.

Image generate

php artisan ai:image:generate

This command allows you to request the AI to generate an image. Once the command is executed, you can provide your prompt and the AI will generate an image.