Download the PHP package partitech/php-mistral without Composer

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

Mistral PHP Client

The Mistral PHP Client is a comprehensive PHP library designed to interface with the Mistral AI API.

This client support Mistral : La plateforme and Lama.cpp for local testing and development purpose.

Api is the same as the main Mistral api :

Features

Getting Started

To begin using the Mistral PHP Client in your project, ensure you have PHP installed on your system. This client library is compatible with PHP 8.3 and higher.

Installation

To install the Mistral PHP Client, run the following command:

Usage

To use the client in your PHP application, you need to import the package and initialize a new client instance with your API key.

You can see full example in the examples directory.

Chat message with La plateforme

Note that you can populate chat discussion with :

To get the same with Lama.cpp local inference :

Chat with streamed response with La plateforme

Chat with streamed response with Lama.cpp

Embeddings with La plateform

Result :

Embeddings with Lama.cpp server

Result :

Fill in the middle

Result :

Fill in the middle in stream mode

Result :

Pixtral request

Result :

Lama.cpp inference

MistralAi La plateforme is really cheap you should consider subscribing to it instead of running a local Lama.cpp instance. This bundle cost us only 0.02€ during our tests. If you really feel you need a local server, here is a docker-compose you can use for example:

with a .env file

vLLM inference

vLLM is the official inference alternative to MistralAi La plateforme. Starting to v0.6.0 vLLM is fully compatible with the tools/tool_choice from mistral's plateforme. To get an ISO instance locally you will need to specify the template: examples/tool_chat_template_mistral.jinja . Here is a docker-compose you can use for example:

vLLM inference for tool_call

vLLM inference for Pixtral

About the Response object

$client->chat() method return a Partitech\PhpMistral\Response object.

Available methods are :

All of theses methods are accessors to basic response from the server :

Method's names and response json are understandable, but here is a basic explanation :

example:

example:

example:

example:

example:

example:

example:

example:

example:

example:

Documentation

For detailed documentation on the Mistral AI API and the available endpoints, please refer to the Mistral AI API Documentation.

Contributing

Contributions are welcome! If you would like to contribute to the project, please fork the repository and submit a pull request with your changes.

License

The Mistral PHP Client is open-sourced software licensed under the MIT license.

Support

If you encounter any issues or require assistance, please file an issue on the GitHub repository issue tracker.

Thanks

This Readme.md is mostly copied from https://github.com/Gage-Technologies/mistral-go. thanks to them :)


All versions of php-mistral with dependencies

PHP Build Version
Package Version
Requires symfony/http-client Version ^6.4 || ^7.0
knplabs/php-json-schema Version ^0.1.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 partitech/php-mistral contains the following files

Loading the files please wait ....