Skip to content

Commit

Permalink
Merge pull request #231 from weaviate/add-support-for-ollama-modules
Browse files Browse the repository at this point in the history
Add support for Ollama generative and text2vec modules
  • Loading branch information
antas-marcin authored May 10, 2024
2 parents 62686aa + bc97a2a commit b77a622
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
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

0 comments on commit b77a622

Please sign in to comment.