Skip to content

Conversation

@lyrixx
Copy link
Member

@lyrixx lyrixx commented Nov 20, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #766
License MIT

cc @Guikingone

->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

@OskarStark OskarStark changed the title [AiBundle] Fix ollama configuration when a custom http_client is set Fix ollama configuration when a custom http_client is set Nov 21, 2025
@OskarStark OskarStark added the AI Bundle Issues & PRs about the AI integration bundle label Nov 21, 2025
@carsonbot carsonbot changed the title Fix ollama configuration when a custom http_client is set [AI Bundle] Fix ollama configuration when a custom http_client is set Nov 21, 2025
@OskarStark OskarStark changed the title [AI Bundle] Fix ollama configuration when a custom http_client is set [AI Bundle][Ollama] Fix configuration when a custom http_client is set Nov 21, 2025
@chr-hertel
Copy link
Member

Thank you @lyrixx.

@chr-hertel chr-hertel merged commit 3dac301 into symfony:main Nov 23, 2025
18 checks passed
@lyrixx lyrixx deleted the bundle-ollama-config branch November 24, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Bundle Issues & PRs about the AI integration bundle Bug Something isn't working Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants