Skip to content

Commit a406130

Browse files
committed
docs: add generative-deepseek model provider integration page
Document the new generative-deepseek module (DeepSeek as a generative/RAG provider), available from v1.36.19, v1.37.10, and v1.38.2. - New provider pages model-providers/deepseek/{index,generative}.md (Python only for now) - Document the X-Deepseek-Api-Key and X-Deepseek-Baseurl headers and the DEEPSEEK_APIKEY env var - Config keys (model, temperature, maxTokens, frequencyPenalty, presencePenalty, topP, baseURL, stop) with defaults - Recommend deepseek-v4-flash / deepseek-v4-pro; note deepseek-chat and deepseek-reasoner are legacy aliases (deprecated 2026-07-24 per DeepSeek) - Add DeepSeek to the model-providers table and sidebar - Python snippets show the intended Configure.Generative.deepseek(...) syntax (client support to follow); kept out of the CI snippet allowlist
1 parent 1ced69c commit a406130

6 files changed

Lines changed: 365 additions & 0 deletions

File tree

docs/weaviate/model-providers/_includes/provider.connect.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
# Recommended: save sensitive data as environment variables
3434
databricks_token = os.getenv("DATABRICKS_TOKEN")
3535
# END DatabricksInstantiation
36+
# START DeepseekInstantiation
37+
# Recommended: save sensitive data as environment variables
38+
deepseek_key = os.getenv("DEEPSEEK_APIKEY")
39+
# END DeepseekInstantiation
3640
# START DigitalOceanInstantiation
3741
# Recommended: save sensitive data as environment variables
3842
digitalocean_key = os.getenv("DIGITALOCEAN_APIKEY")
@@ -114,6 +118,10 @@
114118
# START DatabricksInstantiation
115119
"X-Databricks-Token": databricks_token,
116120
# END DatabricksInstantiation
121+
# START DeepseekInstantiation
122+
"X-Deepseek-Api-Key": deepseek_key,
123+
# "X-Deepseek-Baseurl": "https://api.deepseek.com", # Optional; for providing a custom base URL
124+
# END DeepseekInstantiation
117125
# START DigitalOceanInstantiation
118126
"X-Digitalocean-Api-Key": digitalocean_key,
119127
# END DigitalOceanInstantiation

docs/weaviate/model-providers/_includes/provider.generative.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,110 @@ def import_data():
857857
# clean up
858858
client.collections.delete("DemoCollection")
859859

860+
# ---------------------------------------------------------------------------
861+
# DeepSeek generative integration (generative-deepseek).
862+
#
863+
# These snippets are documented AHEAD of Python client support:
864+
# `Configure.Generative.deepseek()` and `GenerativeConfig.deepseek()` do not
865+
# yet exist in the released weaviate-client (pinned in pyproject.toml). The
866+
# blocks below are DISPLAY-ONLY — they are rendered in the docs via
867+
# FilteredTextBlock (with `language="pyindent"`, which strips the 4-space guard
868+
# indent) and are intentionally kept out of the test runner's allowlist in
869+
# tests/test_python.py. The `if DEEPSEEK_CLIENT_AVAILABLE:` guard is a
870+
# belt-and-suspenders measure so that even if this file is ever executed
871+
# end-to-end, the not-yet-released `deepseek()` calls can never run.
872+
# TODO: set DEEPSEEK_CLIENT_AVAILABLE = True and drop `pyindent` once the
873+
# weaviate-client ships Configure.Generative.deepseek() / GenerativeConfig.deepseek().
874+
# ---------------------------------------------------------------------------
875+
DEEPSEEK_CLIENT_AVAILABLE = False
876+
877+
if DEEPSEEK_CLIENT_AVAILABLE:
878+
# START BasicGenerativeDeepseek
879+
from weaviate.classes.config import Configure
880+
881+
client.collections.create(
882+
"DemoCollection",
883+
# highlight-start
884+
generative_config=Configure.Generative.deepseek()
885+
# highlight-end
886+
# Additional parameters not shown
887+
)
888+
# END BasicGenerativeDeepseek
889+
890+
# clean up
891+
client.collections.delete("DemoCollection")
892+
893+
# START GenerativeDeepseekCustomModel
894+
from weaviate.classes.config import Configure
895+
896+
client.collections.create(
897+
"DemoCollection",
898+
# highlight-start
899+
generative_config=Configure.Generative.deepseek(
900+
model="deepseek-v4-flash"
901+
)
902+
# highlight-end
903+
# Additional parameters not shown
904+
)
905+
# END GenerativeDeepseekCustomModel
906+
907+
# clean up
908+
client.collections.delete("DemoCollection")
909+
910+
# START FullGenerativeDeepseek
911+
from weaviate.classes.config import Configure
912+
913+
client.collections.create(
914+
"DemoCollection",
915+
# highlight-start
916+
generative_config=Configure.Generative.deepseek(
917+
# # These parameters are optional
918+
# model="deepseek-v4-flash",
919+
# temperature=0.7,
920+
# max_tokens=500,
921+
# frequency_penalty=0.0,
922+
# presence_penalty=0.0,
923+
# top_p=1.0,
924+
# base_url="https://api.deepseek.com",
925+
# stop=["\n\n"],
926+
)
927+
# highlight-end
928+
)
929+
# END FullGenerativeDeepseek
930+
931+
# clean up
932+
client.collections.delete("DemoCollection")
933+
import_data()
934+
935+
# START RuntimeModelSelectionDeepseek
936+
from weaviate.classes.config import Configure
937+
from weaviate.classes.generate import GenerativeConfig
938+
939+
collection = client.collections.use("DemoCollection")
940+
response = collection.generate.near_text(
941+
query="A holiday film",
942+
limit=2,
943+
grouped_task="Write a tweet promoting these two movies",
944+
# highlight-start
945+
generative_provider=GenerativeConfig.deepseek(
946+
# # These parameters are optional
947+
# model="deepseek-v4-flash",
948+
# temperature=0.7,
949+
# max_tokens=500,
950+
# frequency_penalty=0.0,
951+
# presence_penalty=0.0,
952+
# top_p=1.0,
953+
# base_url="https://api.deepseek.com",
954+
# stop=["\n\n"],
955+
),
956+
# Additional parameters not shown
957+
# highlight-end
958+
)
959+
# END RuntimeModelSelectionDeepseek
960+
961+
# clean up
962+
client.collections.delete("DemoCollection")
963+
860964
# START BasicGenerativeNVIDIA
861965
from weaviate.classes.config import Configure
862966

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
title: Generative AI
3+
description: "Weaviate's integration with DeepSeek's API allows you to access their generative models' capabilities directly from Weaviate."
4+
sidebar_position: 50
5+
image: og/docs/model-provider-integrations.jpg
6+
# tags: ['model providers', 'deepseek', 'generative', 'rag']
7+
---
8+
9+
# DeepSeek Generative AI with Weaviate
10+
11+
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
12+
import PyConnect from '!!raw-loader!../_includes/provider.connect.py';
13+
import PyCode from '!!raw-loader!../_includes/provider.generative.py';
14+
15+
Weaviate's integration with DeepSeek's API allows you to access their generative models' capabilities directly from Weaviate.
16+
17+
[Configure a Weaviate collection](#configure-collection) to use a generative AI model with DeepSeek. Weaviate will perform retrieval augmented generation (RAG) using the specified model and your DeepSeek API key.
18+
19+
More specifically, Weaviate will perform a search, retrieve the most relevant objects, and then pass them to the DeepSeek generative model to generate outputs.
20+
21+
:::info Code examples are Python-only for now
22+
This page currently shows Python examples only. The typed builder syntax shown below (`Configure.Generative.deepseek()`) is the intended Python client API; client support is being implemented to match it. Other client languages will be added once the corresponding client support ships.
23+
:::
24+
25+
## Requirements
26+
27+
### Weaviate configuration
28+
29+
Your Weaviate instance must be configured with the DeepSeek generative AI integration (`generative-deepseek`) module.
30+
31+
:::info Added in `v1.36.19`, `v1.37.10`, and `v1.38.2`
32+
The `generative-deepseek` module was added as a coordinated backport across the `v1.36`, `v1.37`, and `v1.38` release lines. It is available from `v1.36.19` (on the `v1.36` line), `v1.37.10` (on the `v1.37` line), and `v1.38.2` (on the `v1.38` line). Earlier patch releases on these lines do not include the module.
33+
:::
34+
35+
<details>
36+
<summary>For Weaviate Cloud (WCD) users</summary>
37+
38+
This integration is enabled by default on Weaviate Cloud (WCD) instances.
39+
40+
</details>
41+
42+
<details>
43+
<summary>For self-hosted users</summary>
44+
45+
- Check the [cluster metadata](/deploy/configuration/status.md#cluster-metadata) to verify if the module is enabled.
46+
- Follow the [how-to configure modules](../../configuration/modules.md) guide to enable the module in Weaviate.
47+
- To enable the module, include it in the `ENABLE_MODULES` environment variable available to Weaviate, e.g. `ENABLE_MODULES="generative-deepseek"` (add it to your existing comma-separated list if other modules are enabled).
48+
49+
</details>
50+
51+
### API credentials
52+
53+
You must provide a valid DeepSeek API key to Weaviate for this integration. Go to [DeepSeek](https://platform.deepseek.com/) to sign up and obtain an API key.
54+
55+
Provide the API key to Weaviate using one of the following methods:
56+
57+
- Set the `DEEPSEEK_APIKEY` environment variable that is available to Weaviate.
58+
- Provide the API key at runtime, as shown in the examples below.
59+
60+
<FilteredTextBlock
61+
text={PyConnect}
62+
startMarker="# START DeepseekInstantiation"
63+
endMarker="# END DeepseekInstantiation"
64+
language="py"
65+
/>
66+
67+
## Configure collection
68+
69+
import MutableGenerativeConfig from '/_includes/mutable-generative-config.md';
70+
71+
<MutableGenerativeConfig />
72+
73+
[Configure a Weaviate index](../../manage-collections/generative-reranker-models.mdx#specify-a-generative-model-integration) as follows to use a DeepSeek generative model:
74+
75+
<FilteredTextBlock
76+
text={PyCode}
77+
startMarker="# START BasicGenerativeDeepseek"
78+
endMarker="# END BasicGenerativeDeepseek"
79+
language="pyindent"
80+
/>
81+
82+
### Select a model
83+
84+
You can specify one of the [available models](#available-models) for Weaviate to use, as shown in the following configuration example:
85+
86+
<FilteredTextBlock
87+
text={PyCode}
88+
startMarker="# START GenerativeDeepseekCustomModel"
89+
endMarker="# END GenerativeDeepseekCustomModel"
90+
language="pyindent"
91+
/>
92+
93+
You can [specify](#generative-parameters) one of the [available models](#available-models) for Weaviate to use. The [default model](#available-models) is used if no model is specified.
94+
95+
### Generative parameters
96+
97+
Configure the following generative parameters to customize the model behavior.
98+
99+
<FilteredTextBlock
100+
text={PyCode}
101+
startMarker="# START FullGenerativeDeepseek"
102+
endMarker="# END FullGenerativeDeepseek"
103+
language="pyindent"
104+
/>
105+
106+
For further details on model parameters, see the [DeepSeek API documentation](https://api-docs.deepseek.com/).
107+
108+
## Select a model at runtime
109+
110+
Aside from setting the default model provider when creating the collection, you can also override it at query time.
111+
112+
<FilteredTextBlock
113+
text={PyCode}
114+
startMarker="# START RuntimeModelSelectionDeepseek"
115+
endMarker="# END RuntimeModelSelectionDeepseek"
116+
language="pyindent"
117+
/>
118+
119+
## Header parameters
120+
121+
You can provide the API key as well as some optional parameters at runtime through additional headers in the request. The following headers are available:
122+
123+
- `X-Deepseek-Api-Key`: The DeepSeek API key.
124+
- `X-Deepseek-Baseurl`: The base URL to use (e.g. a proxy) instead of the default DeepSeek URL.
125+
126+
These headers are case-insensitive on the wire. Any additional headers provided at runtime will override the existing Weaviate configuration.
127+
128+
Provide the headers as shown in the [API credentials examples](#api-credentials) above.
129+
130+
## Retrieval augmented generation
131+
132+
After configuring the generative AI integration, perform RAG operations, either with the [single prompt](#single-prompt) or [grouped task](#grouped-task) method.
133+
134+
### Single prompt
135+
136+
To generate text for each object in the search results, use the single prompt method.
137+
138+
The example below generates outputs for each of the `n` search results, where `n` is specified by the `limit` parameter.
139+
140+
When creating a single prompt query, use braces `{}` to interpolate the object properties you want Weaviate to pass on to the language model. For example, to pass on the object's `title` property, include `{title}` in the query.
141+
142+
<FilteredTextBlock
143+
text={PyCode}
144+
startMarker="# START SinglePromptExample"
145+
endMarker="# END SinglePromptExample"
146+
language="py"
147+
/>
148+
149+
### Grouped task
150+
151+
To generate one text for the entire set of search results, use the grouped task method.
152+
153+
In other words, when you have `n` search results, the generative model generates one output for the entire group.
154+
155+
<FilteredTextBlock
156+
text={PyCode}
157+
startMarker="# START GroupedTaskExample"
158+
endMarker="# END GroupedTaskExample"
159+
language="py"
160+
/>
161+
162+
## References
163+
164+
### Available models
165+
166+
Weaviate forwards the configured model name to DeepSeek as-is; there is no allowlist on the Weaviate side, so any current DeepSeek model id is accepted. We recommend setting `model` explicitly to one of the current models:
167+
168+
* `deepseek-v4-flash` (recommended; verified with this integration)
169+
* `deepseek-v4-pro`
170+
171+
The module's built-in default model is `deepseek-chat`.
172+
173+
:::caution Legacy model aliases scheduled for deprecation
174+
According to [DeepSeek's pricing page](https://api-docs.deepseek.com/quick_start/pricing), `deepseek-chat` and `deepseek-reasoner` are legacy aliases scheduled for deprecation on **2026-07-24**, and they currently map to `deepseek-v4-flash` (in non-thinking and thinking modes, respectively). To avoid disruption, set `model` explicitly to a current `deepseek-v4-*` model id rather than relying on the default.
175+
:::
176+
177+
:::note Reasoning output is not returned
178+
The `generative-deepseek` module returns only the model's message content. If you use a reasoning/thinking model, the separate reasoning (chain-of-thought) output is not surfaced through the integration.
179+
:::
180+
181+
For the full list of models and pricing, see the [DeepSeek pricing page](https://api-docs.deepseek.com/quick_start/pricing) and the [DeepSeek API documentation](https://api-docs.deepseek.com/).
182+
183+
## Further resources
184+
185+
### Code examples
186+
187+
Once the integration is configured at the collection, the data management and search operations in Weaviate work identically to any other collection. See the following model-agnostic examples:
188+
189+
- The [How-to: Manage collections](../../manage-collections/index.mdx) and [How-to: Manage objects](../../manage-objects/index.mdx) guides show how to perform data operations (i.e. create, read, update, delete collections and objects within them).
190+
- The [How-to: Query & Search](../../search/index.mdx) guides show how to perform search operations (i.e. vector, keyword, hybrid) as well as retrieval augmented generation.
191+
192+
### References
193+
194+
- [DeepSeek API documentation](https://api-docs.deepseek.com/)
195+
196+
## Questions and feedback
197+
198+
import DocsFeedback from '/_includes/docs-feedback.mdx';
199+
200+
<DocsFeedback/>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: DeepSeek + Weaviate
3+
sidebar_position: 10
4+
image: og/docs/model-provider-integrations.jpg
5+
# tags: ['model providers', 'deepseek']
6+
---
7+
8+
<!-- Note: for images, use https://docs.google.com/presentation/d/15opIcJuaIjEEcs_1Zm8B6pccox2p7_MHSjCnRv4dPfU/edit?usp=sharing -->
9+
10+
DeepSeek offers a range of models for natural language processing and generation. Weaviate seamlessly integrates with the DeepSeek API, allowing users to leverage DeepSeek's generative models directly from the Weaviate Database.
11+
12+
This integration empowers developers to build sophisticated AI-driven applications with ease.
13+
14+
## Integrations with DeepSeek
15+
16+
### Generative AI models for RAG
17+
18+
DeepSeek's generative AI models can generate human-like text based on given prompts and contexts.
19+
20+
[Weaviate's generative AI integration](./generative.md) enables users to perform retrieval augmented generation (RAG) directly from the Weaviate Database. This combines Weaviate's efficient storage and fast retrieval capabilities with DeepSeek's generative AI models to generate personalized and context-aware responses.
21+
22+
[DeepSeek generative AI integration page](./generative.md)
23+
24+
## Summary
25+
26+
This integration enables developers to leverage DeepSeek's generative models directly within Weaviate.
27+
28+
In turn, it simplifies the process of building AI-driven applications to speed up your development process, so that you can focus on creating innovative solutions.
29+
30+
## Get started
31+
32+
You must provide a valid DeepSeek API key to Weaviate for this integration. Go to [DeepSeek](https://platform.deepseek.com/) to sign up and obtain an API key.
33+
34+
Then, go to the relevant integration page to learn how to configure Weaviate with the DeepSeek models and start using them in your applications.
35+
36+
- [Generative AI](./generative.md)
37+
38+
## Questions and feedback
39+
40+
import DocsFeedback from '/_includes/docs-feedback.mdx';
41+
42+
<DocsFeedback/>

docs/weaviate/model-providers/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This enables an enhanced developed experience, such as the ability to:
2424
| [Cohere](./cohere/index.md) | [Text](./cohere/embeddings.md), [Multimodal](./cohere/embeddings-multimodal.md) | [Text](./cohere/generative.md) | [Reranker](./cohere/reranker.md) |
2525
| [Contextual AI](./contextualai/index.md) | - | [Text](./contextualai/generative.md) | [Reranker](./contextualai/reranker.md) |
2626
| [Databricks](./databricks/index.md) | [Text](./databricks/embeddings.md) | [Text](./databricks/generative.md) | - |
27+
| [DeepSeek](./deepseek/index.md) | - | [Text](./deepseek/generative.md) | - |
2728
| [DigitalOcean](./digitalocean/index.md) | [Text](./digitalocean/embeddings.md) | - | - |
2829
| [FriendliAI](./friendliai/index.md) | - | [Text](./friendliai/generative.md) | - |
2930
| [Google](./google/index.md) | [Text](./google/embeddings.md), [Multimodal](./google/embeddings-multimodal.md) | [Text](./google/generative.md) | - |

0 commit comments

Comments
 (0)