Skip to content
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

Added community providers #3792

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
95 changes: 95 additions & 0 deletions content/providers/03-community-providers/06-mixedbread-ai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Mixedbread AI Provider
description: Learn how to use the Mixedbread AI provider.
---

# Mixedbread AI Provider

[patelvivekdev/mixedbread-ai-provider](https://github.com/patelvivekdev/mixedbread-ai-provider) is a community provider that uses [Mixedbread](https://www.mixedbread.ai/) to provide Embedding support for the AI SDK.

## Setup

The Mixedbread provider is available in the `mixedbread-ai-provider` module. You can install it with

<Tabs items={['pnpm', 'npm', 'yarn']}>
<Tab>
<Snippet text="pnpm add mixedbread-ai-provider" dark />
</Tab>
<Tab>
<Snippet text="npm install mixedbread-ai-provider" dark />
</Tab>
<Tab>
<Snippet text="yarn add mixedbread-ai-provider" dark />
</Tab>
</Tabs>

## Provider Instance

You can import the default provider instance `mixedbread ` from `mixedbread-ai-provider`:

```ts
import { mixedbread } from 'mixedbread-ai-provider';
```

If you need a customized setup, you can import `createMixedbread` from `mixedbread-ai-provider` and create a provider instance with your settings:

```ts
import { createMixedbread } from 'mixedbread-ai-provider';

const mixedbread = createMixedbread({
baseURL: 'https://api.mixedbread.ai/v1',
apiKey: process.env.MIXEDBREAD_API_KEY,
});
```

You can use the following optional settings to customize the Mixedbread provider instance:

- **baseURL** _string_

The base URL of the Mixedbread API

- **headers** _Record&lt;string,string&gt;_

Custom headers to include in the requests.

## Embedding Models

You can create models that call the [Mixedbread embeddings API](https://www.mixedbread.ai/api-reference/endpoints/embeddings)
using the `.embedding()` factory method.

```ts
import { mixedbread } from 'mixedbread-ai-provider';

const embeddingModel = mixedbread.textEmbeddingModel(
'mixedbread-ai/mxbai-embed-large-v1',
);
```

### Model Capabilities

| Model | Default Dimensions | Context Length | Custom Dimensions |
| --------------------------------- | ------------------ | -------------- | ------------------- |
| `mxbai-embed-large-v1` | 1024 | 512 | <Check size={18} /> |
| `deepset-mxbai-embed-de-large-v1` | 1024 | 512 | <Check size={18} /> |

<Note>
The table above lists popular models. Please see the [Mixedbread
docs](https://www.mixedbread.ai/docs/embeddings/models) for a full list of
available models.
</Note>

### Add settings to the model

The settings object should contain the settings you want to add to the model.

```ts
import { mixedbread } from 'mixedbread-ai-provider';

const embeddingModel = mixedbread.textEmbeddingModel(
'mixedbread-ai/mxbai-embed-large-v1',
{
prompt: 'Generate embeddings for text', // Max 256 characters
dimensions: 512, // Max 1024 for embed-large-v1
},
);
```
97 changes: 97 additions & 0 deletions content/providers/03-community-providers/07.voyage-ai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: Voyage AI Provider
description: Learn how to use the Voyage AI provider.
---

# Voyage AI Provider

[patelvivekdev/voyage-ai-provider](https://github.com/patelvivekdev/voyageai-ai-provider) is a community provider that uses [Voyage AI](https://www.voyageai.com) to provide Embedding support for the AI SDK.

## Setup

The Voyage provider is available in the `voyage-ai-provider` module. You can install it with

<Tabs items={['pnpm', 'npm', 'yarn']}>
<Tab>
<Snippet text="pnpm add voyage-ai-provider" dark />
</Tab>
<Tab>
<Snippet text="npm install voyage-ai-provider" dark />
</Tab>
<Tab>
<Snippet text="yarn add voyage-ai-provider" dark />
</Tab>
</Tabs>

## Provider Instance

You can import the default provider instance `voyage ` from `voyage-ai-provider`:

```ts
import { voyage } from 'voyage-ai-provider';
```

If you need a customized setup, you can import `createVoyage` from `voyage-ai-provider` and create a provider instance with your settings:

```ts
import { createVoyage } from 'voyage-ai-provider';

const voyage = createVoyage({
baseURL: 'https://api.voyageai.com/v1',
apiKey: process.env.VOYAGE_API_KEY,
});
```

You can use the following optional settings to customize the Voyage provider instance:

- **baseURL** _string_

The base URL of the voyage API

- **headers** _Record&lt;string,string&gt;_

Custom headers to include in the requests.

## Embedding Models

You can create models that call the [Voyage embeddings API](https://docs.voyageai.com/reference/embeddings-api)
using the `.embedding()` factory method.

```ts
import { voyage } from 'voyage-ai-provider';

const embeddingModel = voyage.textEmbeddingModel('voyage-3');
```

You can find more models on the [Voyage Library](https://docs.voyageai.com/docs/embeddings) homepage.

### Model Capabilities

| Model | Default Dimensions | Context Length |
| ----------------------- | ------------------ | -------------- |
| `voyage-3` | 1024 | 32000 |
| `voyage-3-lite` | 512 | 32000 |
| `voyage-finance-2` | 1024 | 32000 |
| `voyage-multilingual-2` | 1024 | 32000 |
| `voyage-law-2` | 1024 | 32000 |
| `voyage-code-2` | 1024 | 16000 |
| `voyage-3-lite` | 1024 | 16000 |

<Note>
The table above lists popular models. Please see the [Voyage
docs](https://docs.voyageai.com/docs/embeddings) for a full list of available
models.
</Note>

### Add settings to the model

The settings object should contain the settings you want to add to the model.

```ts
import { voyage } from 'voyage-ai-provider';

const embeddingModel = voyage.textEmbeddingModel('voyage-3', {
inputType: 'document', // 'document' or 'query'
truncation: false,
});
```