Download the PHP package memran/marwa-ai without Composer
On this page you can find all versions of the php package memran/marwa-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download memran/marwa-ai
More information about memran/marwa-ai
Files in memran/marwa-ai
Download memran/marwa-ai
More information about memran/marwa-ai
Files in memran/marwa-ai
Vendor memran
Package marwa-ai
Short Description A comprehensive AI abstraction library for PHP with multi-provider support
License MIT
Package marwa-ai
Short Description A comprehensive AI abstraction library for PHP with multi-provider support
License MIT
Please rate this library. Is it a good library?
Informations about the package marwa-ai
Marwa AI
A comprehensive AI abstraction library for PHP with unified support for multiple AI providers.
Features
- Multi-provider support: OpenAI, Anthropic Claude, Google Gemini, xAI Grok, Mistral, DeepSeek, Ollama
- Unified API: Same interface across all providers
- Streaming: Real-time token streaming
- Function/Tool calling: Structured function execution
- Prompt templates: Reusable template system with variables, conditionals, loops
- Conversation memory: Persistent context across requests
- Batch processing: Queue and process multiple AI requests
- MCP server support: Model Context Protocol integration
- Text classification: Sentiment, intent, entity extraction
- Embeddings: Vector generation and similarity search
- Image generation: DALL-E integration
- Structured output: JSON schema enforcement
Installation
Quick Start
Using the Helper Functions
Conversations
Context & Metadata
Streaming
Prompt Templates
Tools / Function Calling
Classification
Batch Processing
Memory & Context
Embeddings
Image Generation
Structured Output
Health Checks
Configuration
Standalone Usage (Singleton)
Alternative: Application Instance (Non-singleton)
If you prefer not to use the global singleton, you can instantiate the Application class.
Using a Config File
Detailed Provider Configuration
Each provider supports the following parameters in the configuration array:
| Parameter | Type | Description |
|---|---|---|
api_key |
string | Your provider API key |
model |
string | Default model to use for requests |
base_url |
string | Custom API endpoint (e.g., for proxies or local Ollama) |
timeout |
int | Request timeout in seconds (default: 30) |
retries |
int | Number of automatic retries on failure (default: 3) |
Environment Variables Reference
| Provider | API Key Env | Default Model | Base URL Env |
|---|---|---|---|
| OpenAI | OPENAI_API_KEY |
gpt-4o |
OPENAI_BASE_URL |
| Anthropic | ANTHROPIC_API_KEY |
claude-3-opus |
- |
GOOGLE_API_KEY |
gemini-pro |
- | |
| xAI (Grok) | XAI_API_KEY |
grok-2-latest |
- |
| Mistral | MISTRAL_API_KEY |
mistral-large |
- |
| DeepSeek | DEEPSEEK_API_KEY |
deepseek-chat |
- |
| Ollama | - | llama3.2 |
OLLAMA_BASE_URL |
Chain / Pipeline
MCP Server
Error Handling
CLI Tool
Providers Reference
| Provider | Streaming | Tools | Vision | Embeddings |
|---|---|---|---|---|
| OpenAI | Yes | Yes | Yes | Yes |
| Anthropic Claude | Yes | Yes | Yes | Yes |
| Google Gemini | Yes | Yes | Yes | Yes |
| xAI Grok | Yes | Yes | Yes | No |
| Mistral | Yes | Yes | No | Yes |
| DeepSeek | Yes | Yes | No | Yes |
| Ollama (local) | Yes | Yes | Yes | Yes* |
*Embeddings depend on the loaded model
Environment Variables
| Variable | Purpose |
|---|---|
AI_PROVIDER |
Default provider |
OPENAI_API_KEY |
OpenAI credentials |
OPENAI_MODEL |
OpenAI model override |
ANTHROPIC_API_KEY |
Anthropic credentials |
ANTHROPIC_MODEL |
Anthropic model override |
GOOGLE_API_KEY |
Google credentials |
GOOGLE_MODEL |
Google model override |
XAI_API_KEY |
xAI Grok credentials |
MISTRAL_API_KEY |
Mistral credentials |
DEEPSEEK_API_KEY |
DeepSeek credentials |
OLLAMA_BASE_URL |
Ollama endpoint |
License
MIT
All versions of marwa-ai with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
guzzlehttp/guzzle Version ^7.9
memran/marwa-logger Version ^1.0
memran/marwa-error-handler Version ^1.1
memran/marwa-event Version ^0.2
psr/event-dispatcher Version ^1.0
league/container Version ^5.1
symfony/console Version ^7.3
memran/marwa-support Version ^1.3.1
guzzlehttp/guzzle Version ^7.9
memran/marwa-logger Version ^1.0
memran/marwa-error-handler Version ^1.1
memran/marwa-event Version ^0.2
psr/event-dispatcher Version ^1.0
league/container Version ^5.1
symfony/console Version ^7.3
memran/marwa-support Version ^1.3.1
The package memran/marwa-ai contains the following files
Loading the files please wait ...