Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/blu-school_do.json
T

1 line
15 KiB
JSON

{"repo": "blu-school/do", "files": {"docs/ai-sdk/providers/ai-sdk-providers/deepseek.md": {"4a64b9e7d20d0a5978a44a16c45bd81537d6a096": {"t": 1785747215.527826, "n": 7321, "h": "c1643099c8df2821", "c": "\n# DeepSeek Provider\n\nThe [DeepSeek](https://www.deepseek.com) provider offers access to powerful language models through the DeepSeek API.\n\nAPI keys can be obtained from the [DeepSeek Platform](https://platform.deepseek.com/api_keys).\n\n## Setup\n\nThe DeepSeek provider is available via the `@ai-sdk/deepseek` module. You can install it with:\n\n<Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>\n <Tab>\n <Snippet text=\"pnpm add @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"npm install @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"yarn add @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"bun add @ai-sdk/deepseek\" dark />\n </Tab>\n</Tabs>\n\n## Provider Instance\n\nYou can import the default provider instance `deepseek` from `@ai-sdk/deepseek`:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\n```\n\nFor custom configuration, you can import `createDeepSeek` and create a provider instance with your settings:\n\n```ts\nimport { createDeepSeek } from '@ai-sdk/deepseek';\n\nconst deepseek = createDeepSeek({\n apiKey: process.env.DEEPSEEK_API_KEY ?? '',\n});\n```\n\nYou can use the following optional settings to customize the DeepSeek provider instance:\n\n- **baseURL** _string_\n\n Use a different URL prefix for API calls.\n The default prefix is `https://api.deepseek.com`.\n\n- **apiKey** _string_\n\n API key that is being sent using the `Authorization` header. It defaults to\n the `DEEPSEEK_API_KEY` environment variable.\n\n- **headers** _Record&lt;string,string&gt;_\n\n Custom headers to include in the requests.\n\n- **fetch** _(input: RequestInfo, init?: RequestInit) => Promise&lt;Response&gt;_\n\n Custom [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) implementation.\n\n## Language Models\n\nYou can create language models using a provider instance:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst { text } = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'Write a vegetarian lasagna recipe for 4 people.',\n});\n```\n\nYou can also use the `.chat()` or `.languageModel()` factory methods:\n\n```ts\nconst model = deepseek.chat('deepseek-chat');\n// or\nconst model = deepseek.languageModel('deepseek-chat');\n```\n\nDeepSeek language models can be used in the `streamText` function\n(see [AI SDK Core](/docs/ai-sdk-core)).\n\nThe following optional provider options are available for DeepSeek models:\n\n- `thinking` _object_\n\n Optional. Controls thinking mode (chain-of-thought reasoning). You can enable thinking mode either by using the `deepseek-reasoner` model or by setting this option.\n\n - `type`: `'enabled' | 'disabled'` - Enable or disable thinking mode.\n\n```ts highlight=\"7-11\"\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst { text, reasoning } = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'How many \"r\"s are in the word \"strawberry\"?',\n providerOptions: {\n deepseek: {\n thinking: { type: 'enabled' },\n },\n },\n});\n```\n\n### Reasoning\n\nDeepSeek has reasoning support for the `deepseek-reasoner` model. The reasoning is exposed through streaming:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { streamText } from 'ai';\n\nconst result = streamText({\n model: deepseek('deepseek-reasoner'),\n prompt: 'How many \"r\"s are in the word \"strawberry\"?',\n});\n\nfor await (const part of result.fullStream) {\n if (part.type === 'reasoning') {\n // This is the reasoning text\n console.log('Reasoning:', part.text);\n } else if (part.type === 'text') {\n // This is the final answer\n console.log('Answer:', part.text);\n }\n}\n```\n\nSee [AI SDK UI: Chatbot](/docs/ai-sdk-ui/chatbot#reasoning) for more details\non how to integrate reasoning into your chatbot.\n\n### Cache Token Usage\n\nDeepSeek provides context caching on disk technology that can significantly reduce token costs for repeated content. You can access the cache hit/miss metrics through the `providerMetadata` property in the response:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst result = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'Your prompt here',\n});\n\nconsole.log(result.providerMetadata);\n// Example output: { deepseek: { promptCacheHitTokens: 1856, promptCacheMissTokens: 5 } }\n```\n\nThe metrics include:\n\n- `promptCacheHitTokens`: Number of input tokens that were cached\n- `promptCacheMissTokens`: Number of input tokens that were not cached\n\n<Note>\n For more details about DeepSeek's caching system, see the [DeepSeek caching\n documentation](https://api-docs.deepseek.com/guides/kv_cache#checking-cache-hit-status).\n</Note>\n\n## Model Capabilities\n\n| Model | Text Generation | Object Generation | Image Input | Tool Usage | Tool Streaming |\n| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |\n| `deepseek-chat` | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |\n| `deepseek-reasoner` | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |\n\n<Note>\n Please see the [DeepSeek\n docs](https://api-docs.deepseek.com/quick_start/pricing) for a full list of\n available models. You can also pass any available provider model ID as a\n string if needed.\n</Note>\n\n\n## Navigation\n\n- [AI Gateway](/providers/ai-sdk-providers/ai-gateway)\n- [xAI Grok](/providers/ai-sdk-providers/xai)\n- [Vercel](/providers/ai-sdk-providers/vercel)\n- [OpenAI](/providers/ai-sdk-providers/openai)\n- [Azure OpenAI](/providers/ai-sdk-providers/azure)\n- [Anthropic](/providers/ai-sdk-providers/anthropic)\n- [Open Responses](/providers/ai-sdk-providers/open-responses)\n- [Amazon Bedrock](/providers/ai-sdk-providers/amazon-bedrock)\n- [Groq](/providers/ai-sdk-providers/groq)\n- [Fal](/providers/ai-sdk-providers/fal)\n- [AssemblyAI](/providers/ai-sdk-providers/assemblyai)\n- [DeepInfra](/providers/ai-sdk-providers/deepinfra)\n- [Deepgram](/providers/ai-sdk-providers/deepgram)\n- [Black Forest Labs](/providers/ai-sdk-providers/black-forest-labs)\n- [Gladia](/providers/ai-sdk-providers/gladia)\n- [LMNT](/providers/ai-sdk-providers/lmnt)\n- [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai)\n- [Hume](/providers/ai-sdk-providers/hume)\n- [Google Vertex AI](/providers/ai-sdk-providers/google-vertex)\n- [Rev.ai](/providers/ai-sdk-providers/revai)\n- [Baseten](/providers/ai-sdk-providers/baseten)\n- [Hugging Face](/providers/ai-sdk-providers/huggingface)\n- [Mistral AI](/providers/ai-sdk-providers/mistral)\n- [Together.ai](/providers/ai-sdk-providers/togetherai)\n- [Cohere](/providers/ai-sdk-providers/cohere)\n- [Fireworks](/providers/ai-sdk-providers/fireworks)\n- [DeepSeek](/providers/ai-sdk-providers/deepseek)\n- [Moonshot AI](/providers/ai-sdk-providers/moonshotai)\n- [Alibaba](/providers/ai-sdk-providers/alibaba)\n- [Cerebras](/providers/ai-sdk-providers/cerebras)\n- [Replicate](/providers/ai-sdk-providers/replicate)\n- [Prodia](/providers/ai-sdk-providers/prodia)\n- [Perplexity](/providers/ai-sdk-providers/perplexity)\n- [Luma](/providers/ai-sdk-providers/luma)\n- [ElevenLabs](/providers/ai-sdk-providers/elevenlabs)\n\n\n[Full Sitemap](/sitemap.md)\n"}, "fcc3e65943e22a164fd3823e4a5f48c50ae5665f": {"t": 1785771428.554117, "n": 7321, "h": "c1643099c8df2821", "c": "\n# DeepSeek Provider\n\nThe [DeepSeek](https://www.deepseek.com) provider offers access to powerful language models through the DeepSeek API.\n\nAPI keys can be obtained from the [DeepSeek Platform](https://platform.deepseek.com/api_keys).\n\n## Setup\n\nThe DeepSeek provider is available via the `@ai-sdk/deepseek` module. You can install it with:\n\n<Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>\n <Tab>\n <Snippet text=\"pnpm add @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"npm install @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"yarn add @ai-sdk/deepseek\" dark />\n </Tab>\n <Tab>\n <Snippet text=\"bun add @ai-sdk/deepseek\" dark />\n </Tab>\n</Tabs>\n\n## Provider Instance\n\nYou can import the default provider instance `deepseek` from `@ai-sdk/deepseek`:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\n```\n\nFor custom configuration, you can import `createDeepSeek` and create a provider instance with your settings:\n\n```ts\nimport { createDeepSeek } from '@ai-sdk/deepseek';\n\nconst deepseek = createDeepSeek({\n apiKey: process.env.DEEPSEEK_API_KEY ?? '',\n});\n```\n\nYou can use the following optional settings to customize the DeepSeek provider instance:\n\n- **baseURL** _string_\n\n Use a different URL prefix for API calls.\n The default prefix is `https://api.deepseek.com`.\n\n- **apiKey** _string_\n\n API key that is being sent using the `Authorization` header. It defaults to\n the `DEEPSEEK_API_KEY` environment variable.\n\n- **headers** _Record&lt;string,string&gt;_\n\n Custom headers to include in the requests.\n\n- **fetch** _(input: RequestInfo, init?: RequestInit) => Promise&lt;Response&gt;_\n\n Custom [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) implementation.\n\n## Language Models\n\nYou can create language models using a provider instance:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst { text } = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'Write a vegetarian lasagna recipe for 4 people.',\n});\n```\n\nYou can also use the `.chat()` or `.languageModel()` factory methods:\n\n```ts\nconst model = deepseek.chat('deepseek-chat');\n// or\nconst model = deepseek.languageModel('deepseek-chat');\n```\n\nDeepSeek language models can be used in the `streamText` function\n(see [AI SDK Core](/docs/ai-sdk-core)).\n\nThe following optional provider options are available for DeepSeek models:\n\n- `thinking` _object_\n\n Optional. Controls thinking mode (chain-of-thought reasoning). You can enable thinking mode either by using the `deepseek-reasoner` model or by setting this option.\n\n - `type`: `'enabled' | 'disabled'` - Enable or disable thinking mode.\n\n```ts highlight=\"7-11\"\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst { text, reasoning } = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'How many \"r\"s are in the word \"strawberry\"?',\n providerOptions: {\n deepseek: {\n thinking: { type: 'enabled' },\n },\n },\n});\n```\n\n### Reasoning\n\nDeepSeek has reasoning support for the `deepseek-reasoner` model. The reasoning is exposed through streaming:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { streamText } from 'ai';\n\nconst result = streamText({\n model: deepseek('deepseek-reasoner'),\n prompt: 'How many \"r\"s are in the word \"strawberry\"?',\n});\n\nfor await (const part of result.fullStream) {\n if (part.type === 'reasoning') {\n // This is the reasoning text\n console.log('Reasoning:', part.text);\n } else if (part.type === 'text') {\n // This is the final answer\n console.log('Answer:', part.text);\n }\n}\n```\n\nSee [AI SDK UI: Chatbot](/docs/ai-sdk-ui/chatbot#reasoning) for more details\non how to integrate reasoning into your chatbot.\n\n### Cache Token Usage\n\nDeepSeek provides context caching on disk technology that can significantly reduce token costs for repeated content. You can access the cache hit/miss metrics through the `providerMetadata` property in the response:\n\n```ts\nimport { deepseek } from '@ai-sdk/deepseek';\nimport { generateText } from 'ai';\n\nconst result = await generateText({\n model: deepseek('deepseek-chat'),\n prompt: 'Your prompt here',\n});\n\nconsole.log(result.providerMetadata);\n// Example output: { deepseek: { promptCacheHitTokens: 1856, promptCacheMissTokens: 5 } }\n```\n\nThe metrics include:\n\n- `promptCacheHitTokens`: Number of input tokens that were cached\n- `promptCacheMissTokens`: Number of input tokens that were not cached\n\n<Note>\n For more details about DeepSeek's caching system, see the [DeepSeek caching\n documentation](https://api-docs.deepseek.com/guides/kv_cache#checking-cache-hit-status).\n</Note>\n\n## Model Capabilities\n\n| Model | Text Generation | Object Generation | Image Input | Tool Usage | Tool Streaming |\n| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |\n| `deepseek-chat` | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |\n| `deepseek-reasoner` | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> |\n\n<Note>\n Please see the [DeepSeek\n docs](https://api-docs.deepseek.com/quick_start/pricing) for a full list of\n available models. You can also pass any available provider model ID as a\n string if needed.\n</Note>\n\n\n## Navigation\n\n- [AI Gateway](/providers/ai-sdk-providers/ai-gateway)\n- [xAI Grok](/providers/ai-sdk-providers/xai)\n- [Vercel](/providers/ai-sdk-providers/vercel)\n- [OpenAI](/providers/ai-sdk-providers/openai)\n- [Azure OpenAI](/providers/ai-sdk-providers/azure)\n- [Anthropic](/providers/ai-sdk-providers/anthropic)\n- [Open Responses](/providers/ai-sdk-providers/open-responses)\n- [Amazon Bedrock](/providers/ai-sdk-providers/amazon-bedrock)\n- [Groq](/providers/ai-sdk-providers/groq)\n- [Fal](/providers/ai-sdk-providers/fal)\n- [AssemblyAI](/providers/ai-sdk-providers/assemblyai)\n- [DeepInfra](/providers/ai-sdk-providers/deepinfra)\n- [Deepgram](/providers/ai-sdk-providers/deepgram)\n- [Black Forest Labs](/providers/ai-sdk-providers/black-forest-labs)\n- [Gladia](/providers/ai-sdk-providers/gladia)\n- [LMNT](/providers/ai-sdk-providers/lmnt)\n- [Google Generative AI](/providers/ai-sdk-providers/google-generative-ai)\n- [Hume](/providers/ai-sdk-providers/hume)\n- [Google Vertex AI](/providers/ai-sdk-providers/google-vertex)\n- [Rev.ai](/providers/ai-sdk-providers/revai)\n- [Baseten](/providers/ai-sdk-providers/baseten)\n- [Hugging Face](/providers/ai-sdk-providers/huggingface)\n- [Mistral AI](/providers/ai-sdk-providers/mistral)\n- [Together.ai](/providers/ai-sdk-providers/togetherai)\n- [Cohere](/providers/ai-sdk-providers/cohere)\n- [Fireworks](/providers/ai-sdk-providers/fireworks)\n- [DeepSeek](/providers/ai-sdk-providers/deepseek)\n- [Moonshot AI](/providers/ai-sdk-providers/moonshotai)\n- [Alibaba](/providers/ai-sdk-providers/alibaba)\n- [Cerebras](/providers/ai-sdk-providers/cerebras)\n- [Replicate](/providers/ai-sdk-providers/replicate)\n- [Prodia](/providers/ai-sdk-providers/prodia)\n- [Perplexity](/providers/ai-sdk-providers/perplexity)\n- [Luma](/providers/ai-sdk-providers/luma)\n- [ElevenLabs](/providers/ai-sdk-providers/elevenlabs)\n\n\n[Full Sitemap](/sitemap.md)\n"}}}}