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.
Download partitech/php-mistral
More information about partitech/php-mistral
Files in partitech/php-mistral
Package php-mistral
Short Description Connect to Mistral | Anthropic | Xai | Hugging Face | LamaC++ | Vllm | Ollama
License MIT
Informations about the package php-mistral
PhpMistral
[!IMPORTANT] 📖 Official Documentation is available here: https://php-mistral.partitech.com/
Make sure to visit for in-depth guides, examples, and advanced usage.
PhpMistral is an open-source PHP client designed to interact with various LLM inference servers (like Mistral, Hugging Face TGI, vLLM, Ollama, llama.cpp, xAI, and more), embedding servers, and Hugging Face datasets.
It provides a unified interface for chat completions (streaming & non-streaming), embeddings (dense & sparse), reranking, guided JSON generation, document generation, and Hugging Face dataset management.
[!TIP] Perfect for developers building AI-driven PHP applications: chatbots, document search, reranking, embeddings, or dataset management for finetuning.
🛠 PSR-18 Compatible HTTP Client
PhpMistral has been fully refactored to comply with PSR-18 recommendations (PHP Standards Recommendation for HTTP clients).
This means you can plug in any HTTP client that implements PSR-18, including:
- Guzzle
- Symfony HttpClient
- cURL-based clients
- Buzz
- Any other compliant client!
[!IMPORTANT] The library does not lock you into any specific HTTP client. Choose the one that best fits your framework, performance needs, or preferences.
Whether you're using Symfony, Laravel, or a custom stack, PhpMistral integrates seamlessly into your environment.
This ensures flexibility, interoperability, and future-proofing of your PHP AI integrations.
Key Features
- Open-source:
- Free to use, modify, and contribute to.
- Framework-agnostic:
- Compatible with any PHP framework (Laravel, Symfony, Slim, custom apps, etc.).
- Multi-backend support:
- OpenAI, Mistral Platform, Hugging Face TGI, vLLM, Ollama, llama.cpp, xAI, and more.
- Chat completions:
- Streaming and non-streaming interactions.
- Embeddings:
- Dense embeddings and sparse embeddings (Splade pooling).
- Reranking API:
- Compare and rank multiple documents based on a query.
- Guided JSON generation:
- Ensure structured outputs based on a schema.
- Document generation (Mistral):
- Generate structured documents directly from models.
- Pooling API (vLLM):
- Efficient load balancing across multiple vLLM servers.
- Hugging Face Dataset API:
- Seamlessly interact with Hugging Face datasets, list files, download, manage, and search datasets directly from PHP.
Supported Providers & Features
Core Features
Provider | Chat (stream) | Chat (non-stream) | Embeddings | Sparse Embeddings |
---|---|---|---|---|
Mistral Platform | ✅ | ✅ | ✅ | |
Hugging Face TGI | ✅ | ✅ | ✅ | |
vLLM | ✅ | ✅ | ✅ | |
Ollama | ✅ | ✅ | ✅ | |
llama.cpp | ✅ | ✅ | ✅ | |
xAI | ✅ | ✅ | ✅ | |
Text Embedding Inference | ✅ | ✅ |
Advanced Features
Provider | Rerank | Guided JSON | Documents | Pooling | HF Datasets |
---|---|---|---|---|---|
Mistral Platform | ✅ | ✅ | ✅ | ||
Hugging Face TGI | ✅ | ✅ | ✅ | ||
vLLM | ✅ | ✅ | ✅ | ||
Ollama | ✅ | ✅ | |||
llama.cpp | ✅ | ✅ | |||
xAI | ✅ | ✅ | |||
Text Embedding Inference |
Installation
Example Usages
Chat Completion (Streaming)
Dense Embedding
Sparse Embedding (Splade Pooling)
Rerank
Hugging Face Dataset Management
[!TIP] Combine Hugging Face Datasets with Embeddings and Reranking to build advanced search or finetuning pipelines directly in PHP.
Contributing
We welcome contributions!
Help us make PhpMistral safer, richer, and more powerful.
Feel free to:
- Submit issues or ideas 💡
- Improve documentation 📚
- Add support for new providers or features 🚀
- Fix bugs 🐛
[!IMPORTANT] Whether you're a beginner or an experienced developer, your help is valuable!
Join us in making PhpMistral the go-to PHP library for AI integrations.
License
MIT License
All versions of php-mistral with dependencies
ext-fileinfo Version *
ext-http Version *
symfony/mime Version ^7.2
ramsey/uuid Version ^4.7
knplabs/php-json-schema Version ^0.1.0
psr/http-client-implementation Version *
psr/http-factory-implementation Version *
php-http/discovery Version ^1.20
psr/http-client Version ^1.0
nyholm/psr7 Version ^1.8
php-http/multipart-stream-builder Version ^1.4
ext-zip Version *
czproject/git-php Version ^4.4
logiscape/mcp-sdk-php Version ^1.1
monolog/monolog Version ^3.9