Skip to content

Commit 235b0ed

Browse files
feat: use xai image model and update deploy link (#882)
1 parent 7811c0f commit 235b0ed

File tree

7 files changed

+71
-127
lines changed

7 files changed

+71
-127
lines changed

.env.example

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
# Get your xAI API Key here for chat models: https://console.x.ai/
2-
XAI_API_KEY=****
3-
4-
# Get your Groq API Key here for reasoning models: https://console.groq.com/keys
5-
GROQ_API_KEY=****
6-
7-
# Get your Fal AI API Key here for image models: https://docs.fal.ai/authentication/key-based
8-
FAL_API_KEY=****
9-
101
# Generate a random secret: https://generate-secret.vercel.app/32 or `openssl rand -base64 32`
112
AUTH_SECRET=****
123

134
# The following keys below are automatically created and
145
# added to your environment when you deploy on vercel
156

7+
# Get your xAI API Key here for chat and image models: https://console.x.ai/
8+
XAI_API_KEY=****
9+
10+
# Get your Groq API Key here for reasoning models: https://console.groq.com/keys
11+
GROQ_API_KEY=****
12+
1613
# Instructions to create a Vercel Blob Store here: https://vercel.com/docs/storage/vercel-blob
1714
BLOB_READ_WRITE_TOKEN=****
1815

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This template ships with [xAI](https://x.ai) `grok-2-1212` as the default chat m
4141

4242
You can deploy your own version of the Next.js AI Chatbot to Vercel with one click:
4343

44-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET&envDescription=Learn%20more%20about%20how%20to%20get%20the%20API%20Keys%20for%20the%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot%2Fblob%2Fmain%2F.env.example&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel.&demo-url=https%3A%2F%2Fchat.vercel.ai&stores=[{%22type%22:%22postgres%22},{%22type%22:%22blob%22}]&integration-ids=oac_g1tOx3546WuLOQ4QeyAX1n1P,oac_G6x10PjgSxUUTu6Pi25ZAtbp,oac_GzhR3rwEIUyQEpKEsmAiEjfi)
44+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET&envDescription=Generate%20a%20random%20secret%20to%20use%20for%20authentication&envLink=https%3A%2F%2Fgenerate-secret.vercel.app%2F32&project-name=my-awesome-chatbot&repository-name=my-awesome-chatbot&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel&demo-url=https%3A%2F%2Fchat.vercel.ai&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22ai%22%2C%22productSlug%22%3A%22grok%22%2C%22integrationSlug%22%3A%22xai%22%7D%2C%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22ai%22%2C%22productSlug%22%3A%22api-key%22%2C%22integrationSlug%22%3A%22groq%22%7D%2C%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22neon%22%2C%22integrationSlug%22%3A%22neon%22%7D%2C%7B%22type%22%3A%22blob%22%7D%5D)
4545

4646
## Running locally
4747

components/chat-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function PureChatHeader({
7272
asChild
7373
>
7474
<Link
75-
href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET,OPENAI_API_KEY,XAI_API_KEY,FIREWORKS_API_KEY&envDescription=Learn%20more%20about%20how%20to%20get%20the%20API%20Keys%20for%20the%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot%2Fblob%2Fmain%2F.env.example&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel.&demo-url=https%3A%2F%2Fchat.vercel.ai&stores=%5B%7B%22type%22:%22postgres%22%7D,%7B%22type%22:%22blob%22%7D%5D"
75+
href={`https://vercel.com/new/clone?repository-url=https://github.com/vercel/ai-chatbot&env=AUTH_SECRET&envDescription=Learn more about how to get the API Keys for the application&envLink=https://github.com/vercel/ai-chatbot/blob/main/.env.example&demo-title=AI Chatbot&demo-description=An Open-Source AI Chatbot Template Built With Next.js and the AI SDK by Vercel.&demo-url=https://chat.vercel.ai&products=[{"type":"integration","protocol":"ai","productSlug":"grok","integrationSlug":"xai"},{"type":"integration","protocol":"ai","productSlug":"api-key","integrationSlug":"groq"},{"type":"integration","protocol":"storage","productSlug":"neon","integrationSlug":"neon"},{"type":"blob"}]`}
7676
target="_noblank"
7777
>
7878
<VercelIcon size={16} />

docs/01-quick-start.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Deploying to [Vercel](https://vercel.com) is the quickest way to get started wit
1515

1616
### Deploy to Vercel
1717

18-
To deploy the chatbot template to Vercel, click this [link](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET,OPENAI_API_KEY,XAI_API_KEY,FIREWORKS_API_KEY&envDescription=Learn%20more%20about%20how%20to%20get%20the%20API%20Keys%20for%20the%20application&envLink=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot%2Fblob%2Fmain%2F.env.example&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel.&demo-url=https%3A%2F%2Fchat.vercel.ai&stores=%5B%7B%22type%22:%22postgres%22%7D,%7B%22type%22:%22blob%22%7D%5D) to enter the 1-click deploy flow.
18+
To deploy the chatbot template to Vercel, click the button below to enter the 1-click deploy flow.
19+
20+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fai-chatbot&env=AUTH_SECRET&envDescription=Generate%20a%20random%20secret%20to%20use%20for%20authentication&envLink=https%3A%2F%2Fgenerate-secret.vercel.app%2F32&project-name=my-awesome-chatbot&repository-name=my-awesome-chatbot&demo-title=AI%20Chatbot&demo-description=An%20Open-Source%20AI%20Chatbot%20Template%20Built%20With%20Next.js%20and%20the%20AI%20SDK%20by%20Vercel&demo-url=https%3A%2F%2Fchat.vercel.ai&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22ai%22%2C%22productSlug%22%3A%22grok%22%2C%22integrationSlug%22%3A%22xai%22%7D%2C%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22ai%22%2C%22productSlug%22%3A%22api-key%22%2C%22integrationSlug%22%3A%22groq%22%7D%2C%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22neon%22%2C%22integrationSlug%22%3A%22neon%22%7D%2C%7B%22type%22%3A%22blob%22%7D%5D)
1921

2022
During the flow, you will be prompted to create and connect to a postgres database and blob store. You will also need to provide environment variables for the application.
2123

lib/ai/providers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
} from 'ai';
66
import { groq } from '@ai-sdk/groq';
77
import { xai } from '@ai-sdk/xai';
8-
import { fal } from '@ai-sdk/fal';
98
import { isTestEnvironment } from '../constants';
109
import {
1110
artifactModel,
@@ -34,6 +33,6 @@ export const myProvider = isTestEnvironment
3433
'artifact-model': xai('grok-2-1212'),
3534
},
3635
imageModels: {
37-
'small-model': fal.image('fal-ai/fast-sdxl'),
36+
'small-model': xai.image('grok-2-image'),
3837
},
3938
});

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
"test": "export PLAYWRIGHT=True && pnpm exec playwright test --workers=4"
2020
},
2121
"dependencies": {
22-
"@ai-sdk/fal": "^0.0.11",
23-
"@ai-sdk/groq": "^1.1.16",
24-
"@ai-sdk/react": "^1.1.25",
25-
"@ai-sdk/xai": "^1.1.15",
22+
"@ai-sdk/groq": "^1.2.0",
23+
"@ai-sdk/react": "^1.2.0",
24+
"@ai-sdk/xai": "^1.2.1",
2625
"@codemirror/lang-javascript": "^6.2.2",
2726
"@codemirror/lang-python": "^6.1.6",
2827
"@codemirror/state": "^6.5.0",
@@ -41,7 +40,7 @@
4140
"@vercel/analytics": "^1.3.1",
4241
"@vercel/blob": "^0.24.1",
4342
"@vercel/postgres": "^0.10.0",
44-
"ai": "4.1.66",
43+
"ai": "4.2.0",
4544
"bcrypt-ts": "^5.0.2",
4645
"class-variance-authority": "^0.7.0",
4746
"classnames": "^2.5.1",

pnpm-lock.yaml

Lines changed: 55 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)