feat(router): accept the advertised embedding model id, report backend limits - #11
Merged
Merged
Conversation
…d limits - strip the "model" field from /v1/embeddings when it names an id the router advertises; TEI rejects anything but its internal path and warned on every request before falling back - /v1/models now includes limits (max_batch_tokens, max_client_batch_size, max_input_length) read from the backend's /info, so clients can size batches
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.
Summary
/v1/embeddings: whenmodelnames an id the router advertises on/v1/models, the field is removed before forwarding. TEI only accepts its internal model path (or no model), and logged a warning on every request before falling back. Other ids and/modelpass through untouched./v1/models: entries for the embedding and reranker backends carrylimits(max_batch_tokens,max_client_batch_size,max_input_length), read from the backend's/info(field names checked against the TEI source). Absent if the backend has no/info.Testing
go test -race ./...,golangci-lint run,make test-localNotes
The reranker route takes no
modelfield in TEI, so no rewrite is needed there; it only gainslimits.Related Issues
Closes #3
Closes #4