-
-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Labels
PlatformIssues & PRs about the AI Platform componentIssues & PRs about the AI Platform componentRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
Description
In scenarios where one needs to configure multiple platforms and specific models for a particular task within a user interface (such as CMS integration of symfony/ai
) it would be beneficial to have a feature that allows to retrieve the actual available models for a given platform.
Example Code
<?php
use Symfony\AI\Platform\Bridge\Ollama\PlatformFactory;
use Symfony\AI\Platform\Capability;
require_once dirname(__DIR__).'/bootstrap.php';
$platform = PlatformFactory::create(env('OLLAMA_HOST_URL'), http_client());
$modelDefinitions = $platform->fetchModelDefinitions();
echo "Available models:\n";
foreach ($modelDefinitions as $modelDefinition) {
$modelCapabilities = array_map(
static fn(Capability $capability): string => $capability->value,
$modelDefinition->getCapabilities()
);
echo sprintf(
" + %s (%s)\n",
$modelDefinition->getName(),
implode(', ', $modelCapabilities)
);
}
Example Output
Available models:
+ llama3.2:latest (input-messages, output-text, output-structured, tool-calling)
+ gemma3:latest (input-messages, output-text, output-structured, input-image)
+ gpt-oss:latest (input-messages, output-text, output-structured, tool-calling)
+ llama3.1:latest (input-messages, output-text, output-structured, tool-calling)
+ qwen2.5-coder:14b (input-messages, output-text, output-structured, tool-calling)
+ qwen3:latest (input-messages, output-text, output-structured, tool-calling)
Metadata
Metadata
Assignees
Labels
PlatformIssues & PRs about the AI Platform componentIssues & PRs about the AI Platform componentRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)