Skip to content

Fyzz-Chat/fyzz-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,246 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fyzz Chat

Chat with the best AI models, all in one place

Bring your own keys, deploy in one click, or use the hosted version.

Build Release License Docker

Deploy with Vercel Deploy to Coolify (coming soon)

Try the hosted version →


Why Fyzz Chat

  • One chat for every model. OpenAI, Anthropic, Google, xAI, Perplexity, Fireworks, Azure — and anything else the Vercel AI SDK supports.
  • Tools, MCP, and the web built in. Function calling, MCP server support, and web browsing without extra setup.
  • Self-host or hosted. One-click Vercel, the official Docker image, or AWS CloudFormation — or skip setup with the hosted plan at fyzz.chat.

OpenAI · Anthropic · Google · xAI · Perplexity · Fireworks · Azure

Quick start

Note

Fyzz Chat needs a PostgreSQL database wherever you deploy it.

Vercel

Deploy with Vercel

Docker

docker run -p 3000:3000 \
  -e BETTER_AUTH_SECRET=... \
  -e BETTER_AUTH_URL=https://your-domain.com \
  -e DATABASE_URL=postgres://... \
  -e DIRECT_DATABASE_URL=postgres://... \
  -e OPENAI_API_KEY=... \
  ghcr.io/fyzz-chat/fyzz-chat:latest

To build your own image, run bun run build:standalone and use the resulting standalone output.

Local development

bun install
cp .env.sample .env             # then fill in the values (OPENAI_API_KEY at minimum)
docker compose up -d database   # start a local Postgres on port 5433
bun db:migrate                  # apply Prisma migrations to the local DB
bun dev                         # start the dev server on http://localhost:3000

To preview transactional emails: bun run dev:email (port 3001).

Hosted version

Don't want to self-host? fyzz.chat runs the same project, fully managed — zero setup, automatic updates. Self-hosting stays free and supported; the hosted plan is just there if you'd rather not manage infrastructure.

Self-hosting

Two ways to self-host:

  • Deploy from the repository as a Next.js project.
  • Use the Docker image (a containerized version of the Next.js project).

Database

Fyzz Chat uses Prisma with PostgreSQL. Before the app can start, run the migrations (with DATABASE_URL set):

bun run db:deploy
# or
bunx prisma migrate deploy

Environment variables

Required:

  • BETTER_AUTH_SECRET — random string, at least 32 characters.
  • BETTER_AUTH_URL — public URL of your application.
  • DATABASE_URL — pooled Postgres URL.
  • DIRECT_DATABASE_URL — direct (non-pooled) Postgres URL.
  • OPENAI_API_KEY — create one here.

Authentication (optional):

  • ANONYMOUS_LOGIN — allow single-click anonymous logins.
  • AUTHORIZED_EMAIL_DOMAINS — comma-separated allow-list of email domains.
  • GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET — enable Google sign-in.

Additional model providers (optional):

  • ANTHROPIC_API_KEY — Anthropic (create)
  • XAI_API_KEY — xAI (create)
  • GOOGLE_GENERATIVE_AI_API_KEY — Google AI (create)
  • PERPLEXITY_API_KEY — Perplexity (create; you may need to create an API group first)
  • FIREWORKS_API_KEY — Fireworks (create)

Without these, the app still runs but only OpenAI models are available.

File uploads to S3 + CloudFront (optional):

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_UPLOADS_BUCKET
  • AWS_CLOUDFRONT_KEY_PAIR_ID
  • AWS_CLOUDFRONT_PRIVATE_KEY — private key with | as line breaks (deprecated).
  • AWS_CLOUDFRONT_PRIVATE_KEY_BASE64 — base64-encoded private key. Convert with cat key.pem | base64 > base64_key.pem.
  • AWS_CLOUDFRONT_DISTRIBUTION_DOMAIN — falls back to AWS_UPLOADS_BUCKET if your bucket name matches the distribution domain.

Warning

If any AWS_ variable is missing, uploads are persisted in the database instead of S3.

AWS (CloudFormation)

Two ready-made stacks live in aws/ — they create an ECS cluster with RDS PostgreSQL, an Application Load Balancer, and the necessary networking.

To visualize either template, open the AWS CloudFormation Infrastructure Composer, choose Create project → Template tab → JSON, and paste the contents.

Prerequisites — store secrets in AWS Secrets Manager:

  1. Go to Secrets Manager → Store a new secret → Other type of secret → Plaintext.
  2. Create fyzz-chat/better-auth-secret (random string, 32+ chars).
  3. Create fyzz-chat/openai-api-key with your OpenAI key.
  4. Note the ARNs — you'll pass them as stack parameters.

Deploy:

  1. CloudFormation → Create stack → With new resources (standard).
  2. Upload the chosen template, name the stack fyzz-chat.
  3. Fill in:
    • BetterAuthSecretArn — ARN from above.
    • OpenaiApiKeySecretArn — ARN from above.
    • BetterAuthUrl — your public URL (e.g. https://your-domain.com).
  4. Review and create. Stack creation takes ~10–15 minutes.

Note

Deleting the stack does not delete the database. Disable deletion protection and remove it manually if you want it gone.

Run database migrations:

  1. ECS → Clusters → your cluster → Tasks tab → Run new task.
  2. Configure: task definition family fyzz-chat-migration, launch type Fargate.
  3. Networking: VPC fyzz-chat-vpc, security group fyzz-chat-ecs-sg.
  4. Create and wait for completion.

Enable HTTPS (optional):

  1. Certificate Manager → Request a certificate for your domain.
  2. Add the DNS validation records and wait for validation.
  3. CloudFormation → your stack → Update, set the CertificateArn parameter, and complete the update.

The template auto-redirects HTTP to HTTPS once a certificate is attached.

Contributing

Install Bun:

curl -fsSL https://bun.sh/install | bash
# Windows:
powershell -c "irm bun.sh/install.ps1 | iex"

Then follow Local development above. Other package managers (npm, yarn, pnpm) work too.

Useful scripts

Script What it does
bun dev Start the dev server
bun build Build for production
bun build:standalone Build for Docker / standalone deploy
bun start Run the production build
bun db:migrate Apply Prisma migrations (development)
bun db:deploy Apply Prisma migrations (production)
bun test Run unit tests
bun test:integration Run integration tests
bun check-write Lint + format with Biome
bun type-check Type-check with TypeScript
bun dev:email Preview transactional emails (port 3001)

Stack

Next.js · Bun · Prisma · Vercel AI SDK · Better Auth · tRPC · Tailwind CSS · shadcn/ui · Biome


If Fyzz Chat is useful to you, consider starring the repo — it helps others find it.

About

Chat with the best AI models, all in one place.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors