Skip to main content
Go to documentation:
⌘U
Weaviate Database

Develop AI applications using Weaviate's APIs and tools

Deploy

Deploy, configure, and maintain Weaviate Database

Weaviate Agents

Build and deploy intelligent agents with Weaviate

Weaviate Cloud

Manage and scale Weaviate in the cloud

Additional resources

Integrations
Contributor guide
Events & Workshops
Weaviate Academy

Need help?

Weaviate LogoAsk AI Assistant⌘K
Community Forum

Generative and reranker models

Embedding models / Vectorizers

Visit the Vectorizer and vector config guide to find out how to configure an embedding model for your collection or to fine-tune the vector index settings.

Specify a reranker model integration

Configure a reranker model integration for reranking retrieved results.

py docs  API docs
More infoCode snippets in the documentation reflect the latest client library and Weaviate Database version. Check the Release notes for specific versions.

If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Configure, Property, DataType

client.collections.create(
"Article",
vector_config=Configure.Vectors.text2vec_openai(),
reranker_config=Configure.Reranker.cohere(),
)

Update the reranker model integration

Available from v1.25.23, v1.26.8 and v1.27.1

The reranker and generative configurations are mutable from v1.25.23, v1.26.8 and v1.27.1.

Update the reranker model integration for reranking retrieved results.

py docs  API docs
More infoCode snippets in the documentation reflect the latest client library and Weaviate Database version. Check the Release notes for specific versions.

If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Reconfigure

collection = client.collections.use("Article")

collection.config.update(
reranker_config=Reconfigure.Reranker.cohere() # Update the reranker module
)

Specify a generative model integration

Specify a generative model integration for a collection (for RAG).

py docs  API docs
More infoCode snippets in the documentation reflect the latest client library and Weaviate Database version. Check the Release notes for specific versions.

If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Configure, Property, DataType

client.collections.create(
"Article",
vector_config=Configure.Vectors.text2vec_openai(),
generative_config=Configure.Generative.openai(
model="gpt-4o" # set your generative model (optional parameter)
),
)

Update the generative model integration

Available from v1.25.23, v1.26.8 and v1.27.1

The reranker and generative configurations are mutable from v1.25.23, v1.26.8 and v1.27.1.

Update a generative model integration.

py docs  API docs
More infoCode snippets in the documentation reflect the latest client library and Weaviate Database version. Check the Release notes for specific versions.

If a snippet doesn't work or you have feedback, please open a GitHub issue.
from weaviate.classes.config import Reconfigure

collection = client.collections.use("Article")

collection.config.update(
generative_config=Reconfigure.Generative.cohere() # Update the generative module
)
tip

You can override the generative integration settings at query time without updating it in the collection configuration.

Further resources

Questions and feedback

If you have any questions or feedback, let us know in the user forum.