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
Ai Azure Platform

Ai Azure Platform Laravel Package

symfony/ai-azure-platform

Azure AI platform bridge for Symfony AI, connecting your apps to Azure OpenAI and Foundry models.

View on GitHub
Deep Wiki
Context7

Symfony AI Azure Platform is a bridge that connects the Symfony AI component to Microsoft Azure AI services. It exposes Azure-hosted models through a consistent Symfony AI interface, targeting the Azure OpenAI and Foundry REST APIs.

  • Integrates Azure OpenAI chat and completion models
  • Supports the Azure OpenAI Responses API
  • Compatible with Foundry v1 REST endpoints
  • Works with Meta Llama serverless deployments on Foundry
  • Configurable endpoints, deployments, and credentials
Frequently asked questions about Ai Azure Platform
How do I install symfony/ai-azure-platform in a Laravel application?
Install it with Composer using composer require symfony/ai-azure-platform, which also pulls in the Symfony AI component and an HTTP client such as symfony/http-client. After installing, publish or create a config entry in config/services.php for your Azure endpoint, deployment name, and API key. Keep the credentials in your .env file and reference them through config() so they can be cached safely. Because it is a plain PHP bridge, no Laravel service provider registration is required beyond normal package discovery.
Does symfony/ai-azure-platform support Laravel 10 and Laravel 11?
Yes. The package relies on Symfony components that follow PSR standards and is reported as fully compatible with Laravel 10 and newer, including Laravel 11. It requires PHP 8.1 or higher, which matches the minimum for the Symfony AI component. As long as your Laravel version meets the PHP requirement, the bridge can be used without framework-specific patching. Pin the package to a major or minor range in composer.json to avoid surprises during upgrades.
How do I configure the Azure OpenAI endpoint, deployment, and API key in Laravel?
Azure does not use a single global endpoint like OpenAI, so you must supply your resource endpoint, the deployment name, and the API key or token. Centralize these in config/services.php under an azure key and read them from .env variables such as AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_DEPLOYMENT, and AZURE_OPENAI_API_KEY. Pass the resulting config array into the platform factory when building your client. This keeps secrets out of source control and lets you swap values per environment.
What is the Azure OpenAI Responses API and does this bridge support it?
The Responses API is Azure's newer, v1-style interface for chat, tool calls, and structured outputs, replacing some of the older completions patterns. The Symfony AI Azure Platform exposes it alongside classic Azure OpenAI chat and completion models, so you can call both through the same Symfony AI interface. Support for the Responses API is reported as full from around version 0.6.0 of the package. Streaming responses are available through the same API, which helps with large outputs.
Can I use Meta Llama serverless deployments on Azure Foundry with this package?
Yes, but with caveats. The bridge targets Foundry v1 REST endpoints and supports serverless Meta Llama deployments from around version 0.8.0, though Foundry support is less mature than the Azure OpenAI path. Expect occasional gaps in model-specific features such as certain tool-calling or structured output behaviors. Test your specific deployment early and keep a fallback route to an Azure OpenAI model for production paths.
How do I get structured JSON output from an Azure model in Laravel?
Pass a structuredOutput option containing a JSON schema to the client's complete call, and the bridge requests a matching schema-constrained response from Azure. Because models can still deviate slightly, validate the decoded result with Laravel's Validator before persisting or returning it. Wrap the call in a small service class so you can reuse the schema and validation rules across controllers, jobs, and Artisan commands. Log any schema mismatches so you can tighten the prompt or schema over time.
How should I handle Azure AI rate limits and retries in a Laravel app?
Azure enforces per-deployment quotas, so implement exponential backoff rather than retrying immediately. A package such as spatie/laravel-retryable or a small custom retry loop around the client call works well, and you should only retry on 429 and 5xx responses. For heavy or bursty workloads, push calls onto Laravel queues and limit concurrency with a semaphore or queue worker count. Also add a circuit breaker or provider fallback so a throttled Azure deployment does not take down the whole feature.
Can I run Azure AI requests as background jobs with Laravel Queues?
Yes, but there is no native Laravel queue integration in the package, so you write a custom job class that builds the Symfony AI client and calls it from handle(). Dispatch long-running work such as document summarization or batch classification with dispatch()->onQueue('ai') to isolate it from user-facing queues. Set generous timeouts and failed-job retry policies, since Azure calls can be slow during cold starts. Store the result or failure state in the database so your UI can poll for completion.
How do I cache and monitor Azure AI responses in Laravel?
For non-real-time use cases, wrap calls in cache()->remember with a hash of the prompt and model as the key, and a TTL that matches how often your data changes. Track token usage, latency, and cost by logging each request and response, either through Laravel Telescope in development or custom metrics in production. Add structured logs including the deployment name and response id so you can correlate Azure-side diagnostics. Caching aggressively also reduces cold-start latency and quota pressure.
What alternatives exist to symfony/ai-azure-platform for Azure AI in Laravel?
You can call Azure OpenAI directly with the official OpenAI PHP client pointed at your Azure endpoint, or use Microsoft's Azure SDK for PHP, though neither gives you a provider-agnostic interface. The Symfony AI ecosystem also ships platform bridges for other providers, which lets you swap implementations behind the same client if you keep your own thin abstraction. If you prefer Laravel-native tooling, packages such as Prism or LLPhant offer similar abstractions with different feature sets. This bridge is the best fit when you want Symfony AI's interface and first-class Azure OpenAI and Foundry REST support.
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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin