Skip to content

[Platform][Bifrost] Introduce platform#2078

Open
Guikingone wants to merge 1 commit into
symfony:mainfrom
Guikingone:feature/bifrost-platform-bridge
Open

[Platform][Bifrost] Introduce platform#2078
Guikingone wants to merge 1 commit into
symfony:mainfrom
Guikingone:feature/bifrost-platform-bridge

Conversation

@Guikingone

@Guikingone Guikingone commented May 13, 2026

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
Docs? yes
Issues Following an internal presentation by @welcoMattic
License MIT

@Guikingone Guikingone force-pushed the feature/bifrost-platform-bridge branch 5 times, most recently from 3f46522 to 6670611 Compare May 16, 2026 16:51
@Guikingone Guikingone marked this pull request as ready for review May 16, 2026 16:55
@carsonbot carsonbot added Feature New feature Platform Issues & PRs about the AI Platform component Status: Needs Review labels May 16, 2026
@chr-hertel

Copy link
Copy Markdown
Member

So do i get it correct, that they not only mimick embeddings and completions api, but also whisper and dall-e?

@Guikingone

Copy link
Copy Markdown
Contributor Author

Yes, the whole API covers a lot of existing endpoints, it act as a "proxy" for other platforms, maybe we can extract some logic from here for other platforms 🤔

Comment thread docs/bundles/ai-bundle.rst Outdated
@Guikingone Guikingone force-pushed the feature/bifrost-platform-bridge branch from 6670611 to bc831b4 Compare June 8, 2026 14:29
Adds a new Bifrost platform bridge mirrored on the OpenRouter pattern,
covering Bifrost's full OpenAI-compatible HTTP surface:

* Chat completions and embeddings reuse the Generic bridge
* Text-to-speech (POST /v1/audio/speech) returning a BinaryResult
* Speech-to-text (POST /v1/audio/{transcriptions,translations}) with
  optional verbose_json parsing into a Transcript value object
* Image generation (POST /v1/images/generations) returning an
  ImageResult with UrlImage and Base64Image variants
* A dynamic ModelApiCatalog that lazily fetches /v1/models, infers
  the model class from architecture modalities (or model-name
  conventions as a fallback) and falls back silently when the gateway
  is unreachable

The factory accepts a nullable $endpoint paired with a nullable
HttpClientInterface so a ScopingHttpClient with a pre-configured base
URI can be injected. The only rejected case is endpoint=null +
http_client=null.

The bridge ships with PHPStan level 10 strict typing and a Tests/
suite using MockHttpClient. The companion ai-bundle integration wires
the `bifrost` platform configuration (handler block, options.php,
BridgeConfigCompilationTest data provider, CHANGELOG, RST snippet)
and seven examples land under examples/bifrost/
@Guikingone Guikingone force-pushed the feature/bifrost-platform-bridge branch from bc831b4 to 102dd76 Compare June 9, 2026 07:28
@Guikingone Guikingone requested a review from welcoMattic June 9, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants