Available Drivers
OpenAI
Default driver for OpenAI API. Works with GPT-4, GPT-4o, and other OpenAI models.
Anthropic (Claude)
Native support for Claude models via the Anthropic API.
Google Gemini
Native Gemini driver for Google’s AI models.
Groq
Ultra-fast inference with Groq’s LPU platform.
Ollama
Run local LLMs with Ollama integration.
OpenRouter
Access multiple providers through OpenRouter’s unified API.
config/laragent.php. Add your API key and you’re ready to go.
Quick Setup
OpenAI (Default)
.env
App/AiAgents/MyAgent.php
Anthropic (Claude)
.env
App/AiAgents/MyAgent.php
Claude supports structured output (response schemas) for type-safe JSON responses from v1.1.0
Google Gemini
.env
App/AiAgents/MyAgent.php
Groq
.env
App/AiAgents/MyAgent.php
Ollama (Local)
App/AiAgents/MyAgent.php
OpenRouter
.env
App/AiAgents/MyAgent.php
Configuration
Global Configuration
Configure providers inconfig/laragent.php:
config/laragent.php
Per-Agent Configuration
Override the driver directly in your agent:Agent-level driver configuration overrides the global provider settings.
Multi-Provider Fallback
Automatically switch between AI providers when one fails, ensuring your agents stay operational even when a provider is down or rate-limited.Per-Agent Configuration
Set multiple providers directly in your agent using an array:App/AiAgents/MyAgent.php
With Per-Provider Overrides
Override specific settings for each provider in the fallback chain:App/AiAgents/MyAgent.php
Global Configuration
Set default fallback providers for all agents inconfig/laragent.php:
config/laragent.php
Debugging Fallback
Use these methods to inspect the provider sequence and active provider:Driver Reference
Best Practices
Store API keys in environment variables — never hardcode them.
Configure multi-provider fallback for production reliability.
Next Steps
Create & Configure
Configure agents with different providers.
Streaming
Enable real-time streaming responses.
Structured Output
Get typed, validated responses from your agents.
Context Overview
Manage conversation history and agent state.

