Skip to content

Commit

Permalink
docs: add together to deepseek guide as provider option
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalbanese committed Feb 5, 2025
1 parent 39af38f commit ee6c7a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions content/docs/02-guides/04-r1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ You can use DeepSeek R1 with the AI SDK through various providers. Here's a comp
| [Fireworks](/providers/ai-sdk-providers/fireworks) | [`accounts/fireworks/models/deepseek-r1`](https://fireworks.ai/models/fireworks/deepseek-r1) | Requires Middleware |
| [Groq](/providers/ai-sdk-providers/groq) | [`deepseek-r1-distill-llama-70b`](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-70B) | Requires Middleware |
| [Azure](/providers/ai-sdk-providers/azure) | [`DeepSeek-R1`](https://ai.azure.com/explore/models/DeepSeek-R1/version/1/registry/azureml-deepseek#code-samples) | Requires Middleware |
| [Together AI](/providers/ai-sdk-providers/togetherai) | [`deepseek-ai/DeepSeek-R1`](https://www.together.ai/models/deepseek-r1) | Requires Middleware |

### Building Interactive Interfaces

Expand Down
18 changes: 18 additions & 0 deletions content/providers/01-ai-sdk-providers/24-togetherai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ You can create [Together.ai models](https://docs.together.ai/docs/serverless-mod
const model = togetherai('google/gemma-2-9b-it');
```


### Reasoning Models

Together exposes the thinking of `deepseek-ai/DeepSeek-R1` in the generated text using the `<think>` tag.
You can use the `extractReasoningMiddleware` to extract this reasoning and expose it as a `reasoning` property on the result:

```ts
import { togetherai } from '@ai-sdk/togetherai';
import { wrapLanguageModel, extractReasoningMiddleware } from 'ai';

const enhancedModel = wrapLanguageModel({
model: togetherai('deepseek-ai/DeepSeek-R1'),
middleware: extractReasoningMiddleware({ tagName: 'think' }),
});
```

You can then use that enhanced model in functions like `generateText` and `streamText`.

### Example

You can use Together.ai language models to generate text with the `generateText` function:
Expand Down

0 comments on commit ee6c7a6

Please sign in to comment.