ARTICLE AD BOX
I’m working with Symfony AI and the LM Studio bridge to manage my language models locally.
My goal is to add custom models that are not included in Symfony’s default ModelCatalog.
My YAML configuration looks like this:
ai: platform: lmstudio: host_url: "http://127.0.0.1:1234" agent: test: platform: 'ai.platform.lmstudio' model: 'ministral-3-3b' tools: falseEven though the model is loaded in LM Studio, Symfony does not detect it.
I created a custom ModelCatalog:
<?php namespace App\Service; use Symfony\AI\Platform\Bridge\Generic\CompletionsModel; use Symfony\AI\Platform\Capability; use Symfony\AI\Platform\ModelCatalog\AbstractModelCatalog; final class LMModelCatalog extends AbstractModelCatalog { public function __construct() { $additionalModels = [ 'ministral-3-3b' => [ 'class' => CompletionsModel::class, 'capabilities' => [ Capability::INPUT_MESSAGES, Capability::OUTPUT_TEXT, Capability::OUTPUT_STREAMING, ], ], ]; parent::__construct($additionalModels); } }What I understood
The LM Studio ModelCatalog is hardcoded, and some models are not included by default.
The official documentation does not clearly explain how to extend the catalog.
It seems that we need to inject a custom ModelCatalog service instead of using YAML, but I haven’t found a recent concrete example.
My question
How can we add additional models for the LM Studio bridge in Symfony AI in a clean way compatible with the current bundle configuration?
Can this be done via YAML, or only via services.yaml?
If it is via services.yaml, what is the recommended snippet to declare custom models with their capabilities?
Thanks for your help!
