Skip to content

Conversation

@OskarStark
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Docs? no
Issues --
License MIT

The ai.model configuration now requires providing a model class that extends Symfony\AI\Platform\Model. This ensures type safety and proper model registration.

@OskarStark
Copy link
Contributor Author

We could also use Model::class as default if none is provided, WDYT?

@OskarStark OskarStark changed the title [AiBundle] Require model class in ai.model configuration Require model class in ai.model configuration 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 Require model class in ai.model configuration [AI Bundle] Require model class in ai.model configuration Nov 21, 2025
@chr-hertel
Copy link
Member

+1 for the default

@OskarStark OskarStark changed the title [AI Bundle] Require model class in ai.model configuration [AI Bundle] Require model class in ai.model configuration Nov 21, 2025
@OskarStark
Copy link
Contributor Author

Done

@OskarStark OskarStark force-pushed the require-model-class-config branch from 6f84ff6 to b9f8602 Compare November 21, 2025 10:40
@OskarStark OskarStark merged commit 8f4ba00 into symfony:main Nov 21, 2025
8 checks passed
OskarStark added a commit that referenced this pull request Nov 21, 2025
… (OskarStark)

This PR was squashed before being merged into the main branch.

Discussion
----------

[AI Bundle] Process model configuration from semantic config

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Docs?         | no
| Issues        | Fixes #898
| License       | MIT

Replaces #914

## Summary

The `ai.model` configuration in the AI Bundle is now properly processed and passed to `ModelCatalog` services. Previously, the configuration was validated but never used by the bundle, requiring users to manually configure services in `services.yaml`.

## Changes

- Added `processModelConfig()` method to process model configuration from semantic config
- Uses the `class` field from the config (introduced in #920)
- Support for all platforms that have a ModelCatalog service
- Proper handling of vertexai platform name mapping to vertexai.gemini

## Example

With this fix, the following configuration now works as expected:

```yaml
ai:
    model:
        ollama:
            custom-model-name:
                class: Symfony\AI\Platform\Bridge\Ollama\Ollama
                capabilities:
                    - input-text
                    - output-text
```

The model will be properly passed to the `OllamaModelCatalog` constructor without requiring manual service configuration.

Commits
-------

2884d29 [AI Bundle] Process model configuration from semantic config
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 Feature New feature Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants