Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Ai Writer

Filament Ai Writer Laravel Package

pdro-lucas/filament-ai-writer

A reusable Filament Action that adds AI-powered text generation to any form field, supporting Anthropic Claude, OpenAI, and Google Gemini. Configure an API key, attach the action to a field, and generate content via an interactive modal or silent mode using other form fields as context.

View on GitHub
Deep Wiki
Context7

AI Writer Action for Filament Forms — supports OpenAI, Claude, Gemini and OpenRouter

Frequently asked questions about Filament Ai Writer
What does the pdro-lucas/filament-ai-writer package do?
It ships a reusable Filament Action, AiWriterAction, that adds AI-powered text generation to any form field in your Filament forms. You attach it to a field with hintAction() or suffixAction(), and the generated text is written straight into that field. Anthropic Claude, OpenAI, and Google Gemini drivers are included out of the box.
How do I install filament-ai-writer in a Laravel app?
Run composer require pdro-lucas/filament-ai-writer. The service provider is auto-discovered, so no manual registration is needed. Add the API key for your chosen provider to .env (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GEMINI_API_KEY) and optionally publish the config with php artisan vendor:publish --tag=filament-ai-writer-config. There are no migrations and no queue workers to configure.
Which Laravel and Filament versions are supported?
The package requires PHP 8.1+ and supports Laravel 10, 11, and 12. It targets Filament 4.x only, so applications still on Filament 3 are not supported. Check the composer constraints before adding it to an existing project.
How do I switch between Anthropic, OpenAI, and Gemini or change the model?
Set AI_WRITER_PROVIDER to anthropic, openai, or gemini in your .env file and supply the matching API key. Model and token settings come from AI_WRITER_MODEL and AI_WRITER_MAX_TOKENS, and publishing the config file lets you define per-provider models, keys, and limits. Verify each model identifier against the provider's live model list, since defaults can drift.
What is the difference between interactive and silent mode?
Interactive mode opens a modal where the user describes what they want generated, and the AI responds using that input plus your configured prompt. Silent mode skips the modal entirely, reads other fields in the current form as context, and injects the result immediately. Silent mode is effectively a one-click mutation of business data, so use it where automatic generation is genuinely appropriate.
Can I customize the prompt for each form field?
Yes. Each action instance takes its own ->prompt('...') instructions along with ->targetField('content'), so different fields can have different tone, format, and output rules. That keeps generated content consistent and on-brand per field. In silent mode the same prompt is combined with context pulled from the surrounding form fields.
Can I use a different AI provider, Azure OpenAI, or an internal gateway?
The package is built around an AiProvider contract with concrete drivers behind it, so you can rebind the contract in a service provider to point at Azure OpenAI, AWS Bedrock, LiteLLM, or your own proxy. That lets you centralize logging, metering, and key management without forking the package. You can also listen to the AiTextGenerated event and use the beforeGenerate and globalBeforeGenerate hooks for entitlement checks, rate limiting, or credit debiting.
How do timeouts, retries, and max tokens work?
Behaviour is controlled by AI_WRITER_CONNECT_TIMEOUT (10s), AI_WRITER_TIMEOUT (60s), AI_WRITER_RETRY_TIMES (2), AI_WRITER_RETRY_SLEEP_MS (500), and AI_WRITER_MAX_TOKENS (2048). Generation runs synchronously inside the Livewire request, so a long timeout can hold a PHP-FPM worker and exceed typical 30-second load balancer idle limits. Retries apply to a billed, non-idempotent operation, so confirm in the source that retries only fire on connect errors, 429s, and 5xx responses rather than on post-completion timeouts.
Is the AI output safe to write into select or checkbox fields?
For option-based fields the package supports valueMap and permitted value lists, so hallucinated keys and off-list tags are dropped rather than persisted. Free-text fields, however, receive the raw model output with no diff, preview, or undo. If accuracy matters, prefer interactive mode or add a human review step before the record is saved.
Is filament-ai-writer production ready for a customer-facing app?
The package is self-declared Beta with a small user base, so treat it as source-available code you may need to own and maintain rather than a supported dependency. Prompts and form content leave your infrastructure for a third-party model vendor, with no built-in redaction, per-field allowlist, or audit table, so GDPR, DPA, and PII obligations are yours. Because requests are synchronous and there is no queued mode, plan for timeout handling and load testing before relying on it heavily.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect