Stripped from vercel/chatbot (Apache 2.0): - Dropped @vercel/* packages and AI Gateway - Removed artifacts feature (code/text/sheet/image side panel) - Switched AI provider to @ai-sdk/openai-compatible -> EGBE LiteLLM - Replaced Vercel Blob upload with data URLs - Dropped Redis resumable streams and rate limiter (in-memory now) - Added Dockerfile (Next.js standalone) + entrypoint that runs migrations - Wired DATABASE_URL, EGBE_AI_API_URL/KEY, NEXT_PUBLIC_BASE_URL for app-deploy.sh
57 lines
1.6 KiB
Markdown
57 lines
1.6 KiB
Markdown
# EGBE Chatbot Template
|
|
|
|
Next.js chatbot wired to the EGBE LiteLLM proxy. Based on [vercel/chatbot](https://github.com/vercel/chatbot) (Apache 2.0), stripped of Vercel-specific bits and rewired for our infra.
|
|
|
|
## Stack
|
|
|
|
- **Next.js 16** (App Router, standalone output)
|
|
- **AI SDK** + `@ai-sdk/openai-compatible` → routes to `EGBE_AI_API_URL` (our LiteLLM)
|
|
- **NextAuth** (credentials + guest)
|
|
- **Drizzle ORM** + Postgres (DB gateway)
|
|
- **shadcn/ui** + Tailwind
|
|
|
|
## Available models (via LiteLLM)
|
|
|
|
`claude-sonnet`, `claude-haiku`, `gpt-5.4`, `gpt-5.4-mini`, `kimi-k2.6`, `minimax-m2.7`, `qwen3-coder`.
|
|
|
|
Edit `lib/ai/models.ts` to add or remove.
|
|
|
|
## Deploy (from inside an OpenClaw instance)
|
|
|
|
```bash
|
|
${SKILLS_DIR}/scripts/app-deploy.sh <slug> chatbot-template
|
|
```
|
|
|
|
`app-deploy.sh` auto-injects:
|
|
- `DATABASE_URL` (per-app Postgres)
|
|
- `EGBE_AI_API_URL`, `EGBE_AI_API_KEY` (instance LiteLLM key)
|
|
- `NEXT_PUBLIC_BASE_URL` (the deployed `*.p.egbe.app` host)
|
|
|
|
You also need `AUTH_SECRET` — set it via `APP_ENV_JSON`:
|
|
|
|
```bash
|
|
APP_ENV_JSON='{"AUTH_SECRET":"'$(openssl rand -base64 32)'"}' \
|
|
${SKILLS_DIR}/scripts/app-deploy.sh mychat chatbot-template
|
|
```
|
|
|
|
## Local dev
|
|
|
|
```bash
|
|
cp .env.example .env.local
|
|
# fill in DATABASE_URL, EGBE_AI_API_KEY, AUTH_SECRET
|
|
pnpm install
|
|
pnpm db:migrate
|
|
pnpm dev
|
|
```
|
|
|
|
## Tracking upstream
|
|
|
|
Pull new vercel/chatbot features manually — `origin/upstream` is not configured by default here. Add it back with:
|
|
|
|
```bash
|
|
git remote add upstream https://github.com/vercel/chatbot.git
|
|
```
|
|
|
|
## License
|
|
|
|
Apache 2.0 — see `LICENSE`. Derivative work of Vercel, Inc.'s [chatbot](https://github.com/vercel/chatbot).
|