You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://hub.nuxt.com/new?repo=nuxt-ui-pro/chat)
Full-featured AI Chatbot Nuxt application with authentication, chat history, multiple pages, collapsible sidebar, keyboard shortcuts, light & dark mode, command palette and more. Built using [Nuxt UI Pro](https://ui.nuxt.com/pro) components and integrated with [Workers AI](https://ai.cloudflare.com) for a complete chat experience.
5
+
Full-featured AI Chatbot Nuxt application with authentication, chat history, multiple pages, collapsible sidebar, keyboard shortcuts, light & dark mode, command palette and more. Built using [Nuxt UI](https://ui.nuxt.com) components and integrated with [AI SDK v5](https://sdk.vercel.ai) for a complete chat experience.
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fnuxt-ui-templates%2Fchat&env=NUXT_SESSION_PASSWORD,NUXT_OAUTH_GITHUB_CLIENT_ID,NUXT_OAUTH_GITHUB_CLIENT_SECRET,DATABASE_URL&demo-url=https%3A%2F%2Fchat-template.nuxt.dev%2F)
35
+
33
36
## Setup
34
37
35
38
Make sure to install the dependencies:
@@ -38,20 +41,29 @@ Make sure to install the dependencies:
38
41
pnpm install
39
42
```
40
43
41
-
Next, link a NuxtHub project (even if not deployed) to access AI models in development:
44
+
Set up your environment variables by creating a `.env` file:
> It works with free Cloudflare and NuxtHub accounts.
59
+
> With [Vercel AI Gateway](https://vercel.com/docs/ai-gateway), you don't need individual API keys for OpenAI, Anthropic, etc. The AI Gateway provides a unified API to access hundreds of models through a single endpoint with automatic load balancing, fallbacks, and spend monitoring.
49
60
50
-
To add authentication with GitHub, you need to [create a GitHub OAuth application](https://github.com/settings/applications/new) and then fill the credentials in your `.env`:
61
+
To add authentication with GitHub, you need to [create a GitHub OAuth application](https://github.com/settings/applications/new).
@@ -70,25 +82,45 @@ Build the application for production:
70
82
pnpm build
71
83
```
72
84
73
-
> [!IMPORTANT]
74
-
> Make sure to add your [Nuxt UI Pro License](https://ui.nuxt.com/getting-started/license) in order to build for production
75
-
76
85
Locally preview production build:
77
86
78
87
```bash
79
88
pnpm preview
80
89
```
81
90
82
-
Deploy to your Cloudflare account with zero configuration:
91
+
Deploy to Vercel:
83
92
84
93
```bash
85
-
npx nuxthub deploy
94
+
npx vercel
86
95
```
87
96
97
+
Or connect your repository to Vercel for automatic deployments:
98
+
99
+
1. Push your code to GitHub
100
+
2. Connect your repository to [Vercel](https://vercel.com)
101
+
3. Configure your environment variables in the Vercel dashboard
102
+
4. Deploy automatically on every push
103
+
88
104
> [!NOTE]
89
-
> NuxtHub will automatically spawn a D1 database and apply the database migrations when deploying your project.
105
+
> Make sure to configure your PostgreSQL database connection and run migrations in your production environment.
106
+
107
+
The application is configured to use [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) which provides:
108
+
109
+
-**Unified API**: Access hundreds of AI models through a single endpoint
110
+
-**High Reliability**: Automatic retries and fallbacks between providers
111
+
-**Spend Monitoring**: Track usage and set budgets across all providers
112
+
-**Load Balancing**: Distribute requests for optimal performance
113
+
114
+
Simply configure your `AI_GATEWAY_API_KEY` in your Vercel environment variables for production use.
115
+
116
+
## AI Gateway Setup
117
+
118
+
1. Create a Vercel account at [vercel.com](https://vercel.com)
119
+
2. Navigate to your [AI Gateway settings](https://vercel.com/dashboard/ai-gateway)
120
+
3. Generate an API key for your project
121
+
4. Add the key to your environment variables as `AI_GATEWAY_API_KEY`
90
122
91
-
Optionally, you can create a [Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/) to have usage analytics and the ability to cache response to reduce costs. Once created, you can add the `NUXT_CLOUDFLARE_GATEWAY_ID` environment variable with the named of your gateway.
123
+
The AI Gateway automatically handles authentication with all supported AI providers including OpenAI, Anthropic, Google, xAI, and many others.
0 commit comments