symfony/ai-mistral-platform
Symfony AI bridge for the Mistral platform, providing chat completions and OCR integration through Mistral's API. Enables Symfony applications to use Mistral models for AI-powered text and document processing.
Provider abstraction. Critical for cost optimization, redundancy, and vendor flexibility. v0.15.0 reinforces this by moving to each bridge’s own wire field for output limits (max_output_tokens → provider-native naming), so provider-specific parameters stop leaking into shared, provider-neutral call sites.TokenUsage now carries a model property, enabling cost calculation per model/request rather than per provider. This turns token tracking into an actual unit-economics signal — you can attribute spend to mistral-tiny vs. mistral-large, compare Mistral against fallback providers on a per-route basis, and back chargeback, budget alerts, or tiering decisions with real numbers instead of estimates.AiEventDispatcher, with model-level granularity).symfony/ai. The bridge is Symfony-first, but Laravel can adapt it with minimal effort.mistral-tiny for embeddings) or fine-tuned capabilities not available in other providers.TokenUsage::model is a direct enabler; otherwise you’d reconcile vendor invoices against logs manually.DeltaInterface streams via Laravel Queues or event loops.guzzlehttp/guzzle for HTTP). This package’s low stars may indicate niche use.symfony/ai and don’t plan to adopt its abstractions (e.g., Provider, ClientInterface). The bridge’s value diminishes without this layer.*"This package lets us integrate Mistral’s high-performance AI—like its cost-effective LLMs and embeddings—without building a custom solution. By using Symfony’s standardized AI bridge, we ensure consistency with other providers (e.g., OpenAI) and reduce technical debt. The latest releases materially strengthen the business case:
*"The symfony/ai-mistral-platform bridge gives us:
✅ Seamless Mistral integration via Symfony’s AI component—no need to build a custom API client.
✅ Per-model cost attribution: TokenUsage carries a model property, so usage metrics from AiEventDispatcher can be aggregated by model, not just by provider. This is the hook for our cost dashboards — no extra instrumentation needed.
✅ Provider-native option naming (v0.15.0): The canonical max_output_tokens option is replaced by each bridge’s own wire field. Action: grep for max_output_tokens and update call sites/configuration; add a test asserting the new key is forwarded. Small, mechanical, but it lands in a minor version — budget for a config-compat shim if we wrap the client.
✅ Auto-updating model catalogs (refreshed in v0.15.0): New Mistral models land without a code change. Trade-off: we must pin models explicitly in config and add regression tests so a catalog refresh can’t silently change production behavior.
✅ Multi-provider routing: Dynamically switch between Mistral and other LLMs (e.g., OpenAI) with minimal code changes — improved by the per-provider parameter naming.
✅ Production-ready features:
DeltaInterface) for real-time responses.
✅ Laravel-friendly: Works with our existing HTTP clients (Guzzle/Symfony) and can be wrapped in a facade for cleaner syntax — recommended, since it isolates us from pre-1.0 option renames.
Downsides:symfony/ai or want a standardized way to add Mistral with real cost telemetry. Otherwise, the official Mistral SDK might be simpler."**"This bridge unlocks Mistral’s models (e.g., mistral-embed) for your use cases without reinventing the wheel:
EmbeddingClient for semantic search or document analysis.mistral-tiny/small/large on the same evaluation set and defend the model choice with data.max_output_tokens option to each provider’s wire field — if your eval harness sets output caps explicitly, update the key and re-run your baselines so results stay comparable.
Key question: How will we handle Mistral’s rate limits vs. our expected query volume? We may need batching or caching layers. Also: we’ll want a pinned-model policy so catalog updates don’t invalidate prior evaluations."**"This package directly supports our roadmap for:
TokenUsage lets us report cost per feature and per model — turning 'Mistral is cheaper' from an assumption into a metric we can put in a business review.How can I help you explore Laravel packages today?