chatbot-template/README.md

58 lines
1.6 KiB
Markdown
Raw Normal View History

# 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).