Skip to content

Commit

Permalink
feat (docs): add mixedbreak and voyage ai providers (#3862)
Browse files Browse the repository at this point in the history
Co-authored-by: VIVEK PATEL <[email protected]>
  • Loading branch information
lgrammel and patelvivekdev authored Nov 25, 2024
1 parent 902b411 commit 8c541bf
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 8 deletions.
2 changes: 1 addition & 1 deletion content/providers/03-community-providers/04-chrome-ai.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Chrome AI
description: Learn how to use the Chrome built-in Language Model.
description: Learn how to use the Chrome AI provider for the AI SDK.
---

# ChromeAI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: AnthropicVertex
description: Learn how to use Anthropic Vertex.
title: Anthropic Vertex
description: Learn how to use the Anthropic Vertex provider for the AI SDK.
---

# AnthropicVertex Provider
Expand Down
4 changes: 2 additions & 2 deletions content/providers/03-community-providers/08-friendliai.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: FriendliAI
description: Learn how to use the Friendli Provider for the AI SDK.
description: Learn how to use the FriendliAI Provider for the AI SDK.
---

# Friendli Provider
# FriendliAI Provider

The [FriendliAI](https://friendli.ai/) provider supports both open-source LLMs via [Friendli Serverless Endpoints](https://friendli.ai/products/serverless-endpoints) and custom models via [Dedicated Endpoints](https://friendli.ai/products/dedicated-endpoints).

Expand Down
2 changes: 1 addition & 1 deletion content/providers/03-community-providers/10-portkey.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Portkey
description: Portkey Provider for the AI SDK
description: Learn how to use the Portkey provider for the AI SDK.
---

# Portkey Provider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Cloudflare Workers AI
description: Learn how to use the Cloudflare Workers AI provider with the AI SDK.
description: Learn how to use the Cloudflare Workers AI provider for the AI SDK.
---

# Cloudflare Workers AI
Expand Down
2 changes: 1 addition & 1 deletion content/providers/03-community-providers/21-crosshatch.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Crosshatch
description: Crosshatch Provider for the AI SDK
description: Learn how to use the Crosshatch provider for the AI SDK.
---

# Crosshatch Provider
Expand Down
95 changes: 95 additions & 0 deletions content/providers/03-community-providers/60-mixedbread.mdx
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&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/61-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,
});
```

0 comments on commit 8c541bf

Please sign in to comment.