Skip to content

An AI-powered search engine with a generative UI

feat: DeepSeek provider

Yoshiki Miura81c5a6618599
diff --git a/.env.local.example b/.env.local.example
index c4eb0e8e..2e793625 100644
--- a/.env.local.example
+++ b/.env.local.example
@@ -51,6 +51,9 @@ TAVILY_API_KEY=[YOUR_TAVILY_API_KEY] # Get your API key at: https://app.tavily.
# AZURE_RESOURCE_NAME=
# NEXT_PUBLIC_AZURE_DEPLOYMENT_NAME=
+# DeepSeek
+# DEEPSEEK_API_KEY=[YOUR_DEEPSEEK_API_KEY]
+
# OpenAI Compatible Model
# NEXT_PUBLIC_OPENAI_COMPATIBLE_MODEL=
# OPENAI_COMPATIBLE_API_KEY=
diff --git a/README.md b/README.md
index a4f60fe2..2e077f08 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,7 @@ An AI-powered search engine with a generative UI.
- Anthropic
- Ollama
- Groq
+- DeepSeek
- OpenAI Compatible
### Search Capabilities
@@ -180,6 +181,8 @@ This will allow you to use Morphic as your default search engine in the browser.
- Groq
- llama3-groq-8b-8192-tool-use-preview
- llama3-groq-70b-8192-tool-use-preview
+- DeepSeek
+ - DeepSeek v3 (Unstable)[ttps://github.com/vercel/ai/issues/4313#issuecomment-2587891644]
## ⚡ AI SDK Implementation
diff --git a/bun.lockb b/bun.lockb
index 3e0d116d..00802ea0 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/components/chat-messages.tsx b/components/chat-messages.tsx
index bf818232..39b8fec4 100644
--- a/components/chat-messages.tsx
+++ b/components/chat-messages.tsx
@@ -23,7 +23,6 @@ export function ChatMessages({
if (lastMessage?.role === 'user') {
setOpenStates({})
}
- console.log(messages)
}, [messages])
if (!messages.length) return null
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 2c79549a..b46e4981 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -153,6 +153,15 @@ AZURE_RESOURCE_NAME=[YOUR_RESOURCE_NAME]
NEXT_PUBLIC_AZURE_DEPLOYMENT_NAME=[YOUR_DEPLOYMENT_NAME]
```
+### DeepSeek
+
+Note: Deepseek function calling is currently unstable: https://github.com/vercel/ai/issues/4313#issuecomment-2587891644
+If you want to use Deepseek, remove the comment and add it to the models array: https://github.com/miurla/morphic/blob/main/lib/types/models.ts
+
+```
+# DEEPSEEK_API_KEY=[YOUR_API_KEY]
+```
+
## Other Features
### Share Feature
diff --git a/lib/types/models.ts b/lib/types/models.ts
index 261033ea..f451e006 100644
--- a/lib/types/models.ts
+++ b/lib/types/models.ts
@@ -60,6 +60,14 @@ export const models: Model[] = [
provider: 'Azure',
providerId: 'azure'
},
+ // Deepseek function calling is currently unstable: https://github.com/vercel/ai/issues/4313#issuecomment-2587891644
+ // If you want to use Deepseek, remove the comment and add it to the models array
+ // {
+ // id: 'deepseek-chat',
+ // name: 'DeepSeek v3',
+ // provider: 'DeepSeek',
+ // providerId: 'deepseek'
+ // },
{
id: process.env.NEXT_PUBLIC_OPENAI_COMPATIBLE_MODEL || 'undefined',
name: process.env.NEXT_PUBLIC_OPENAI_COMPATIBLE_MODEL || 'Undefined',
diff --git a/lib/utils/registry.ts b/lib/utils/registry.ts
index 45d827ac..bae11dbf 100644
--- a/lib/utils/registry.ts
+++ b/lib/utils/registry.ts
@@ -1,5 +1,6 @@
import { anthropic } from '@ai-sdk/anthropic'
import { createAzure } from '@ai-sdk/azure'
+import { deepseek } from '@ai-sdk/deepseek'
import { google } from '@ai-sdk/google'
import { createOpenAI, openai } from '@ai-sdk/openai'
import { experimental_createProviderRegistry as createProviderRegistry } from 'ai'
@@ -20,6 +21,7 @@ export const registry = createProviderRegistry({
apiKey: process.env.AZURE_API_KEY,
resourceName: process.env.AZURE_RESOURCE_NAME
}),
+ deepseek,
'openai-compatible': createOpenAI({
apiKey: process.env.OPENAI_COMPATIBLE_API_KEY,
baseURL: process.env.OPENAI_COMPATIBLE_API_BASE_URL
@@ -55,6 +57,8 @@ export function isProviderEnabled(providerId: string): boolean {
return !!process.env.OLLAMA_BASE_URL
case 'azure':
return !!process.env.AZURE_API_KEY && !!process.env.AZURE_RESOURCE_NAME
+ case 'deepseek':
+ return !!process.env.DEEPSEEK_API_KEY
case 'openai-compatible':
return (
!!process.env.OPENAI_COMPATIBLE_API_KEY &&
diff --git a/package.json b/package.json
index 72d8b26f..959ff79f 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,7 @@
"dependencies": {
"@ai-sdk/anthropic": "^1.1.0",
"@ai-sdk/azure": "^1.1.0",
+ "@ai-sdk/deepseek": "^0.1.0",
"@ai-sdk/google": "^1.1.0",
"@ai-sdk/openai": "^1.1.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
diff --git a/public/providers/logos/deepseek.svg b/public/providers/logos/deepseek.svg
new file mode 100644
index 00000000..dc224e43
--- /dev/null
+++ b/public/providers/logos/deepseek.svg
@@ -0,0 +1 @@
+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"></path></svg>
\ No newline at end of file