symfony/ai-bedrock-platform
AWS Bedrock bridge for Symfony AI. Invoke Bedrock foundation models (Claude, Llama, Nova, and more) via the Bedrock Runtime API, with helpers aligned to Bedrock request/response schemas for easy integration into Symfony apps.
symfony/console-bridge, symfony/dependency-injection). Laravel’s service container and facades can encapsulate Bedrock interactions cleanly, reducing boilerplate.BedrockProviderResolver). Enables A/B testing or cost-optimized model selection without rewriting logic.symfony ai:bedrock:list command can be exposed as an Artisan command (php artisan bedrock:models), aiding dev workflows.aws/aws-sdk-php integrations (e.g., fruitcake/laravel-aws) simplify credential/region management. Bedrock’s API aligns with AWS SDK v3’s runtime clients..env and config/ system can centralize Bedrock settings (e.g., BEDROCK_REGION, BEDROCK_MODEL_ALIASES). Example:
BEDROCK_REGION=us-east-1
BEDROCK_DEFAULT_MODEL=anthropic.claude-v2
InvalidArgumentException for string payloads enforces type safety, which Laravel’s request validation (e.g., Illuminate\Validation) can complement.ListFoundationModels feature can populate a Laravel cache (e.g., Redis) or database table for performance, reducing Bedrock API calls.BootstrapServiceProvider).BedrockClientInterface).symfony/ai-openai).fruitcake/laravel-aws)?BedrockClientInterface as a Laravel binding:
$this->app->bind(BedrockClientInterface::class, function ($app) {
return new BedrockClient(
$app['config']['bedrock.region'],
$app['config']['bedrock.credentials']
);
});
BedrockFacade for fluent syntax:
use Illuminate\Support\Facades\Facade;
class Bedrock extends Facade { protected static function getFacadeAccessor() { return 'bedrock'; } }
Usage: Bedrock::invoke('anthropic.claude-v2', $prompt).php artisan vendor:publish --tag=bedrock-config.Symfony\AI\ClientInterface to wrap Bedrock:
class BedrockClient implements ClientInterface {
public function complete(string $model, string $prompt): string { ... }
}
$provider = new BedrockProviderResolver();
$client = $provider->getClient('claude'); // Resolves to anthropic.claude-v2
symfony ai:bedrock:list as php artisan bedrock:models for CLI access.Bedrock::invoke() for Claude/Llama).BedrockLogger channel).throttle:60,1 middleware).spatie/laravel-circuit-breaker).symfony/console-bridge polyfills.aws/aws-sdk-php v3+. Laravel’s fruitcake/laravel-aws can simplify setup.symfony/ai v0.8.0+ for Provider abstraction support.bedrock:InvokeModel permissions.composer require symfony/ai-bedrock-platform aws/aws-sdk-php
php artisan vendor:publish --provider="Symfony\AiBedrock\BedrockServiceProvider"..env and config/bedrock.php.AppServiceProvider.app/Services/BedrockService.php).bedrock-enabled config).symfony/ai-bedrock-platform for breaking changes (e.g., AWS API updates).composer.json constraints to pin versions:
"symfony/ai-bedrock-platform": "^0.8.0"
config/ to avoid hardcoded values.How can I help you explore Laravel packages today?