Skip to content

Conversation

@lochmueller
Copy link
Contributor

@lochmueller lochmueller commented Nov 20, 2025

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

Features...

  • Update the static ModelCatalog to the current list of models - New models and embeddings are added (e.g. ChatGPT 5.1, Gemini 3)
  • Add a ModelApiCatalog to call the OpenRouter API to handle the current list of Models
  • Add openrouter/auto and presets for ModelCatalog and ModelApiCatalog

@carsonbot carsonbot added Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Needs Review labels Nov 20, 2025
@lochmueller
Copy link
Contributor Author

Or do we prefer to integrate an external model selection directly into the catalog (like here: https://github.com/symfony/ai/pull/910/files )? I try to avoid external API calls in the model catalog... :-/

@OskarStark
Copy link
Contributor

Can we move it to the platform in bin/ folder?

@chr-hertel
Copy link
Member

Can we move it to the platform in bin/ folder?

should be even part of the OpenRouter bridge i'd say

@chr-hertel
Copy link
Member

we'd need another solution in the long run here - i would prefer some kind of catalog that is dynamic with a cache.

updating with the code base doesn't really solve the issue here - even if we'd make it part of the pipeline to do it automatically on release or something. the change frequency requires decoupling lib updates and catalog updates.

not scope of this PR maybe, but we'll face that issue over and over again - with multiple bridges.

@OskarStark
Copy link
Contributor

should be even part of the OpenRouter bridge I'd say

yeah, thats what I meant

@OskarStark
Copy link
Contributor

We could have libs just for the models getting regular automated updates, but that's future :-)

@lochmueller
Copy link
Contributor Author

OK.... thanks for your feedback @OskarStark & @chr-hertel . how could I adapt the PR for this future need?

My thoughts on this: I will drop the example script, I will drop the static model list in the ModelCatalog, move the fetch logic for the models and embeddings to the ModelCatalog and add some kind of PSR-6 compatible cache logic to keep the requests to the API endpoint low. I will rework the PR today...

@OskarStark
Copy link
Contributor

you can have a look at the ollama api catalog. next step would be to add proper caching to those api catalogs

@lochmueller
Copy link
Contributor Author

So... I created a ModelApiCatalog that fetch the models and embeddings via API (incl. capabilities). The default catalog is still the default ModelCatalog that contains only the Embeddings (because they are created with another Model class) but create the models "on the fly" without capabilities (because they are not used in the ModelClient/ResultConverter). I also switch from json_decode functions to Serializer->JsonDecoder.

There is no cache currently, but I think we should create some general interface (or even abstract integration incl. cache logic) for "remote fetched model information", because several bridges need this (Ollama, AiMlApi, Albert etc.) and every Bridge integrated this in another way currently...

@lochmueller
Copy link
Contributor Author

I will check the broken pipelines shortly...

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

one thing open for me in the ModelApiCatalog before merging it:

the constructor cannot to http calls - that's too much of a workload for a new => i know it's a bit annoying with that abstraction, but we need to shift that to a later point in time => getters maybe?

@OskarStark
Copy link
Contributor

Pleas update PR title + body, thanks

@lochmueller lochmueller changed the title [Platform] Add new OpenRouter models [Platform] Add new OpenRouter models, ModelApiCatalog and openrouter/auto + presets Nov 22, 2025
@lochmueller
Copy link
Contributor Author

one thing open for me in the ModelApiCatalog before merging it:

the constructor cannot to http calls - that's too much of a workload for a new => i know it's a bit annoying with that abstraction, but we need to shift that to a later point in time => getters maybe?

Done. Move the loading of the model list to getModel/getModels incl. a flag to avoid double loading of the list.

Pleas update PR title + body, thanks

Also done.

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

let's goooo! thanks @lochmueller 🙏

@OskarStark OskarStark force-pushed the feature/openrouter-model-listing branch from b536116 to 435f5f7 Compare November 22, 2025 22:42
@OskarStark
Copy link
Contributor

Thank you @lochmueller.

@OskarStark OskarStark merged commit 7516cc6 into symfony:main Nov 22, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants