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

embeddings: remove TEI embeddings client. #396

Merged
merged 67 commits into from
Dec 9, 2023
Merged

Conversation

pattonjp
Copy link
Contributor

@pattonjp pattonjp commented Dec 4, 2023

followup per #352

PR Checklist

  • Read the Contributing documentation.
  • Read the Code of conduct documentation.
  • Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
  • Describes the source of new concepts.
  • References existing implementations as appropriate.
  • Contains test coverage for new functions.
  • Passes all golangci-lint checks.

noodnik2 and others added 30 commits September 29, 2023 09:05
* FR278 Add remote chromadb support

* FR278 Fix lint complaints

* Add 'nameSpace' via metadata

* Add embedder Option

* Add includes, example app, README

* feat(vectorstore): add chroma

* fix: update type to match upstream

* style: fix golangci-lint complaints
Signed-off-by: Saerdna <zhaodahao@gmail.com>
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.4.24...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: bjwswang <bjwswang@gmail.com>
…#326)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update README.md

* Update README.md
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.57.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.57.0...v1.57.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Adding ollama support

* Address linting issues

* Disable default templating of model if any to avoid messing up custom prompts

* Added Ollama chatModel

* Adding ollama embeddings

* Added examples and fix the chat template for llama2

* examples: Fixup module names in ollama examples

* ollama: Small lint fix

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
* docs: Mark unfinished parts as draft

* github: Add docs publish workflow

* github: Simplify pages deploy

* docs: set baseUrl

* docs: mark more as draft for now
ci: Pin golangci-lint to 1.55
* Added initial HandelStreamFunc callback handler

* added callback handler to conversational agent

* Added Agent final stdout callback

* Added callback handler to mrkl agent

* Added egress buffer for final agent streaming

* Added proper egress channel handling

* Added comments

* Added better context handling

* Fixing lint
pattonjp and others added 12 commits November 30, 2023 14:32
add option to truncate tei embedding input
adding huggingface text embeddings interface as docker service for convienience
This is the first use of the refactoring made in tmc#374 -- removing the
embeddings/openai directory entirely, since it can be now implemented
with NewEmbedder without duplicating code. The test was moved one
dir down and works with the new setup.

This is a model that can be used to similarly refactor the other
embeddings/* subdirs.

This is a large PR because it also updates example go.mods

For tmc#379
Now that the main module's version was bumped, update the example
to use a proper embedder
The only use of Ollama embeddings is an example - update it too and
go.mod versions
embeddings: new NewEmbedder for Ollama embeddings
For tmc#379

Updates examples go.mod because it's used in an example
…tmc#393)

* embeddings: add example of proper usage, and tweak doc.go accordingly

For tmc#379

* Appease lint and add comment
@pattonjp
Copy link
Contributor Author

pattonjp commented Dec 4, 2023

examples ci build is failing due to new dependency.

Copy link
Collaborator

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -18,7 +18,7 @@ import (
type Store struct {
dropOld bool
async bool
initialized bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file seem unrelated to the main goal of the PR, or am I missing something? It'd be good to keep the PR for a single purpose only

llms/tei/text_embeddings_inference..go Outdated Show resolved Hide resolved
@eliben
Copy link
Collaborator

eliben commented Dec 8, 2023

@pattonjp friendly ping - do you intend to continue with this PR?

@pattonjp pattonjp changed the title embeddings: TEI factor to new embedder client pattern embeddings: remove TEI embeddings client. Dec 8, 2023
@pattonjp
Copy link
Contributor Author

pattonjp commented Dec 8, 2023

@eliben
after the embeddings factor, it appears that the tei embeddings client is no longer needed. i am now able to use openai llm as client to my local tei instance.

chroma_vectorstore_example Outdated Show resolved Hide resolved
@eliben
Copy link
Collaborator

eliben commented Dec 8, 2023

@eliben after the embeddings factor, it appears that the tei embeddings client is no longer needed. i am now able to use openai llm as client to my local tei instance.

That's a great outcome :)

Copy link
Collaborator

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM overall - though it's still not clear if all the changes this PR introduces are related/essential for the title (see my other comment)

@tmc for approval

Copy link
Owner

@tmc tmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmc tmc merged commit 00f364f into tmc:main Dec 9, 2023
3 checks passed
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.