Skip to content

Commit 2a92d13

Browse files
committed
Centralize default models, clients and converters for OpenAI based standards
1 parent 9addfdf commit 2a92d13

File tree

120 files changed

+915
-1567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+915
-1567
lines changed

docs/components/platform.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,22 @@ very flexible and powerful interface for working with AI models.
4848
Models
4949
------
5050

51-
The component provides a model base class :class:`Symfony\\AI\\Platform\\Model` which is a combination of a model name, a set of
52-
capabilities, and additional options. Usually, bridges to specific providers extend this base class to provide a quick
53-
start for vendor-specific models and their capabilities.
51+
The component provides a generic model base class :class:`Symfony\\AI\\Platform\\Model` which is a combination of a
52+
model name, a set of capabilities, and additional options. Usually, bridges to specific providers extend this base class
53+
to provide a quick start for vendor-specific models and their capabilities.
5454

5555
Capabilities are a list of strings defined by :class:`Symfony\\AI\\Platform\\Capability`, which can be used to check if a model
5656
supports a specific feature, like ``Capability::INPUT_AUDIO`` or ``Capability::OUTPUT_IMAGE``.
5757

5858
Options are additional parameters that can be passed to the model, like ``temperature`` or ``max_tokens``, and are
5959
usually defined by the specific models and their documentation.
6060

61+
Additionally, the component provides two more specific base classes, that are needed to trigger built-in API endpoint
62+
and result conversion implementations:
63+
64+
* :class:`Symfony\\AI\\Platform\\Model\\CompletionsModel` - for models that support text completions
65+
* :class:`Symfony\\AI\\Platform\\Model\\EmbeddingsModel` - for models that support vector embeddings
66+
6167
Model Size Variants
6268
~~~~~~~~~~~~~~~~~~~
6369

@@ -106,7 +112,7 @@ When using the bundle, the usage of ``OllamaApiCatalog`` is available via the ``
106112
api_catalog: true
107113

108114
Supported Models & Platforms
109-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115+
----------------------------
110116

111117
* **Language Models**
112118
* `OpenAI's GPT`_ with `OpenAI`_, `Azure`_ and `OpenRouter`_ as Platform
@@ -118,7 +124,6 @@ Supported Models & Platforms
118124
* `Amazon's Nova`_ with `AWS Bedrock`_ as Platform
119125
* `Mistral's Mistral`_ with `Mistral`_ and `OpenRouter`_ as Platform
120126
* `Albert API`_ models with `Albert`_ as Platform (French government's sovereign AI gateway)
121-
* `LiteLLM`_ as unified Platform
122127
* **Embeddings Models**
123128
* `Gemini Text Embeddings`_ with `Google`_ and `OpenRouter`_
124129
* `Vertex AI Text Embeddings`_ with `Vertex AI`_
@@ -136,6 +141,16 @@ Supported Models & Platforms
136141
* `Cartesia TTS`_ with `Cartesia`_ as Platform
137142
* `Cartesia STT`_ with `Cartesia`_ as Platform
138143

144+
Generic Platforms
145+
~~~~~~~~~~~~~~~~~
146+
147+
Platforms like `LiteLLM`_ or `OpenRouter`_ provide a unified API to access multiple models from different providers.
148+
Therefore, they rely on endpoint and contract design, that is inspired by OpenAI's original GPT API - an implicit
149+
standard in the industry. Platforms using this de facto standard can be used without the need of a dedicated bridge, by
150+
using built-in classes::
151+
152+
???
153+
139154
Options
140155
-------
141156

src/ai-bundle/src/AiBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
use Symfony\AI\Platform\Capability;
7272
use Symfony\AI\Platform\Exception\RuntimeException;
7373
use Symfony\AI\Platform\Message\Content\File;
74-
use Symfony\AI\Platform\ModelClientInterface;
74+
use Symfony\AI\Platform\ModelClient\ModelClientInterface;
7575
use Symfony\AI\Platform\Platform;
7676
use Symfony\AI\Platform\PlatformInterface;
77-
use Symfony\AI\Platform\ResultConverterInterface;
77+
use Symfony\AI\Platform\ResultConverter\ResultConverterInterface;
7878
use Symfony\AI\Store\Bridge\Azure\SearchStore as AzureSearchStore;
7979
use Symfony\AI\Store\Bridge\ChromaDb\Store as ChromaDbStore;
8080
use Symfony\AI\Store\Bridge\ClickHouse\Store as ClickHouseStore;

src/platform/src/Bridge/AiMlApi/Completions.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/platform/src/Bridge/AiMlApi/Completions/ModelClient.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/platform/src/Bridge/AiMlApi/Completions/ResultConverter.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/platform/src/Bridge/AiMlApi/Embeddings/ModelClient.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/platform/src/Bridge/AiMlApi/Embeddings/ResultConverter.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)