Skip to content

aleksa-codes/next-ollama-chat

Repository files navigation

next-ollama-chat

A local AI chat application powered by Ollama, built with Next.js 16, the Vercel AI SDK, SQLite, Drizzle ORM, and shadcn/ui.

Requires Ollama running locally. Pull any model with ollama pull <model> before starting.

Chat Arena Voice
Chat Arena Voice

Features

  • Chat: multi-turn conversations with markdown and syntax-highlighted code rendering, image attachments for vision models, persistent chat history, and per-chat model selection
  • Arena: send the same prompt to two models side-by-side and compare responses in real time
  • Voice: hands-free voice call interface with low-latency TTS streaming
  • Screen share: capture the active screen when speaking to vision-capable models in voice mode
  • Dark mode: system preference detection via next-themes
  • Model capability detection: vision and thinking support are auto-detected per Ollama model
  • SQLite persistence: chat history and the selected model are stored in data/app.db through Drizzle ORM

Prerequisites

  • Ollama installed and running (ollama serve)
  • At least one model pulled, e.g. ollama pull qwen3.5 or ollama run qwen3.5
  • Node.js 20+ installed

Quick Start

git clone https://github.com/aleksa-codes/next-ollama-chat
cd next-ollama-chat
bun install
bun run dev

Open http://localhost:3000.

The SQLite database is created automatically at data/app.db on first run.

Database migrations

If you change the schema (add/remove fields or tables), generate and apply a new Drizzle migration:

bun run db:generate
bun run db:migrate

Note: The server runs bun run db:migrate automatically on startup, so you typically only need to run it manually when working on migrations.

Scripts

Command Description
bun run dev Start development server
bun run build Build for production
bun run start Run production server
bun run lint Lint with ESLint
bun run format Format with Prettier
bun run shadcn Add shadcn/ui components
bun run deps Update dependencies interactively
bun run db:generate Generate Drizzle SQL migrations
bun run db:migrate Apply generated Drizzle migrations
bun run db:studio Open Drizzle Studio

Tech Stack

License

MIT, see LICENSE for details.

About

Chat, arena, and voice interface for local Ollama models. Built with Next.js, Vercel AI SDK, and shadcn/ui.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors