Skip to content

Commit 852f992

Browse files
committed
Add support for Ollama generative and text2vec modules
1 parent 1b6c85a commit 852f992

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.cicd/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ function check_creates_template() {
154154
check_modules "--set modules.reranker-voyageai.enabled=true" "value: reranker-voyageai"
155155
check_modules "--set modules.reranker-voyageai.enabled=true --set modules.reranker-voyageai.apiKey=apiKey" "value: reranker-voyageai"
156156
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"
157+
check_modules "--set modules.text2vec-ollama.enabled=true" "value: text2vec-ollama"
158+
check_modules "--set modules.generative-ollama.enabled=true" "value: generative-ollama"
159+
check_modules "--set modules.generative-ollama.enabled=true --set modules.text2vec-ollama.enabled=true" "value: generative-ollama,text2vec-ollama"
157160

158161
check_modules "--set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.azureApiKey=azureApiKey" "value: text2vec-openai"
159162
check_modules "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "value: qna-openai"

weaviate/templates/_helpers.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
{{- if (index .Values "modules" "generative-mistral" "enabled") -}}
3939
{{ $modules = append $modules "generative-mistral" }}
4040
{{- end -}}
41+
{{- if (index .Values "modules" "generative-ollama" "enabled") -}}
42+
{{ $modules = append $modules "generative-ollama" }}
43+
{{- end -}}
4144
{{- if or (index .Values "modules" "img2vec-neural" "enabled") (index .Values "modules" "img2vec-neural" "inferenceUrl") -}}
4245
{{ $modules = append $modules "img2vec-neural" }}
4346
{{- end -}}
@@ -80,6 +83,9 @@
8083
{{- if (index .Values "modules" "text2vec-voyageai" "enabled") -}}
8184
{{ $modules = append $modules "text2vec-voyageai" }}
8285
{{- end -}}
86+
{{- if (index .Values "modules" "text2vec-ollama" "enabled") -}}
87+
{{ $modules = append $modules "text2vec-ollama" }}
88+
{{- end -}}
8389
{{- if (index .Values "modules" "ref2vec-centroid" "enabled") -}}
8490
{{ $modules = append $modules "ref2vec-centroid" }}
8591
{{- end -}}

weaviate/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,20 @@ modules:
916916
# an environment variable
917917
apiKey: ''
918918

919+
# The text2vec-ollama module uses Ollama Embeddings API
920+
# to dynamically compute vector embeddings based on the
921+
# sentence's context.
922+
# More information about Ollama Embeddings API can be found here:
923+
# https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings
924+
# Please note that you have to deploy Ollama container by yourself
925+
# and then properly point the Ollama endpoint using module settings.
926+
# More about this configuration can be found here:
927+
# https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-ollama#ollama-endpoint
928+
text2vec-ollama:
929+
930+
# enable if you want to use VoaygeAI module
931+
enabled: false
932+
919933
# The multi2vec-clip modules uses CLIP transformers to vectorize both images
920934
# and text in the same vector space. It is typically slow(er) on CPUs and should
921935
# run with CUDA-enabled GPUs for optimal performance.
@@ -1252,6 +1266,18 @@ modules:
12521266
# an environment variable
12531267
apiKey: ''
12541268

1269+
# The generative-ollama module uses Ollama Generate API
1270+
# More information about Ollama's Generate API can be found here:
1271+
# https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion
1272+
# Please note that you have to deploy Ollama container by yourself
1273+
# and then properly point the Ollama endpoint using module settings.
1274+
# More about this configuration can be found here:
1275+
# https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-ollama#ollama-endpoint
1276+
generative-ollama:
1277+
1278+
# enable if you want to use VoaygeAI module
1279+
enabled: false
1280+
12551281
# The img2vec-neural module uses neural networks, to generate
12561282
# a vector representation of the image
12571283
img2vec-neural:

0 commit comments

Comments
 (0)