# chat-demo (deepseek-ai/chat-demo)

> A static chat demo app for the DeepSeek API that runs in the browser, with no backend of its own.

- GitHub: https://github.com/deepseek-ai/chat-demo
- GitHub.Locker page: https://github.locker/deepseek-ai/chat-demo
- Stars: 4.5K
- Language: TypeScript
- License: MIT
- Last push: 2026-11-13

## Questions and answers

Written by GitHub.Locker from the README and the repository; check the README below for details.

**Do I need to run my own server for it?**

No. The browser connects directly to the API service you configure, so there is no application server to host. You can use it online, open a downloaded archive, or deploy the built static files.

**How do I get it running?**

Either download the archive from Releases, extract it and double-click index.html, which needs no install or build. Or install Node.js 22.12+ and pnpm, run pnpm build, and deploy the output in dist/ to a static web server.

**What do I need before my first chat?**

A DeepSeek API key, entered in Settings before the first chat. Building from source additionally needs Node.js 22.12+ and pnpm.

**Will any API endpoint work with it?**

Not necessarily. Chat uses 'deepseek-flash' by default through Anthropic-compatible Messages and Files APIs, and search, link reading, titles and speech need the configured service to support those extensions.

**Is my chat data kept on my device?**

Your API key, settings and chats stay in this browser's localStorage and IndexedDB. However, sending messages, uploading attachments or using speech features sends that content to the API service you configured.

**Does it render Markdown, math and diagrams?**

Yes. Replies support Markdown with syntax highlighting, KaTeX math and Mermaid diagrams.

**Can it search the web and read links?**

Yes, if the configured service supports it. Replies can use smart search and link reading and show source citations, and you can stop generation at any time.

**Is there a Chinese interface?**

Yes. The interface is available in Simplified Chinese and English, with light and dark themes and mobile layouts.


---

## README (checked against GitHub 2026-11-18)

Source: https://github.com/deepseek-ai/chat-demo/blob/main/README.md

# chat-demo

English | [简体中文](README.zh-CN.md)

A static chat demo powered by the DeepSeek API. No application backend is required: the browser connects directly to the configured API service.

You can [try the app online](https://deepseek-ai.github.io/chat-demo/) or download the archive from [Releases](https://github.com/deepseek-ai/deepseek-chat-demo/releases), extract it, and double-click `index.html` to use it locally without installation or a build. Enter your API key in Settings before your first chat.

## Getting started

Install Node.js 22.12+ and pnpm, then run:

```sh
git clone https://github.com/deepseek-ai/chat-demo.git
cd chat-demo
pnpm install
pnpm dev
```

Open http://localhost:8090.

To build the static site:

```sh
pnpm build
```

The output is written to `dist/`. Deploy it to a static web server or open `dist/index.html` directly. Opening the file directly requires browser support for storage on `file://` pages and an API service that permits their cross-origin requests.

## Features

- Multiple conversations with automatic titles, renaming, and deletion; edit prompts, regenerate replies, and switch between message branches.
- Streaming replies, deep thinking, smart search, link reading, and source citations; stop generation or continue eligible replies.
- Upload, paste, or drag and drop attachments; use voice input and read replies aloud. A live audio spectrum appears in the first row of the input area while recording on mobile.
- Markdown, syntax highlighting, KaTeX math, and Mermaid diagrams.
- Simplified Chinese and English, light and dark themes, mobile layouts, location settings, and chat history import and export.

## Data and storage

Your API key and settings are stored in the browser's localStorage. Conversations and original attachments are stored in IndexedDB. Local data is isolated by browser profile and site origin. Sending messages, uploading attachments, and using speech features sends the relevant content to the configured API service.

History import and export in Settings use ZIP archives. After confirmation and successful validation, importing replaces all local conversations and attachments. Exports include conversations and locally available original images, but exclude API keys, settings, and original non-image attachments. See the [history import/export documentation (Chinese)](src/services/chat/history/README.md) for the archive format and preservation details.

Settings → Data → Delete all chats clears all local conversations, original attachments, and unsent drafts after confirmation. It stops ongoing replies and returns to a new chat. Your API key and settings are preserved; files already uploaded to the API service are not deleted.

## Development

| Command       | Description                  |
| ------------- | ---------------------------- |
| `pnpm dev`    | Start the development server |
| `pnpm build`  | Build into `dist/`           |
| `pnpm type`   | Run TypeScript type checks   |
| `pnpm lint`   | Lint with oxlint             |
| `pnpm format` | Format with oxfmt            |

[rspack.config.ts](rspack.config.ts) uses `https://api.deepseek.com` by default. Use `createConfig({ apiOrigin, devServer })` to customize the API origin and development server proxy.

Chat uses `deepseek-flash` by default through Anthropic-compatible Messages / Files APIs. Speech features use ASR / TTS endpoints. Requests include extensions for search, link reading, titles, and `latest_reminder`, so the configured service must support the corresponding capabilities. Supported attachment formats are determined by server-side validation.

```text
src/
  app/                 Application layout, themes, and global styles
  components/          Chat, settings, Markdown, and other UI components
  i18n/                English and Chinese translations
  services/
    api/               API requests, SSE, and protocol types
    chat/              Conversations, message branches, storage, and history import/export
    markdown/          Markdown parsing, syntax highlighting, and diagrams
    speech/            Audio recording and read-aloud playback
  utils/               Shared utilities
```

## License

[MIT](LICENSE). The build copies the license to `dist/LICENSE`; include it when distributing the app. Third-party dependencies are subject to their own licenses.

