Repository navigation
Implement encoding_format injection plugin for bifrost embedding requests - #1
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/lukoerfer/bifrost-encoding-format-plugin/sessions/cccdd85f-d219-4c93-a069-b6f9bccf619f Co-authored-by: lukoerfer <10530659+lukoerfer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/lukoerfer/bifrost-encoding-format-plugin/sessions/cccdd85f-d219-4c93-a069-b6f9bccf619f Co-authored-by: lukoerfer <10530659+lukoerfer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add plugin to intercept calls and set encoding_format
Implement encoding_format injection plugin for bifrost embedding requests
Mar 27, 2026
lukoerfer
marked this pull request as ready for review
March 27, 2026 23:38
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.
Some downstream LLM providers (e.g. older LiteLLM versions) require
encoding_formatin embedding requests, but upstream platforms like Open WebUI often omit it. This plugin intercepts embedding calls at the HTTP transport layer and injects the parameter when missing or null.Plugin logic (
main.go)HTTPTransportPreHookthat detects embedding endpoints via path matching and usesgjson/sjsonfor zero-allocation JSON inspection and mutation of the[]byterequest bodyfloat(default) andbase64encoding formats, configurable via plugin configencoding_formatalready setConfiguration
CI/CD (
.github/workflows/build.yml)maintargeting Linux AMD64.sobinary to GitHub Releases onv*tag push viasoftprops/action-gh-releaseOther changes
go.modmodule path togithub.com/lukoerfer/bifrost-encoding-format-pluginMakefileplugin name toencoding-formatREADME.mdwith usage and configuration docs✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.