Skip to content

Conversation

@chr-hertel
Copy link
Member

@chr-hertel chr-hertel commented Dec 6, 2025

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

Replaces #938 and unblocks #871 - diff looks a bit weird due to git mixing up removed classes and new generic bridge.

  • Tests
  • Docs
  • Bundle

This enables to use tools like Litellm without specific bridge with a configuration like this:

# config/packages/ai.yaml
ai:
    platform:
        generic:
            litellm:
                base_url: '%env(LITELLM_HOST_URL)%' # e.g. http://localhost:4000
                api_key: '%env(LITELLM_API_KEY)%' # e.g. sk-1234
                model_catalog: 'Symfony\AI\Platform\Bridge\Generic\ModelCatalog' # see below
    agent:
        test:
            platform: 'ai.platform.generic.litellm'
            model: 'mistral-small-latest'
            tools: false

services:
    Symfony\AI\Platform\Bridge\Generic\ModelCatalog:
        $models:
            mistral-small-latest:
                class: 'Symfony\AI\Platform\Bridge\Generic\CompletionsModel'
                capabilities:
                    - !php/const 'Symfony\AI\Platform\Capability::INPUT_MESSAGES'
                    - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_TEXT'
                    - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_STREAMING'
                    - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_STRUCTURED'
                    - !php/const 'Symfony\AI\Platform\Capability::INPUT_IMAGE'
                    - !php/const 'Symfony\AI\Platform\Capability::TOOL_CALLING'
image

@chr-hertel chr-hertel added the Platform Issues & PRs about the AI Platform component label Dec 6, 2025
@chr-hertel chr-hertel requested a review from OskarStark December 6, 2025 22:56
@chr-hertel chr-hertel force-pushed the generic-bridge branch 2 times, most recently from 23568a4 to 56aac3a Compare December 6, 2025 23:26
@chr-hertel chr-hertel added the BC Break Breaking the Backwards Compatibility Promise label Dec 6, 2025
@chr-hertel chr-hertel force-pushed the generic-bridge branch 2 times, most recently from 64bf0aa to 1c6aee7 Compare December 7, 2025 00:14
@OskarStark
Copy link
Contributor

I need to double check later on desktop, but this looks really cool and promising, thanks for the hard work, I like the deletion of so many classes while unlocking a lot of new bridges, which use the defacto OpenAI standard 🙋‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC Break Breaking the Backwards Compatibility Promise Feature New feature Platform Issues & PRs about the AI Platform component Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom URL ability or generic bridges?

3 participants