Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Google AI Studio (aistudio.google.com)
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key

# Vercel AI Gateway (optional/required depending on Vercel AI Gateway authentication settings)
AI_GATEWAY_API_KEY=your_vercel_ai_gateway_key

# Upstash Console (console.upstash.com)
UPSTASH_REDIS_REST_URL=https://your-instance.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_token
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,25 @@
[![](https://sonarcloud.io/api/project_badges/measure?project=amrabed.github.io&metric=alert_status&organization=amr-abed)](https://sonarcloud.io/project/overview?id=amrabed.github.io)
[![GitHub issues](https://img.shields.io/github/issues/amrabed/amrabed.github.io.svg)](https://github.com/amrabed/amrabed.github.io/issues)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change

## Vercel AI Gateway & Environment Setup

The AI assistant uses **assistant-ui** on the frontend and connects to **Vercel AI Gateway** on the backend using the `@ai-sdk/google` provider / Vercel AI SDK (`gateway("google/gemini-2.0-flash")`).

### Vercel Dashboard Configuration

To enable and configure Vercel AI Gateway for your deployment:

1. **Enable AI Gateway in Vercel:**
- Go to your project settings in the [Vercel Dashboard](https://vercel.com/dashboard).
- Navigate to the **AI** section or **AI Gateway** settings tab.
- Enable **AI Gateway** for your project.

2. **Configure API Keys & Environment Variables:**
- Navigate to **Settings** > **Environment Variables** in your Vercel project dashboard.
- Add `GOOGLE_GENERATIVE_AI_API_KEY`: Set this to your Google AI Studio API key (from [aistudio.google.com](https://aistudio.google.com)).
- Add `AI_GATEWAY_API_KEY` (if using OIDC authentication / custom gateway credentials for Vercel AI Gateway).
- Add `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` for rate limiting (from [console.upstash.com](https://console.upstash.com)).

3. **Deploy / Redeploy:**
- Redeploy the project so Vercel injects the environment variables and enables AI Gateway routing for `/api/chat`.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"dependencies": {
"@ai-sdk/google": "^3.0.83",
"@ai-sdk/react": "^3.0.210",
"@assistant-ui/react": "^0.15.17",
"@assistant-ui/react-ai-sdk": "^1.4.8",
"@heroicons/react": "^2.2.0",
"@heroui/react": "^3.2.1",
"@heroui/styles": "^3.2.1",
Expand Down
Loading
Loading