symfony/ai-scaleway-platform
Symfony AI bridge for Scaleway’s Generative APIs. Connect to Scaleway chat and OpenAI-compatible endpoints to run AI-powered conversations and completions from Symfony apps, using Scaleway’s platform and documentation-backed integration.
spatie/laravel-ai (v1.0+) or custom abstraction layers. The provider abstraction (v0.8.0) enables Laravel to adopt a multi-provider strategy without tight coupling, aligning with Laravel’s service container and dependency injection patterns.guzzlehttp/guzzle) with minimal refactoring. This is critical for Laravel apps using AI for chatbots, embeddings, or tool calls.DeltaInterface (v0.7.0) and tool call fixes (v0.7.0) enable real-time AI responses and function invocation, which can be integrated into Laravel’s event system or queues for async processing.symfony/ai (≥v0.8.0), which may conflict with Laravel’s native packages. Mitigation: Use spatie/laravel-ai as a bridge or abstract the provider layer in Laravel’s container..env or Vault). The package expects credentials via environment variables or config, which can be injected via Laravel’s binding system.HttpClient, which can be wrapped in Laravel’s Http facade or custom middleware (e.g., spatie/laravel-http-middlewares) for retries and rate limiting.DeltaInterface streams (e.g., for chat responses). Example:
$client->chat()->stream(...)->onDelta(fn(DeltaInterface $delta) => Log::info($delta->getContent()));
spatie/laravel-ignition or custom middleware can enhance robustness.gpt-4o, qwen-3).fr-par, nl-ams) and use Laravel’s caching (e.g., redis) for local responses.gpt-4o vs. Scaleway’s equivalent) be resolved?spatie/laravel-http-middlewares for retries.spatie/laravel-ai (v1.0+): Acts as a bridge for Symfony AI components.symfony/ai-scaleway-platform in a Laravel service provider to expose a unified AIService interface.ScalewayAI) to abstract Scaleway-specific logic.ScalewayClient with bindings:
$this->app->bind(ScalewayClient::class, fn($app) => new ScalewayClient(
$app['config']['services.scaleway.api_key'],
new HttpClient()
));
config/services.php:
'scaleway' => [
'api_key' => env('SCALEWAY_API_KEY'),
'default_model' => 'qwen-3',
'timeout' => 30,
],
Phase 1: Pilot with Chat APIs
ChatClient in a non-critical feature (e.g., internal tool).// Before (OpenAI)
$response = OpenAI::chat()->create([...]);
// After (Scaleway)
$response = app(ScalewayClient::class)->chat()->create([...]);
Phase 2: Embeddings and Tool Calls
EmbeddingClient for semantic search (e.g., product recommendations).ToolInterface (v0.7.0 fixes).$embeddings = app(ScalewayClient::class)->embeddings()->create([...]);
Phase 3: Multi-Provider Abstraction
ProviderInterface in Laravel to switch between Scaleway and OpenAI:
interface ProviderInterface {
public function chat(): ChatClientInterface;
public function embeddings(): EmbeddingClientInterface;
}
class ScalewayProvider implements ProviderInterface { ... }
class OpenAIProvider implements ProviderInterface { ... }
$provider = $this->app->make(config('services.ai.provider'));
symfony/ai (≥v0.8.0). Ensure compatibility with spatie/laravel-ai or manually resolve dependencies.gpt-4o vs. qwen-3). Maintain a mapping table:
$modelMap = [
'gpt-4o' => 'qwen-3',
'text-embedding-ada-002' => 'qwen-3-embedding',
];
Setup and Configuration
symfony/ai-scaleway-platform and spatie/laravel-ai to composer.json..env and config/services.php.php artisan vendor:publish --provider="Spatie\LaravelAi\LaravelAiServiceProvider"
Pilot Integration
How can I help you explore Laravel packages today?