chat-demo README

项目的 README,来自 github.com/deepseek-ai/chat-demo。合并为一个 markdown 文件:README.md。

chat-demo

English | 简体中文

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 or download the archive from 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:

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:

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

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

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. The build copies the license to dist/LICENSE; include it when distributing the app. Third-party dependencies are subject to their own licenses.

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

正在搜索数据库…

这是什么?一个基于 DeepSeek API 的静态聊天演示应用,在浏览器中运行,没有自己的后端。
我需要自己运行服务器吗?不需要。浏览器直接连接你配置的 API 服务,因此没有需要托管的应用服务器。你可以在线使用,打开下载的压缩包,或者部署构建好的静态文件。
怎么运行它?可以从 Releases 下载压缩包,解压后双击 index.html,无需安装或构建。也可以安装 Node.js 22.12+ 和 pnpm,运行 pnpm build,再把 dist/ 中的输出部署到静态 Web 服务器。
第一次聊天前需要准备什么?一个 DeepSeek API 密钥,需要在第一次聊天前在设置中填入。如果从源码构建,还需要 Node.js 22.12+ 和 pnpm。
任何 API 端点都能用吗?不一定。聊天默认通过兼容 Anthropic 的 Messages 和 Files API 使用 'deepseek-flash';搜索、链接阅读、标题生成和语音功能则需要你配置的服务支持这些扩展。
我的聊天数据会保存在设备上吗?你的 API 密钥、设置和聊天记录保存在本浏览器的 localStorage 和 IndexedDB 中。但发送消息、上传附件或使用语音功能时,这些内容会发送到你配置的 API 服务。
支持 Markdown、数学公式和图表吗?支持。回复支持带语法高亮的 Markdown、KaTeX 数学公式和 Mermaid 图表。
能联网搜索和读取链接吗?如果你配置的服务支持,可以。回复可以使用智能搜索和链接阅读,并显示来源引用,你也可以随时停止生成。
有中文界面吗?有。界面提供简体中文和英文,并带有浅色和深色主题以及移动端布局。
大小
0.1 MB
星标
4.5K
时长
6天
提交 · 90 天