Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ai-bundle/src/AiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
->setLazy(true)
->setArguments([
$platform['host_url'],
new Reference('http_client'),
new Reference($platform['http_client']),
Copy link
Member Author

@lyrixx lyrixx Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't do that, we use the default HTTP Client.
And I have the following options:

ai:
    platform:
        ollama:
            http_client: http_client.ollama
            # Configured in the HTTP Client
            # see https://github.com/symfony/ai/issues/899
            host_url: ''
            api_catalog: true

So host_url is empty, so the underlying code will explode because the host URL is not a valid endpoint

Copy link
Contributor

@Guikingone Guikingone Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm right host_url can be omitted (as it fallback to http://127.0.0.1:11434 by default) 🤔

                    ->arrayNode('ollama')
                        ->children()
                            ->stringNode('host_url')->defaultValue('http://127.0.0.1:11434')->end()
                            ->stringNode('http_client')
                                ->defaultValue('http_client')
                                ->info('Service ID of the HTTP client to use')
                            ->end()
                            ->booleanNode('api_catalog')
                                ->info('If set, the Ollama API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
                            ->end()
                        ->end()
                    ->end()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if someone configure a custom host_url, without a custom HTTP client, the one in the configure must be used. So it cannot be omitted

]);

$container->setDefinition('ai.platform.model_catalog.ollama', $catalogDefinition);
Expand Down