-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (docs): add mixedbreak and voyage ai providers (#3862)
Co-authored-by: VIVEK PATEL <[email protected]>
- Loading branch information
1 parent
902b411
commit 8c541bf
Showing
8 changed files
with
200 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
content/providers/03-community-providers/05-anthropic-vertex-ai.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
content/providers/03-community-providers/11-cloudflare-workers-ai.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
content/providers/03-community-providers/60-mixedbread.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
title: Mixedbread Provider | ||
description: Learn how to use the Mixedbread provider. | ||
--- | ||
|
||
# Mixedbread 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<string,string>_ | ||
|
||
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 | ||
}, | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<string,string>_ | ||
|
||
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, | ||
}); | ||
``` |