Skip to content

(Wait for py client release to merge) 20250804 Add model2vec examples #129

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

Merged
merged 7 commits into from
Aug 6, 2025
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
4 changes: 2 additions & 2 deletions docs/deploy/configuration/env-vars/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import APITable from '@site/src/components/APITable';
| `GRPC_PORT` | The port on which Weaviate's gRPC server listens for incoming requests. Default: `50051` | `string - number` | `50052` |
| `LIMIT_RESOURCES` | If `true`, Weaviate will automatically attempt to auto-detect and limit the amount of resources (memory & threads) it uses to (0.8 * total memory) and (number of cores-1). It will override any `GOMEMLIMIT` values, however it will respect `GOMAXPROCS` values. | `boolean` | `false` |
| `LOG_FORMAT` | Set the Weaviate logging format <br/><br/>Default: Outputs log data to json. e.g.: `{"action":"startup","level":"debug","msg":"finished initializing modules","time":"2023-04-12T05:07:43Z"}` <br/>`text`: Outputs log data to a string. e.g. `time="2023-04-12T04:54:23Z" level=debug msg="finished initializing modules" action=startup` | `string` | |
| `LOG_LEVEL` | Sets the Weaviate logging level. Default: `info`<br/><br/>`panic`: Panic entries only. (new in `v1.24`) <br/>`fatal`: Fatal entries only. (new in `v1.24`) <br/> `error`: Error entries only. (new in `v1.24`) <br/>`warning`: Warning entries only. (new in `v1.24`) <br/>`info`: General operational entries. <br/> `debug`: Very verbose logging. <br/>`trace`: Even finer-grained informational events than `debug`. | `string` | |
| `LOG_LEVEL` | Sets the Weaviate logging level. Default: `info`<br/><br/>`panic`: Panic entries only. (new in `v1.24`) <br/>`fatal`: Fatal entries only. (new in `v1.24`) <br/> `error`: Error entries only. (new in `v1.24`) <br/>`warning`: Warning entries only. (new in `v1.24`) <br/>`info`: General operational entries. <br/> `debug`: Very verbose logging. <br/>`trace`: Even finer-grained informational events than `debug`. | `string` | |
| `MAXIMUM_ALLOWED_COLLECTIONS_COUNT` | Maximum allowed number of collections in a Weaviate node. A value of `-1` removes the limit. Default: `1000` <br/><br/>Instead of raising the collections count limit, consider [rethinking your architecture](/weaviate/starter-guides/managing-collections/collections-scaling-limits.mdx).<br/>Added in `v1.30`| `string - number` | `20` |
| `MEMORY_READONLY_PERCENTAGE` | If memory usage is higher than the given percentage all shards on the affected node will be marked as `READONLY`, meaning all future write requests will fail. (Default: `0` - i.e. no limit) | `string - number` | `75` |
| `MEMORY_WARNING_PERCENTAGE` | If memory usage is higher than the given percentage a warning will be logged by all shards on the affected node's disk. (Default: `0` - i.e. no limit) | `string - number` | `85` |
Expand Down Expand Up @@ -105,7 +105,7 @@ import APITable from '@site/src/components/APITable';
| `OFFLOAD_S3_BUCKET_AUTO_CREATE` | Whether to automatically create the S3 bucket for offloading if it does not exist (default: `false`) | `boolean` | `true` |
| `OFFLOAD_S3_CONCURRENCY` | The maximum number of parts that will be uploaded/downloaded in parallel during offloading operations (default: `25`) | `string - number` | `10` |
| `OFFLOAD_TIMEOUT` | The request timeout value, in seconds (default: `120`) | `string - number` | `60` |
| `TRANSFORMERS_INFERENCE_API` | The endpoint where to reach the transformers module if enabled | `string` | `http://t2v-transformers:8080` |
| `TRANSFORMERS_INFERENCE_API` | The endpoint where to reach the transformers module if enabled | `string` | `http://text2vec-transformers:8080` |
| `USE_GOOGLE_AUTH` | Automatically look for Google Cloud credentials, and generate Vertex AI access tokens for Weaviate to use as needed ([read more](/weaviate/model-providers/google/index.md)). (default: `false`) | `boolean` | `true` |
| `USE_SENTENCE_TRANSFORMERS_VECTORIZER` | (EXPERIMENTAL) Use the `sentence-transformer` vectorizer instead of the default vectorizer (from the `transformers` library). Applies to custom images only. | `boolean` | `true` |
| `CLIP_WAIT_FOR_STARTUP` | If `true`, Weaviate waits for the `multi2vec-clip` module to start up before starting (default: `true`). | `boolean` | `true` |
Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/installation-guides/docker-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ volumes:
```

:::caution
Anonymous access is strongly discouraged except for development or evaluation purposes.
Anonymous access is strongly discouraged except for development or evaluation purposes.
:::

</TabItem>
Expand Down Expand Up @@ -225,9 +225,9 @@ services:
PERSISTENCE_DATA_PATH: "./data"
DEFAULT_VECTORIZER_MODULE: text2vec-transformers
ENABLE_MODULES: text2vec-transformers
TRANSFORMERS_INFERENCE_API: http://t2v-transformers:8080
TRANSFORMERS_INFERENCE_API: http://text2vec-transformers:8080
CLUSTER_HOSTNAME: 'node1'
t2v-transformers:
text2vec-transformers:
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1
environment:
ENABLE_CUDA: 0 # set to 1 to enable
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions docs/weaviate/model-providers/_includes/provider.vectorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,47 @@
# clean up
client.collections.delete("DemoCollection")

# START BasicVectorizerModel2Vec
from weaviate.classes.config import Configure

client.collections.create(
"DemoCollection",
# highlight-start
vector_config=[
Configure.Vectors.text2vec_model2vec(
name="title_vector",
source_properties=["title"],
)
],
# highlight-end
# Additional parameters not shown
)
# END BasicVectorizerModel2Vec

# clean up
client.collections.delete("DemoCollection")

# START FullVectorizerModel2Vec
from weaviate.classes.config import Configure

client.collections.create(
"DemoCollection",
# highlight-start
vector_config=[
Configure.Vectors.text2vec_model2vec(
name="title_vector",
source_properties=["title"],
inference_url="<custom-inference-url>", # Default - configuration defined through container, e.g. Docker compose file
)
],
# highlight-end
# Additional parameters not shown
)
# END FullVectorizerModel2Vec

# clean up
client.collections.delete("DemoCollection")

# START BasicMMVectorizerCLIP
from weaviate.classes.config import Configure, DataType, Multi2VecField, Property

Expand Down
27 changes: 19 additions & 8 deletions docs/weaviate/model-providers/_includes/provider.vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import weaviate from 'weaviate-client';

async function main() {


const client = await weaviate.connectToLocal({
headers: {
'X-OpenAI-Api-Key': process.env.OPENAI_APIKEY || '',
Expand Down Expand Up @@ -727,7 +727,7 @@ await client.collections.delete('DemoCollection');
// START BasicColBERTVectorizerJinaAI
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.multiVectors.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
Expand All @@ -742,7 +742,7 @@ await client.collections.delete('DemoCollection');
// START ColBERTVectorizerJinaCustomModel
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.multiVectors.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
Expand All @@ -758,7 +758,7 @@ await client.collections.delete('DemoCollection');
// START FullColBERTVectorizerJinaAI
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.multiVectors.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
Expand Down Expand Up @@ -825,7 +825,7 @@ await client.collections.delete('DemoCollection');
// START BasicVectorizerNVIDIA
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.vectors.text2VecNvidia({
name: 'title_vector',
sourceProperties: ['title'],
Expand All @@ -841,7 +841,7 @@ await client.collections.delete('DemoCollection');
// START VectorizerNVIDIACustomModel
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.vectors.text2VecNvidia({
name: 'title_vector',
sourceProperties: ['title'],
Expand All @@ -858,7 +858,7 @@ await client.collections.delete('DemoCollection');
// START FullVectorizerNVIDIA
await client.collections.create({
name: 'DemoCollection',
vectorizers: [
vectorizers: [
weaviate.configure.vectors.text2VecNvidia({
name: 'title_vector',
sourceProperties: ['title'],
Expand Down Expand Up @@ -1587,6 +1587,17 @@ await client.collections.create({
});
// END FullVectorizerGPT4All

// START BasicVectorizerModel2Vec
// Coming soon
// END BasicVectorizerModel2Vec

// Clean up
await client.collections.delete('DemoCollection');

// START FullVectorizerModel2Vec
// Coming soon
// END FullVectorizerModel2Vec

// START BasicMMVectorizerCLIP
await client.collections.create({
name: 'DemoCollection',
Expand Down Expand Up @@ -1852,4 +1863,4 @@ client.close();

}

void main();
void main();
4 changes: 2 additions & 2 deletions docs/weaviate/model-providers/gpt4all/embeddings.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ services:
# Other Weaviate configuration
environment:
GPT4ALL_INFERENCE_API: http://text2vec-gpt4all:8080 # Set the inference API endpoint
t2v-gpt4all: # Set the name of the inference container
text2vec-gpt4all: # Set the name of the inference container
image: cr.weaviate.io/semitechnologies/gpt4all-inference:all-MiniLM-L6-v2
```

- `GPT4ALL_INFERENCE_API` environment variable sets the inference API endpoint
- `t2v-gpt4all` is the name of the inference container
- `text2vec-gpt4all` is the name of the inference container
- `image` is the container image

</TabItem>
Expand Down
1 change: 1 addition & 0 deletions docs/weaviate/model-providers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Read more about [enabling all API-based modules](../configuration/modules.md#ena
| --- | --- | --- | --- |
| [GPT4All](./gpt4all/index.md) | [Text](./gpt4all/embeddings.md) | - | - |
| [Hugging Face](./transformers/index.md) | [Text](./transformers/embeddings.md), [Multimodal (CLIP)](./transformers/embeddings-multimodal.md) | - | [Reranker](./transformers/reranker.md) |
| [Model2vec](./model2vec/index.md) | [Text](./model2vec/embeddings.md) | - | - |
| [Meta ImageBind](./imagebind/index.md) | [Multimodal](./imagebind/embeddings-multimodal.md) | - | - |
| [Ollama](./ollama/index.md) | [Text](./ollama/embeddings.md) | [Text](./ollama/generative.md) | - |

Expand Down
4 changes: 4 additions & 0 deletions docs/weaviate/model-providers/model2vec/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "GPT4All (locally hosted)",
"position": 320
}
Loading
Loading