Draft: feat: #3586427 Adopt symfony/ai component v0.8 as platform provider
Description
- New
ai_inference_providerplugin type + config entity (one inference backend with API key / base URL / model list); shipsGeneric(OpenAI-compatible) andGemini. Plugin namespacePlugin/ai/InferenceProvider/. - New
ai_model_routerplugin type; shipsCatalogBasedModelRouter(default). - New
ai_platformplugin type with two derivers:- EntityPlatform — one derivative per
ai_platformconfig entity. - DefaultPlatform — one
default:<inference_provider_id>per inference provider, auto-exposing every backend as a usable platform without forcing the admin to create anai_platformentity.
- EntityPlatform — one derivative per
ai_platformconfig entity composes providers + router into aSymfony\AI\Platform\Platformdirectly — no per-platform plugin layer. New fieldmiddlewares: [{ plugin, configuration }]stack applied to the built Platform.- New
ai_platform_middlewareplugin type for cross-cutting wrappers (caching / retry / fallback / tracing). Ships Tracing (Symfony\AI\Platform\TraceablePlatformwrapper). UI sub-form is@todo. - Canonical new API:
plugin.manager.ai.platform->getPlatformsForOperationType($op): AiPlatformInterface[]. Legacyai.provider->getProvidersForOperationType()kept and marked@deprecated— returnsPlatformProxyBC adapters so 1.xAiProviderInterface/ChatInterfaceconsumers keep working unchanged. - Admin UI:
/admin/config/ai/inference-providersCRUD;/admin/config/ai/platformsform has provider multi-select + router picker (middleware sub-form is@todo). - Addressing:
entity:<entity_id>ordefault:<inference_provider_id>viaplugin.manager.ai.platform;ai_platform:entity:<id>/ai_platform:default:<id>via the legacyai.providerAPI. - Echo fixture migrated (
Plugin/ai/InferenceProvider/EchoProvider+ splitai.inference_provider.echo_test/ai.platform.echo_test).
Testing instructions
/admin/config/ai/inference-providers→ add a provider:- Plugin: Generic
- Base URL + Key entity + models (one per line)
/admin/config/ai/platforms→ add a platform entity:- Label, providers: select the one from step 2, routing: Catalog-based
- (Middleware sub-form is
@todo— field is a hiddenvalueplaceholder.)
/admin/config/ai/settings→ for the chat operation, try both:ai_platform:default:<inference_provider_id>(auto-derived single-provider platform — no entity required), andai_platform:entity:<your_platform_id>(the explicit platform from step 3).
/admin/config/ai/ai-api-explorer/chat-generation→ send a prompt with each → both reply.
Checklist
- I have linked the related issue in the MR title or description
- I have performed a self-review of my own code
- I have added or updated tests, or explained in the description why this change is not covered by tests
- I have updated documentation for any new or changed functionality
- I have written testing instructions and verified them locally
- I have noted any required post-merge steps (config imports, cache rebuilds, manual changes)
- This MR contains no breaking API or hook changes, or they are explicitly documented in the description
AI Compliance
Note
Check the one that best describes your usage, or leave all unchecked if AI was not significantly used.
-
AI Assisted Code
Mainly written by a human; AI used for autocomplete or partial generation under full human supervision. -
AI Generated Code
Mainly generated by AI, reviewed and approved by a human before this MR was created. -
Vibe Coded
Generated by AI and only functionally reviewed before this MR was created.
Closes #3586427
Edited by Wolfgang Ziegler