Download the PHP package debjit/php-ai-hub without Composer

On this page you can find all versions of the php package debjit/php-ai-hub. 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-ai-hub

PHP AI Hub (Laravel) — Use AI providers without their SDKs

A lightweight Laravel package that provides a unified way to call AI providers (like OpenAI and Anthropic) using simple HTTP connectors and provider stubs — no vendor SDKs required.

This package focuses on:

Requirements

Installation

Laravel package discovery should auto-register the service provider.

Publish Configuration

This will publish:

If these files already exist, review and merge as needed.

Environment Variables

Set the required keys for the providers you intend to use.

OpenAI:

Anthropic:

You can override the base URLs to route through proxies/gateways if needed.

Configuration Overview

Main hub configuration: config/ai-hub.php

Example (high-level):

Per-provider configuration:

How config is resolved:

Core Concepts

You don’t install SDKs for each provider: we model the minimal HTTP required.

Quick Start

Resolve the default provider (configured via AI_HUB_DEFAULT_PROVIDER or config/ai-hub.php):

Or explicitly:

Example: OpenAI Chat Completion

Notes:

Example: Anthropic Messages

Notes:

Streaming (if supported)

If a provider supports streaming, the stub may expose a streaming method:

Refer to the specific provider stub for supported features.

Service Container Usage

You can type-hint the registry wherever needed:

Adding a New Provider

1) Create a provider config: config/ai-hub/{provider}.php

2) Implement a connector:

3) Implement a provider stub:

4) Register in main config:

5) Use it:

Guidelines:

Error Handling & Troubleshooting

Testing

Security

Versioning

Follow semantic versioning (SemVer). Breaking changes will bump the major version.

License

MIT License. See LICENSE file.

Credits

Crafted for teams that prefer HTTP-first integrations with AI providers in Laravel without heavyweight SDKs.


All versions of php-ai-hub with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2 || ^8.3
composer-plugin-api Version ^2.2
symfony/filesystem Version ^6.0 || ^7.0
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 debjit/php-ai-hub contains the following files

Loading the files please wait ...