Download the PHP package el-schneider/statamic-auto-alt-text without Composer
On this page you can find all versions of the php package el-schneider/statamic-auto-alt-text. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-auto-alt-text
Statamic Auto Alt Text
Automatically generate descriptive alt text for images in Statamic v5 using AI services via Prism PHP
⚠️ Upgrading from v0.x?
Breaking Changes in v1.0: Moondream support has been removed. If you were using Moondream, switch to Ollama with a vision model like llava for local processing, or choose from 7+ cloud providers (OpenAI, Anthropic, etc.).
Migration is simple: Replace your old config with the new AUTO_ALT_TEXT_MODEL format:
See Upgrading from v0.x for full details.
Features
- Automatic Generation: Generate alt text for assets using AI by listening for Statamic asset events
- Multiple AI Providers: Support for OpenAI, Anthropic, Ollama, Mistral, Groq, DeepSeek, and xAI via Prism PHP
- Data Privacy: Option to use local Ollama endpoints, keeping image data within your infrastructure
- Asset Filtering: Exclude sensitive or private assets from processing with global patterns, container-specific rules, or individual asset settings
- Control Panel Integration: Field Action to generate alt text for individual images
- Bulk Processing: Artisan Command for processing images individually or in batch
Installation
Publish the configuration file:
Configuration
Configure your AI provider in .env:
Supported Providers
| Provider | Example Model | Environment Variable |
|---|---|---|
| OpenAI | openai/gpt-4.1 |
OPENAI_API_KEY |
| Anthropic | anthropic/claude-sonnet-4-5 |
ANTHROPIC_API_KEY |
| Ollama | ollama/llava |
(local, no key needed) |
| Mistral | mistral/pixtral-large-latest |
MISTRAL_API_KEY |
| Groq | groq/llava-v1.5-7b-4096-preview |
GROQ_API_KEY |
| DeepSeek | deepseek/deepseek-chat |
DEEPSEEK_API_KEY |
| xAI | xai/grok-vision-beta |
XAI_API_KEY |
Custom Providers
You can use any custom provider supported by Prism. First, register your custom provider in a service provider:
Then configure it in your .env:
See Prism's Custom Providers documentation for details on building and registering custom providers.
For advanced provider configuration (custom endpoints, timeouts, etc.), publish Prism's config:
Non-English Captions
You can customize the prompt to generate captions in your preferred language:
Usage
Automatic Generation
The addon listens for configured Statamic events (default: AssetUploaded and AssetSaving). When an asset without alt text is detected, a background job is dispatched to generate it automatically using your configured AI service.
Important: This feature requires Laravel's queue system with an asynchronous queue driver (e.g.,
database,redis,sqs) and a running queue worker (php artisan queue:work). The defaultsyncdriver won't work for background processing.
Optionally customize the queue configuration:
Manual Generation
For existing assets or specific workflows:
- Field Action: Edit an asset, find the
alttext field, and click the "Generate Alt Text" action - Statamic Action: In an Asset container, use the "Generate Alt Text" action from the contextual menu
- CLI Command: Process assets in bulk with:
See php please auto-alt:generate --help for options to specify containers, assets, and overwriting behavior
Using Local Ollama
For privacy or compliance reasons, you can run vision models locally with Ollama:
- Set up Ollama: Install Ollama and pull a vision model:
ollama pull llava -
Configure the addon:
- Configure Prism: Publish Prism's config and set the Ollama endpoint:
Then update config/prism.php:
Generation Parameters
Fine-tune the AI generation with these environment variables:
Upgrading from v0.x
If upgrading from v0.x, update your environment variables:
Before (v0.x)
After (v1.x)
Breaking changes:
- Moondream support has been removed (use Ollama with llava for local processing)
- Config structure simplified:
services.openai.*replaced with flatmodelsetting - Environment variables changed:
AUTO_ALT_TEXT_MODELreplacesAUTO_ALT_TEXT_SERVICE