Skip to content

feat(router): accept the advertised embedding model id, report backend limits - #11

Merged
eksrha merged 1 commit into
mainfrom
feat/router-model-id-and-limits
Oct 2, 2026
Merged

eksrha merged 1 commit into
mainfrom
feat/router-model-id-and-limits

Conversation

@eksrha

@eksrha eksrha commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • /v1/embeddings: when model names 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 /model pass through untouched.
  • /v1/models: entries for the embedding and reranker backends carry limits (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-local
  • New tests: model field stripped/kept per case, Content-Length consistent, limits attached
  • Not run against a real TEI container (no model image pulled)

Notes

The reranker route takes no model field in TEI, so no rewrite is needed there; it only gains limits.

Related Issues

Closes #3
Closes #4

…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
@eksrha
eksrha merged commit e41b126 into main Oct 2, 2026
2 checks passed
@eksrha
eksrha deleted the feat/router-model-id-and-limits branch October 2, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the embedding batch limits so clients can size requests Router advertises a model id the TEI backend rejects

1 participant