Download the PHP package saqqal/llm-integration-bundle without Composer

On this page you can find all versions of the php package saqqal/llm-integration-bundle. 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 llm-integration-bundle

๐Ÿค– LLMIntegrationBundle

License: MIT PHP Version Symfony Version

LLMIntegrationBundle is a powerful Symfony bundle that seamlessly integrates Large Language Models (LLMs) into your Symfony applications. With support for multiple AI providers and a flexible architecture, it's designed for easy extension and customization.

๐Ÿ“š Table of Contents

โœจ Features

๐Ÿ“ฆ Installation

Install the bundle using Composer:

๐Ÿ› ๏ธ Configuration

  1. Register the bundle in config/bundles.php:

  2. Create config/packages/llm_integration.yaml:

  3. Set the API key in your .env file:

๐Ÿš€ Usage

Injecting the AI Service

Inject AiServiceInterface into your services or controllers:

Generating Responses

Use the generate method to send prompts and receive responses:

Changing Output Type

You can change the output type to DynamicAiResponse for more flexible access to API responses:

๐Ÿค Available AI Clients

LLMIntegrationBundle supports the following AI clients:

  1. API Together (ApiTogetherClient)
  2. OpenAI (OpenAiClient)
  3. Anthropic (AnthropicClient)
  4. Arliai (ArliaiClient)
  5. Deepinfra (DeepinfraClient)
  6. Groq (GroqClient)
  7. HuggingFace (HuggingFaceClient)
  8. Mistral (MistralClient)
  9. OpenRouter (OpenRouterClient)
  10. Tavily (TavilyClient)

To use a specific client, set the llm_provider in your configuration to the corresponding provider name.

๐Ÿ’ป CLI Commands

Generate a new AI service class

Follow the prompts to enter the provider name and API endpoint.

List available AI clients

This command will list all available AI clients that are tagged with the @AiClient attribute.

๐Ÿ”ง Extending the Bundle

To add a new AI provider:

  1. Create a new client class extending AbstractAiClient:

  2. Update your configuration to use the new provider:

๐Ÿšฆ Exception Handling

Create an event subscriber to handle LlmIntegrationExceptionEvent:

๐Ÿงช Testing

Run the test suite:

๐Ÿ“„ License

This bundle is released under the MIT License. See the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Abdelaziz Saqqal - LinkedIn - Portfolio

๐Ÿค Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

๐Ÿ“š Documentation

For more detailed documentation, please visit our [Wiki]().


All versions of llm-integration-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
symfony/framework-bundle Version ^6.0 || ^7.0
symfony/http-client Version ^6.0 || ^7.0
symfony/monolog-bundle Version ^3.10
symfony/yaml 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 saqqal/llm-integration-bundle contains the following files

Loading the files please wait ....