symfony/ai-bedrock-platform
AWS Bedrock platform bridge for Symfony AI, letting you invoke foundation models and list available ones through Bedrock, with support for Anthropic Claude, Meta Llama, and Amazon Nova request formats.
symfony/ai platform contracts (PlatformInterface, ModelClientInterface, message/stream DTOs). Adopting it in a Laravel app is a decision to make Symfony AI the AI abstraction layer inside a Laravel codebase — that is the real architectural bet, not the Bedrock wiring itself.match-style factory bound in a service provider, and onto Laravel Pennant/feature flags for gradual rollout.AppServiceProvider, publishing a config/ai.php, and wrapping calls in a thin application service is a 2–5 day effort for a senior PHP engineer, inclusive of a spike. Not a blocker..env keys should be an explicit exception.$this->commands([...]) and wrapped in a Laravel-native bedrock:sync-models command with caching and output formatting.composer update conflicts across the wider symfony/* graph and budget time for constraint negotiation.StreamedResponse or a broadcasting channel, and long-lived streams interact badly with queue timeouts and with Octane worker recycling — this must be designed, not discovered.symfony/ai monorepo (issues and PRs route there) and is maintained by recognizable Symfony core contributors. Read this as "early, but institutionally backed," not "abandoned side project."0.x, where minor bumps may break by convention. Pin exact versions; treat upgrades as scheduled work with a changelog review, never as a routine composer update. The v0.9.0 "AssistantMessage rework" is exactly the kind of change that breaks call sites.AiServiceProvider, and expose one narrow application-level interface (e.g. App\Ai\ChatService) that the rest of the codebase depends on. No controller or job should reference a Symfony AI type directly.config/ai.php holding driver selection, default/fallback model, per-feature routing, region, retry policy, and timeout budget. Keep closures out of it so php artisan config:cache stays valid..env. Where static credentials are unavoidable, store them in Secrets Manager and resolve at boot, not in config files.ListFoundationModels in Cache::remember with a multi-hour TTL and refresh via scheduled command. Never call it on a request path.ChatService and the DTOs the application speaks. This is the durable asset; the vendor behind it is replaceable. If the dependency proves untenable, this is the seam we fall back on.Anti-goal: dual-path adoption in Phase 1. That is how we end up maintaining two integrations with half the test coverage each.
json_validate() polyfill fix), matching Laravel 11/12 baselines. Verify against our exact patch version.composer resolution on the specific version we target before any design work proceeds.AiServiceProvider + config/ai.php + ChatService + Artisan model-sync command.symfony/ai changelog, run the Bedrock regression suite (one case per supported model family), then bump. Budget ~1 engineer-day per upgrade cycle.symfony/ai is an early warning that Bedrock API drift will go unpatched — at which point we fork or move to OpenAI behind the same ChatService.symfony/ai monorepo. Issue triage is best-effort. For a production dependency this means our internal team is the de facto first line of support.$timeout and $tries, and idempotency keys. Synchronous inference in a web request is a latency lottery.| Failure | Symptom | Mitigation |
|---|---|---|
| Bedrock throttling (429) | Elevated latency, job retries | Exponential backoff, queue-based concurrency caps, quota increase |
| Model deprecated / ID changed | Hard 400s on a previously working call | Config-driven model IDs; scheduled catalog sync; alert on ValidationException rate |
| Region outage | Broad failures, no fallback | Multi-region config where compliant; degraded mode (cached or non-AI path) |
| Credential expiry | 403s across all features | IAM roles over static keys; alert on auth-error rate, not on individual requests |
| Stream interruption | Truncated responses mid-stream | Detect incomplete streams, surface partial-result state to UI, never persist truncated output as final |
| Cost runaway | Bill spike, no functional error | Per-tenant token budgets, spend alerts, kill switch on non-critical features |
| Composer lock drift | Broken build after routine update | Exact version pins, CI composer validation, upgrade as reviewed change |
ChatService first so the vendor remains replaceable regardless of outcome.How can I help you explore Laravel packages today?