Problem
SymfonyAiCompilerPass::process() always passes self::ALL_CAPABILITIES as the provider-level capabilities, even when a static ModelCatalog was read and modelCapabilities is populated. The docblock of ALL_CAPABILITIES says it should only be the fallback for bridges without a catalog.
Example: mittwald/symfony-ai-platform has no model with output-image, but the "Available providers" view lists "Image Generation" for it.
Effect beyond display
Models that map to no AiM capability (e.g. whisper-large-v3-turbo, TTS models) are not part of modelCapabilities, so AiProviderManifest::hasModelCapability() falls back to the provider-level list. Capabilities that no listed model has (e.g. Image Generation) are never detected as "specialized", so they are inherited:
$manifest->hasModelCapability('whisper-large-v3-turbo', ImageGenerationCapableInterface::class); // true
The ImageGenerationCapableInterface guard in hasModelCapability() only applies when modelCapabilities is empty.
Environment
- b13/aim 0.5.0
- TYPO3 14.3.7
- symfony/ai-platform 0.13.0
- mittwald/symfony-ai-platform 0.1.3
- PHP 8.5.2
Suggested fix
Derive the provider-level capabilities from the catalog when one exists:
$capabilities = $bridge['modelCapabilities'] !== []
? array_values(array_unique(array_merge(...array_values($bridge['modelCapabilities']))))
: self::ALL_CAPABILITIES;
Problem
SymfonyAiCompilerPass::process()always passesself::ALL_CAPABILITIESas the provider-level capabilities, even when a staticModelCatalogwas read andmodelCapabilitiesis populated. The docblock ofALL_CAPABILITIESsays it should only be the fallback for bridges without a catalog.Example:
mittwald/symfony-ai-platformhas no model withoutput-image, but the "Available providers" view lists "Image Generation" for it.Effect beyond display
Models that map to no AiM capability (e.g.
whisper-large-v3-turbo, TTS models) are not part ofmodelCapabilities, soAiProviderManifest::hasModelCapability()falls back to the provider-level list. Capabilities that no listed model has (e.g. Image Generation) are never detected as "specialized", so they are inherited:The
ImageGenerationCapableInterfaceguard inhasModelCapability()only applies whenmodelCapabilitiesis empty.Environment
Suggested fix
Derive the provider-level capabilities from the catalog when one exists: