Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint parameter to TextEmbeddingsInference #17598

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

thommann
Copy link
Contributor

@thommann thommann commented Jan 23, 2025

… to allow overwriting the default endpoint "/embed"

Description

Allow for a custom endpoint in the TextEmbeddingInference class. This allows to overwrite the default "/embed" endpoint. This is needed to use the "/embedding" endpoint of services like the llama.cpp server.

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

Sorry, something went wrong.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 23, 2025
@thommann thommann marked this pull request as draft January 23, 2025 12:54
@logan-markewich
Copy link
Collaborator

This looks pretty good to me. Any reason its a draft?

@thommann
Copy link
Contributor Author

This looks pretty good to me. Any reason its a draft?

I tried to use it with a llama.cpp server to host the embedding model. The problem is, that it is not only the endpoint that is different, but also the format of the response body. Both are hard-coded in the TextEmbeddingInference.

thommann and others added 3 commits January 27, 2025 09:07

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@thommann thommann marked this pull request as ready for review January 27, 2025 08:09
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 27, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 29, 2025
@logan-markewich logan-markewich enabled auto-merge (squash) January 29, 2025 03:05
@logan-markewich logan-markewich merged commit c8a7c90 into run-llama:main Jan 29, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants