---
title: "DigitalOcean Embeddings with Weaviate"
description: "Weaviate's integration with DigitalOcean's Serverless Inference lets you access DigitalOcean-hosted embedding models directly from Weaviate."
url: https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings
---

# DigitalOcean Embeddings with Weaviate

Weaviate's integration with [DigitalOcean's Serverless Inference](https://docs.digitalocean.com/products/inference/how-to/use-serverless-inference/) lets you access DigitalOcean-hosted embedding models directly from Weaviate.

[Configure a Weaviate vector index](https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings#configure-the-vectorizer) to use a DigitalOcean embedding model, and Weaviate generates embeddings for imports and searches automatically using your DigitalOcean API key. This is the *vectorizer*.

At [import time](https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings#data-import), Weaviate generates text object embeddings and saves them into the index. For [vector](https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings#vector-near-text-search) and [hybrid](https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings#hybrid-search) search operations, Weaviate converts text queries into embeddings.

![Embedding integration illustration](https://docs.weaviate.io/assets/images/integration_digitalocean_embedding-765c8664abc03907b8a95754e28cb859.png)

## Requirements

### Weaviate configuration

Your Weaviate instance must have the `text2vec-digitalocean` module enabled.

**For Weaviate Cloud (WCD) users**

This integration is enabled by default on Weaviate Cloud (WCD) instances.

**For self-hosted users**

- Check the [cluster metadata](https://docs.weaviate.io/deploy/configuration/status#cluster-metadata) to verify if the module is enabled.
- Follow the [how-to configure modules](https://docs.weaviate.io/weaviate/configuration/modules) guide to enable the module in Weaviate.

### API credentials

You must provide a DigitalOcean API key to Weaviate for this integration. Generate one in the [DigitalOcean Cloud console](https://cloud.digitalocean.com/) and supply it via one of:

- Set the `DIGITALOCEAN_APIKEY` environment variable on the Weaviate server.
- Provide the `X-Digitalocean-Api-Key` header at request time, as shown below.

**Python**

```py
import weaviate
from weaviate.classes.init import Auth
import os

# Recommended: save sensitive data as environment variables
digitalocean_key = os.getenv("DIGITALOCEAN_APIKEY")
headers = {
    "X-Digitalocean-Api-Key": digitalocean_key,
}

client = weaviate.connect_to_weaviate_cloud(
    cluster_url=weaviate_url,                       # `weaviate_url`: your Weaviate URL
    auth_credentials=Auth.api_key(weaviate_key),      # `weaviate_key`: your Weaviate API key
    headers=headers
)

# Work with Weaviate

client.close()
```

**JavaScript/TypeScript**

```ts
import weaviate from '@weaviate/node'

const digitaloceanApiKey = process.env.DIGITALOCEAN_APIKEY || '';  // Replace with your inference API key

const client = await weaviate.connectToWeaviateCloud(
  'WEAVIATE_INSTANCE_URL',  // Replace with your instance URL
  {
    authCredentials: new weaviate.ApiKey('WEAVIATE_INSTANCE_API_KEY'),
    headers: {
      'X-Digitalocean-Api-Key': digitaloceanApiKey,
    }
  }
)

// Work with Weaviate

client.close()
```

**Java**

```java
// Best practice: store your credentials in environment variables
String weaviateUrl = System.getenv("WEAVIATE_URL");
String weaviateApiKey = System.getenv("WEAVIATE_API_KEY");
String digitalOceanApiKey = System.getenv("DIGITALOCEAN_APIKEY");

WeaviateClient client = WeaviateClient.connectToWeaviateCloud(
    weaviateUrl,
    weaviateApiKey,
    config -> config.setHeaders(Map.of("X-Digitalocean-Api-Key", digitalOceanApiKey)));

System.out.println(client.isReady()); // Should print: `True`

client.close(); // Free up resources
```

**C#**

```csharp
// Best practice: store your credentials in environment variables
string weaviateUrl = Environment.GetEnvironmentVariable("WEAVIATE_URL");
string weaviateApiKey = Environment.GetEnvironmentVariable("WEAVIATE_API_KEY");
string digitalOceanApiKey = Environment.GetEnvironmentVariable("DIGITALOCEAN_APIKEY");

using var client = await Connect.Cloud(
    weaviateUrl,
    weaviateApiKey,
    headers: new Dictionary<string, string>
    {
        ["X-Digitalocean-Api-Key"] = digitalOceanApiKey,
    }
);

var meta = await client.GetMeta();
Console.WriteLine(meta.Version);
```

## Configure the vectorizer

[Configure a Weaviate index](https://docs.weaviate.io/weaviate/manage-collections/vector-config#specify-a-vectorizer) to use a DigitalOcean Serverless Inference model by setting the vectorizer as follows:

**Python**

```py
from weaviate.classes.config import Configure

client.collections.create(
    "DemoCollection",
    vector_config=[
        Configure.Vectors.text2vec_digitalocean(
            model="qwen3-embedding-0.6b",  # Required. Choose from the DigitalOcean Serverless Inference catalogue
            name="title_vector",
            source_properties=["title"],
        )
    ],
    # Additional parameters not shown
)
```

**JavaScript/TypeScript**

```ts
await client.collections.create({
  name: 'DemoCollection',
  properties: [
    {
      name: 'title',
      dataType: 'text' as const,
    },
  ],
  vectorizers: [
    weaviate.configure.vectors.text2VecDigitalOcean({
      model: 'qwen3-embedding-0.6b',  // Required. Choose from the DigitalOcean Serverless Inference catalogue
      name: 'title_vector',
      sourceProperties: ['title'],
    })
  ],
  // Additional parameters not shown
});
```

**Java**

```java
client.collections.create("DemoCollection",
    col -> col
        .vectorConfig(
            VectorConfig.text2vecDigitalOcean("title_vector",
                c -> c.model("qwen3-embedding-0.6b").sourceProperties("title")))
        .properties(Property.text("title"), Property.text("description")));
```

**C#**

```csharp
await client.Collections.Create(
    new CollectionCreateParams
    {
        Name = "DemoCollection",
        VectorConfig = new VectorConfigList
        {
            Configure.Vector(
                "title_vector",
                v => v.Text2VecDigitalOcean(model: "qwen3-embedding-0.6b"),
                sourceProperties: ["title"]
            ),
        },
        Properties = [Property.Text("title"), Property.Text("description")],
    }
);
```

### Vectorizer parameters

- `model`: **Required.** The DigitalOcean Serverless Inference model ID, for example `qwen3-embedding-0.6b`. Query `GET /v1/models` on the inference endpoint to see the catalog of available models for your account.
- `baseURL`: Optional. The base URL where API requests should go. Defaults to `https://inference.do-ai.run`. Override only if you're proxying or running against a non-default endpoint.

## Header parameters

You can override the API key per-request via headers. Headers provided at request time take precedence over the server-side `DIGITALOCEAN_APIKEY` environment variable:

- `X-Digitalocean-Api-Key`: The DigitalOcean API key for this request.

## Data import

After configuring the vectorizer, [import data](https://docs.weaviate.io/weaviate/manage-objects/import) into Weaviate. Weaviate generates embeddings for text objects using [the configured model](https://docs.weaviate.io/weaviate/model-providers/digitalocean/embeddings#vectorizer-parameters).

> [!TIP]
>
> **Re-use existing vectors**
>
> If you already have a compatible model vector available, you can provide it directly to Weaviate. This can be useful if you have already generated embeddings using the same model and want to use them in Weaviate, such as when migrating data from another system.

## Searches

Once the vectorizer is configured, Weaviate performs vector and hybrid searches using the specified DigitalOcean model.

![Embedding integration at search illustration](https://docs.weaviate.io/assets/images/integration_digitalocean_embedding_search-b4c8117767db40bf2696d4571d5ce306.png)

### Vector (near text) search

When you perform a [vector search](https://docs.weaviate.io/weaviate/search/similarity#search-with-text), Weaviate converts the text query into an embedding using the configured DigitalOcean model and returns the most similar objects.

### Hybrid search

When you perform a [hybrid search](https://docs.weaviate.io/weaviate/search/hybrid), Weaviate fuses keyword and vector ranking. The text query is embedded with the configured DigitalOcean model. The keyword side uses Weaviate's inverted index.

## References

### Available models

When the server has a DigitalOcean API key, Weaviate checks the model name against the `GET /v1/models` list for that account when you create the collection. Without a server-side key, Weaviate skips this check, and DigitalOcean rejects an unknown model at request time.

There is no server default. You must set `model` when you configure the vectorizer.

See the [DigitalOcean Serverless Inference guide](https://docs.digitalocean.com/products/inference/how-to/use-serverless-inference/) for the list of available models.

> [!NOTE]
>
> **Dimensions parameter currently not supported**
>
> DigitalOcean's `/v1/embeddings` endpoint does not accept a `dimensions` request field at the time of writing, even for [Matryoshka Representation Learning (MRL)](https://huggingface.co/blog/matryoshka)-capable models like `qwen3-embedding-0.6b` whose native output could otherwise be truncated. Weaviate intentionally does not forward a `dimensions` parameter to avoid silent no-ops. The embedding dimension is always the model's native size.

## Further resources

### Other integrations

- [DigitalOcean generative AI models + Weaviate](https://docs.weaviate.io/weaviate/model-providers/digitalocean/generative)
- [Weaviate model providers overview](https://docs.weaviate.io/weaviate/model-providers)

### Code examples

Once the vectorizer is configured, Weaviate handles model inference transparently. The standard [client library how-tos](https://docs.weaviate.io/weaviate/client-libraries) apply unchanged. No DigitalOcean-specific code is required at query or import time beyond the configuration shown above.
