diff --git a/README.md b/README.md index f90be20a312e..ad93ed3ce3ec 120000 --- a/README.md +++ b/README.md @@ -1 +1 @@ -packages/ai/README.md \ No newline at end of file +packages/ai/README.md diff --git a/content/providers/03-community-providers/06-mixedbread-ai.mdx b/content/providers/03-community-providers/06-mixedbread-ai.mdx new file mode 100644 index 000000000000..49254e6e99a4 --- /dev/null +++ b/content/providers/03-community-providers/06-mixedbread-ai.mdx @@ -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 + + + + + + + + + + + + + +## 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 | | +| `deepset-mxbai-embed-de-large-v1` | 1024 | 512 | | + + + 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. + + +### 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 + }, +); +``` diff --git a/content/providers/03-community-providers/07.voyage-ai.mdx b/content/providers/03-community-providers/07.voyage-ai.mdx new file mode 100644 index 000000000000..cb0d1275e7f2 --- /dev/null +++ b/content/providers/03-community-providers/07.voyage-ai.mdx @@ -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 + + + + + + + + + + + + + +## 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 | + + + The table above lists popular models. Please see the [Voyage + docs](https://docs.voyageai.com/docs/embeddings) for a full list of available + models. + + +### 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, +}); +```