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 support for Ollama generative and text2vec modules #231

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ function check_creates_template() {
check_modules "--set modules.reranker-voyageai.enabled=true" "value: reranker-voyageai"
check_modules "--set modules.reranker-voyageai.enabled=true --set modules.reranker-voyageai.apiKey=apiKey" "value: reranker-voyageai"
check_modules "--set modules.text2vec-voyageai.enabled=true --set modules.text2vec-voyageai.apiKey=apiKey --set modules.reranker-voyageai.enabled=true --set modules.reranker-voyageai.apiKey=apiKey" "value: text2vec-voyageai,reranker-voyageai"
check_modules "--set modules.text2vec-ollama.enabled=true" "value: text2vec-ollama"
check_modules "--set modules.generative-ollama.enabled=true" "value: generative-ollama"
check_modules "--set modules.generative-ollama.enabled=true --set modules.text2vec-ollama.enabled=true" "value: generative-ollama,text2vec-ollama"

check_modules "--set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.azureApiKey=azureApiKey" "value: text2vec-openai"
check_modules "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "value: qna-openai"
Expand Down
6 changes: 6 additions & 0 deletions weaviate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
{{- if (index .Values "modules" "generative-mistral" "enabled") -}}
{{ $modules = append $modules "generative-mistral" }}
{{- end -}}
{{- if (index .Values "modules" "generative-ollama" "enabled") -}}
{{ $modules = append $modules "generative-ollama" }}
{{- end -}}
{{- if or (index .Values "modules" "img2vec-neural" "enabled") (index .Values "modules" "img2vec-neural" "inferenceUrl") -}}
{{ $modules = append $modules "img2vec-neural" }}
{{- end -}}
Expand Down Expand Up @@ -80,6 +83,9 @@
{{- if (index .Values "modules" "text2vec-voyageai" "enabled") -}}
{{ $modules = append $modules "text2vec-voyageai" }}
{{- end -}}
{{- if (index .Values "modules" "text2vec-ollama" "enabled") -}}
{{ $modules = append $modules "text2vec-ollama" }}
{{- end -}}
{{- if (index .Values "modules" "ref2vec-centroid" "enabled") -}}
{{ $modules = append $modules "ref2vec-centroid" }}
{{- end -}}
Expand Down
26 changes: 26 additions & 0 deletions weaviate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,20 @@ modules:
# an environment variable
apiKey: ''

# The text2vec-ollama module uses Ollama Embeddings API
# to dynamically compute vector embeddings based on the
# sentence's context.
# More information about Ollama Embeddings API can be found here:
# https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings
# Please note that you have to deploy Ollama container by yourself
# and then properly point the Ollama endpoint using module settings.
# More about this configuration can be found here:
# https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-ollama#ollama-endpoint
text2vec-ollama:

# enable if you want to use Ollama module
enabled: false

# The multi2vec-clip modules uses CLIP transformers to vectorize both images
# and text in the same vector space. It is typically slow(er) on CPUs and should
# run with CUDA-enabled GPUs for optimal performance.
Expand Down Expand Up @@ -1252,6 +1266,18 @@ modules:
# an environment variable
apiKey: ''

# The generative-ollama module uses Ollama Generate API
# More information about Ollama's Generate API can be found here:
# https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion
# Please note that you have to deploy Ollama container by yourself
# and then properly point the Ollama endpoint using module settings.
# More about this configuration can be found here:
# https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-ollama#ollama-endpoint
generative-ollama:

# enable if you want to use Ollama module
enabled: false

# The img2vec-neural module uses neural networks, to generate
# a vector representation of the image
img2vec-neural:
Expand Down
Loading