[Platform][Bifrost] Introduce platform#2078
Open
Guikingone wants to merge 1 commit into
Open
Conversation
3f46522 to
6670611
Compare
Member
|
So do i get it correct, that they not only mimick embeddings and completions api, but also whisper and dall-e? |
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 🤔 |
welcoMattic
reviewed
Jun 5, 2026
6670611 to
bc831b4
Compare
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/
bc831b4 to
102dd76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.