PHPackages                             el-schneider/statamic-auto-alt-text - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. el-schneider/statamic-auto-alt-text

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

el-schneider/statamic-auto-alt-text
===================================

v2.0.4(1mo ago)18.3k↓41.9%1[2 issues](https://github.com/el-schneider/statamic-auto-alt-text/issues)[2 PRs](https://github.com/el-schneider/statamic-auto-alt-text/pulls)PHPCI passing

Since May 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/el-schneider/statamic-auto-alt-text)[ Packagist](https://packagist.org/packages/el-schneider/statamic-auto-alt-text)[ Fund](https://www.buymeacoffee.com/el.schneider)[ RSS](/packages/el-schneider-statamic-auto-alt-text/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (18)Versions (35)Used By (0)

[![Auto Alt Text](images/aat_banner.png)](images/aat_banner.png)

Statamic Auto Alt Text
======================

[](#statamic-auto-alt-text)

> Automatically generate descriptive alt text for images in Statamic v5 using AI services via [Prism PHP](https://github.com/prism-php/prism)

⚠️ Upgrading from v0.x?
-----------------------

[](#️-upgrading-from-v0x)

**Breaking Changes in v1.0:** Moondream support has been removed. If you were using Moondream, switch to [Ollama](https://ollama.ai) 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:

```
# Old (v0.x)
AUTO_ALT_TEXT_SERVICE=openai
OPENAI_MODEL=gpt-4.1

# New (v1.x)
AUTO_ALT_TEXT_MODEL=openai/gpt-4.1
```

See [Upgrading from v0.x](#upgrading-from-v0x) for full details.

Features
--------

[](#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
------------

[](#installation)

```
composer require el-schneider/statamic-auto-alt-text
```

Publish the configuration file:

```
php artisan vendor:publish --tag="statamic-auto-alt-text-config"
```

Configuration
-------------

[](#configuration)

Configure your AI provider in `.env`:

```
# Model format: provider/model-name
AUTO_ALT_TEXT_MODEL=openai/gpt-4.1

# API key (managed by Prism - see config/prism.php)
OPENAI_API_KEY=your_api_key_here
```

### Supported Providers

[](#supported-providers)

ProviderExample ModelEnvironment VariableOpenAI`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

[](#custom-providers)

You can use any custom provider supported by Prism. First, register your custom provider in a service provider:

```
use App\Prism\Providers\MyCustomProvider;

public function boot(): void
{
    $this->app['prism-manager']->extend('my-provider', function ($app, $config) {
        return new MyCustomProvider(apiKey: $config['api_key']);
    });
}
```

Then configure it in your `.env`:

```
AUTO_ALT_TEXT_MODEL=my-provider/model-name
```

See [Prism's Custom Providers documentation](https://prismphp.com/advanced/custom-providers.html) for details on building and registering custom providers.

For advanced provider configuration (custom endpoints, timeouts, etc.), publish Prism's config:

```
php artisan vendor:publish --tag="prism-config"
```

### Non-English Captions

[](#non-english-captions)

You can customize the prompt to generate captions in your preferred language:

```
AUTO_ALT_TEXT_PROMPT="Beschreibe dieses Bild kurz und bündig, um einen Alternativtext für Barrierefreiheit bereitzustellen."
AUTO_ALT_TEXT_SYSTEM_MESSAGE="Du bist ein Barrierefreiheitsexperte, der kurze, beschreibende Alt-Texte für Bilder generiert. Antworte nur mit dem Alt-Text, ohne Einleitung oder Erklärungen."
```

Usage
-----

[](#usage)

### Automatic Generation

[](#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 default `sync` driver won't work for background processing.

Optionally customize the queue configuration:

```
# Optional: Defaults to your application's default queue connection
AUTO_ALT_TEXT_QUEUE_CONNECTION=redis

# Optional: Defaults to the default queue name for the connection
AUTO_ALT_TEXT_QUEUE_NAME=alt_text_generation
```

### Manual Generation

[](#manual-generation)

For existing assets or specific workflows:

1. **Field Action:** Edit an asset, find the `alt` text field, and click the "Generate Alt Text" action
2. **Statamic Action:** In an Asset container, use the "Generate Alt Text" action from the contextual menu
3. **CLI Command:** Process assets in bulk with:

```
php please auto-alt:generate
```

See `php please auto-alt:generate --help` for options to specify containers, assets, and overwriting behavior

### Using Local Ollama

[](#using-local-ollama)

For privacy or compliance reasons, you can run vision models locally with Ollama:

1. **Set up Ollama:** Install [Ollama](https://ollama.ai) and pull a vision model: `ollama pull llava`
2. **Configure the addon:**

```
AUTO_ALT_TEXT_MODEL=ollama/llava
```

3. **Configure Prism:** Publish Prism's config and set the Ollama endpoint:

```
php artisan vendor:publish --tag="prism-config"
```

Then update `config/prism.php`:

```
'ollama' => [
    'url' => env('OLLAMA_URL', 'http://localhost:11434'),
],
```

Generation Parameters
---------------------

[](#generation-parameters)

Fine-tune the AI generation with these environment variables:

```
AUTO_ALT_TEXT_MAX_TOKENS=100      # Maximum length of generated text
AUTO_ALT_TEXT_TEMPERATURE=0.7     # Creativity (0.0 = deterministic, 1.0 = creative)
AUTO_ALT_TEXT_TIMEOUT=60          # Request timeout in seconds
```

Upgrading from v0.x
-------------------

[](#upgrading-from-v0x)

If upgrading from v0.x, update your environment variables:

### Before (v0.x)

[](#before-v0x)

```
AUTO_ALT_TEXT_SERVICE=openai
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4.1
OPENAI_ENDPOINT=https://api.openai.com/v1/chat/completions
```

### After (v1.x)

[](#after-v1x)

```
AUTO_ALT_TEXT_MODEL=openai/gpt-4.1
OPENAI_API_KEY=sk-...
```

**Breaking changes:**

- Moondream support has been removed (use Ollama with llava for local processing)
- Config structure simplified: `services.openai.*` replaced with flat `model` setting
- Environment variables changed: `AUTO_ALT_TEXT_MODEL` replaces `AUTO_ALT_TEXT_SERVICE`

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance71

Regular maintenance activity

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

25

Last Release

51d ago

Major Versions

v0.5.3 → v1.0.02026-01-28

v1.0.0 → v2.0.02026-01-28

v1.0.1 → v2.0.12026-02-25

v1.0.2 → v2.0.32026-03-13

v1.0.3 → v2.0.42026-05-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/81a231c7730414820ac67caf7b30bea0de0d6af3775ec941a07ee5dc697f442a?d=identicon)[mail@jonaslist.de](/maintainers/mail@jonaslist.de)

---

Top Contributors

[![el-schneider](https://avatars.githubusercontent.com/u/26460248?v=4)](https://github.com/el-schneider "el-schneider (81 commits)")[![ito-ito-ito-ito](https://avatars.githubusercontent.com/u/260886217?v=4)](https://github.com/ito-ito-ito-ito "ito-ito-ito-ito (7 commits)")[![helloDanuk](https://avatars.githubusercontent.com/u/8265902?v=4)](https://github.com/helloDanuk "helloDanuk (1 commits)")

---

Tags

addonaistatamicstatamic-v5statamic-v6tagging

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/el-schneider-statamic-auto-alt-text/health.svg)

```
[![Health](https://phpackages.com/badges/el-schneider-statamic-auto-alt-text/health.svg)](https://phpackages.com/packages/el-schneider-statamic-auto-alt-text)
```

###  Alternatives

[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[rias/statamic-redirect

29335.6k](/packages/rias-statamic-redirect)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[jacksleight/statamic-bard-texstyle

18195.4k](/packages/jacksleight-statamic-bard-texstyle)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k15](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
