{"id":50807126,"url":"https://github.com/lfbear/chatbox-lite","last_synced_at":"2026-06-13T02:08:58.551Z","repository":{"id":363477616,"uuid":"1263529882","full_name":"lfbear/chatbox-lite","owner":"lfbear","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-09T03:51:26.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T05:22:24.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lfbear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-09T03:23:42.000Z","updated_at":"2026-06-09T03:51:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lfbear/chatbox-lite","commit_stats":null,"previous_names":["lfbear/chatbox-lite"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lfbear/chatbox-lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfbear%2Fchatbox-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfbear%2Fchatbox-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfbear%2Fchatbox-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfbear%2Fchatbox-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfbear","download_url":"https://codeload.github.com/lfbear/chatbox-lite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfbear%2Fchatbox-lite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34269411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-13T02:08:57.916Z","updated_at":"2026-06-13T02:08:58.537Z","avatar_url":"https://github.com/lfbear.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatbox Lite\n\n\u003e A **single-file** browser-based multi-model chat page — double-click the HTML and it just works.\n\nZero dependencies, zero backend, zero install. All data lives in your browser's `localStorage` and is never uploaded to any third-party server. One HTML file is the entire application.\n\n---\n\n## ✨ Features\n\n- **Unified UI across providers**: OpenAI compatible (DeepSeek / Moonshot / SiliconFlow / OpenRouter / vLLM …), Anthropic Claude, Google Gemini, local Ollama / llama.cpp / LM Studio.\n- **Streaming output**: Server-Sent Events / NDJSON both supported, rendered as it streams.\n- **Visible thinking process**: Compatible with OpenAI `reasoning_content`, Ollama `thinking`, Claude `thinking_delta`, Gemini `thought`, and inline `\u003cthink\u003e` / `\u003cthinking\u003e` tags (DeepSeek-R1, etc.). One-click toggle, auto-strips leaked prefixes.\n- **Full Markdown stack**: GFM tables, code highlighting (highlight.js), KaTeX math, DOMPurify XSS filtering.\n- **Vision + files**: Paste/drag-drop images; PDF / DOCX / TXT / source code parsed as context.\n- **Self-service model lists**: After filling in Base URL and API Key, click \"🔄 Fetch model list\" and pick the models you want from a checkbox panel — no more typos.\n- **Smart vendor detection**: In OpenAI-compatible mode, the vendor name is auto-extracted from the host as a prefix (`api.deepseek.com` → `DeepSeek · model`).\n- **Refined scroll behavior**: Manually scrolling up during streaming pauses auto-follow and floats a \"back to latest\" button with an unread dot.\n- **Personalization**: Custom user / AI display names, light/dark theme, system prompt, temperature, context length, thinking budget.\n- **Multi-session**: Manage, rename, delete chats from the left sidebar; JSON export / import.\n- **Per-message actions**: Regenerate (re-answer with a different model), edit \u0026 resend (puts the message back in the input and truncates what follows).\n- **Clear context, keep history**: Drop a \"✂ Context cleared\" divider with one click (or `Ctrl/⌘+K`) — past messages stay on screen but won't be sent to the model.\n- **Responsive**: Collapsible sidebar on mobile, wide layout on desktop.\n- **Keyboard friendly**: `Enter` to send, `Shift+Enter` for newline, `Ctrl/⌘+N` for new chat.\n- **i18n**: Built-in English / Chinese UI switch (top-left \"EN / 中\" toggle).\n\n---\n\n## 🚀 Quick start\n\n1. Grab `index.html` from [Releases](https://github.com/lfbear/chatbox-lite/) or `git clone` the repo.\n2. Double-click to open in a browser (Chrome / Edge / Firefox recommended).\n3. Click \"⚙ Settings\" at the bottom-left → fill in the Base URL and API Key for any provider.\n4. Click **🔄 Fetch model list** next to the model list, pick the models you want → Save.\n5. Pick a model from the top dropdown and start chatting.\n\n\u003e You can also host it on any static server (Nginx / GitHub Pages / Cloudflare Pages); the single HTML file needs no build step.\n\n---\n\n## 📱 Install as a desktop / mobile app (PWA)\n\nThe page ships with an inline webmanifest, so once you host it over **HTTPS** (or `localhost`) you can install it like a native app — no separate manifest or service-worker file required.\n\n- **Chrome / Edge desktop** — click the ⋮ menu → **\"Install Chatbox Lite\"** (or **\"Apps → Install this site as an app\"**). Launches in a chrome-less window.\n- **macOS Safari (17+)** — **File → Add to Dock…** (or the Share button → **Add to Dock**).\n- **iOS / iPadOS Safari** — Share button → **Add to Home Screen**.\n- **Android Chrome** — ⋮ menu → **Install app** (or \"Add to Home screen\").\n\n\u003e Caveat: opening the HTML via `file://` doesn't qualify for install. Use any static host — GitHub Pages, Cloudflare Pages, `python3 -m http.server`, etc.\n\u003e\n\u003e True offline support (works with no network at all) isn't enabled in this single-file build — it would require a separate `sw.js`. After install the app does open in a standalone window and works as long as your model API is reachable.\n\n**Refresh inside the installed app**: standalone PWAs have no browser refresh button. Tap the **↻** icon that appears in the sidebar header (only shown when running standalone), or on iOS/Android pull down on the message list.\n\n---\n\n## 🔌 Provider configuration\n\n| Type | Base URL example | API Key source |\n| --- | --- | --- |\n| OpenAI official | `https://api.openai.com/v1` | platform.openai.com |\n| DeepSeek | `https://api.deepseek.com/v1` | platform.deepseek.com |\n| Moonshot | `https://api.moonshot.cn/v1` | platform.moonshot.cn |\n| SiliconFlow | `https://api.siliconflow.cn/v1` | cloud.siliconflow.cn |\n| OpenRouter | `https://openrouter.ai/api/v1` | openrouter.ai |\n| Anthropic Claude | `https://api.anthropic.com/v1` | console.anthropic.com |\n| Google Gemini | `https://generativelanguage.googleapis.com/v1beta` | aistudio.google.com |\n| Ollama | `http://localhost:11434` | (can be empty) |\n| LM Studio | `http://localhost:1234/v1` | (can be empty) |\n| llama.cpp | `http://localhost:8080/v1` | (can be empty) |\n\nAny \"OpenAI-compatible\" relay / proxy can go in the **OpenAI compatible** block; the vendor name is auto-detected from the host and used as the dropdown prefix.\n\n---\n\n## 🌐 CORS and direct-from-browser calls\n\nBecause this is a pure front-end app, every request goes **directly from the browser**, so the target service must allow cross-origin requests.\n\n- **OpenAI / Claude / Gemini official endpoints**: native CORS support, works out of the box. Claude requests automatically include `anthropic-dangerous-direct-browser-access: true`.\n- **Ollama**: set the environment variable `OLLAMA_ORIGINS=*` before launch, otherwise the browser preflight will be blocked.\n  ```bash\n  # macOS / Linux\n  OLLAMA_ORIGINS=* ollama serve\n\n  # Windows (PowerShell)\n  $env:OLLAMA_ORIGINS=\"*\"; ollama serve\n  ```\n- **Self-hosted reverse proxies**: make sure to return `Access-Control-Allow-Origin` and `Access-Control-Allow-Headers`.\n\n---\n\n## 🔒 Privacy \u0026 security\n\n- All API keys, chat history, and configuration are stored **only in local `localStorage`** and are never sent anywhere (except to the model APIs you've configured).\n- Do not use on shared computers; exported JSON files contain plaintext keys — keep them safe.\n- Markdown rendering is XSS-filtered with DOMPurify.\n\n---\n\n## ⌨️ Keyboard shortcuts\n\n| Shortcut | Action |\n| --- | --- |\n| `Enter` | Send |\n| `Shift+Enter` | Newline |\n| `Ctrl` / `⌘` + `Shift` + `O` | New chat |\n| `Ctrl` / `⌘` + `N` | New chat (fallback — most browsers reserve this for \"new window\") |\n| `Ctrl` / `⌘` + `K` | Clear context (keep visible history) |\n\n---\n\n## 🛠️ Tech stack\n\nPure static, no build step:\n\n- [marked](https://marked.js.org/) · Markdown rendering\n- [highlight.js](https://highlightjs.org/) · code highlighting\n- [KaTeX](https://katex.org/) · math\n- [DOMPurify](https://github.com/cure53/DOMPurify) · XSS filtering\n- [pdf.js](https://mozilla.github.io/pdf.js/) · PDF text extraction\n- [mammoth.js](https://github.com/mwilliamson/mammoth.js) · DOCX text extraction\n\nAll libraries are loaded via CDN; if you want fully offline use, replace the `\u003cscript\u003e` / `\u003clink\u003e` URLs with local paths.\n\n---\n\n## 📋 Known limitations\n\n- Browser-side calls are sensitive to CORS configuration on self-hosted relays; if you see `Failed to fetch`, check CORS first.\n- No Function Calling / Tool Use (this app focuses on plain conversation).\n- No streaming token usage stats (some providers don't return them either).\n- Image generation, TTS, ASR, and other non-chat capabilities are out of scope.\n\n---\n\n## 🗺️ Roadmap\n\nSuggestions welcome in Issues:\n\n- [ ] Custom providers (add a standalone block for any OpenAI-compatible endpoint)\n- [ ] Conversation search\n- [ ] Prompt library\n- [ ] Installable PWA / offline support\n\n---\n\n## 🤝 Contributing\n\nPRs / issues welcome. Since this is a single-file project, just edit `chatbox-lite/index.html` directly — no build needed.\n\n---\n\n## 📄 License\n\nMIT\n\n---\n\n# Chatbox Lite（中文）\n\n\u003e 一个 **单文件** 浏览器端多模型聊天页面 —— 双击 HTML 文件即开即用。\n\n零依赖、零后端、零安装。所有数据存在你浏览器的 `localStorage` 里，不会上传到任何第三方服务器。一个 HTML 文件就是一个完整的应用。\n\n---\n\n## ✨ 特性\n\n- **多供应商统一界面**：OpenAI 兼容（DeepSeek / Moonshot / 硅基流动 / OpenRouter / vLLM …）、Anthropic Claude、Google Gemini、本地 Ollama / llama.cpp / LM Studio。\n- **流式输出**：Server-Sent Events / NDJSON 全部支持，边生成边渲染。\n- **思考过程可视化**：兼容 OpenAI `reasoning_content`、Ollama `thinking`、Claude `thinking_delta`、Gemini `thought`、以及内联 `\u003cthink\u003e` / `\u003cthinking\u003e` 标签（DeepSeek-R1 等），可一键开关、自动剥离泄漏前缀。\n- **Markdown 全家桶**：GFM 表格、代码高亮（highlight.js）、KaTeX 数学公式、DOMPurify XSS 过滤。\n- **视觉 + 文件**：图片粘贴/拖拽、PDF / DOCX / TXT / 代码文件解析为上下文。\n- **模型列表自助拉取**：填完 Base URL 和 API Key，点\"🔄 获取模型列表\"，从复选框面板里勾选要用的模型，告别手填错字。\n- **智能厂商识别**：OpenAI 兼容模式下，自动从 host 提取厂商名作为前缀（`api.deepseek.com` → `DeepSeek · model`）。\n- **细致的滚动控制**：流式输出时手动上滚即暂停自动跟随，浮出\"回到最新\"按钮，含未读小红点。\n- **个性化**：自定义\"用户名 / AI 名称\"、深浅色主题、系统提示词、温度、上下文长度、思考预算。\n- **多会话**：左侧栏管理对话、改名、删除；支持 JSON 导出 / 导入。\n- **消息级操作**：重新生成（换模型重答）、编辑重发（把消息放回输入框并截断后续）。\n- **清除上下文、保留历史**：一键（或 `Ctrl/⌘+K`）插入\"✂ 上下文已清除\"分隔线 —— 历史消息仍在屏幕上，但不会再发送给模型。\n- **响应式**：移动端折叠侧栏、桌面端宽布局。\n- **键盘友好**：`Enter` 发送、`Shift+Enter` 换行、`Ctrl/⌘+N` 新建对话。\n- **多语言**：内置中英文 UI 切换（左上角\"EN / 中\"按钮）。\n\n---\n\n## 🚀 快速开始\n\n1. 从 [Releases](https://github.com/lfbear/chatbox-lite/) 或直接 `git clone` 拿到 `index.html`。\n2. 双击在浏览器中打开（推荐 Chrome / Edge / Firefox）。\n3. 点左下角\"⚙ 设置\" → 填入任意一个供应商的 Base URL 和 API Key。\n4. 点击模型列表旁的 **🔄 获取模型列表**，勾选你要用的模型 → 保存。\n5. 顶部下拉选模型，开聊。\n\n\u003e 也可以挂到任意静态服务器（Nginx / GitHub Pages / Cloudflare Pages），单个 HTML 文件无需构建。\n\n---\n\n## 📱 安装为桌面 / 移动应用（PWA）\n\n页面已内置 inline 的 webmanifest，把它放到 **HTTPS** 网址（或 `localhost`）下访问，就能像原生 App 一样安装 —— 不需要额外的 manifest 或 service worker 文件。\n\n- **Chrome / Edge 桌面端** —— ⋮ 菜单 → **\"安装 Chatbox Lite\"**（或 **\"应用 → 把该网站安装为应用\"**）。会在独立窗口运行。\n- **macOS Safari (17+)** —— **文件 → 添加到程序坞…**（或分享菜单 → **添加到程序坞**）。\n- **iOS / iPadOS Safari** —— 分享按钮 → **添加到主屏幕**。\n- **Android Chrome** —— ⋮ 菜单 → **安装应用**（或 \"添加到主屏幕\"）。\n\n\u003e 注意：用 `file://` 直接打开 HTML 是不能安装的。需要任意静态托管 —— GitHub Pages、Cloudflare Pages、`python3 -m http.server` 等都行。\n\u003e\n\u003e 真正的离线运行（完全断网仍可用）在当前单文件版本里没有开启 —— 那需要额外的 `sw.js` 文件。安装后页面会在独立窗口里启动，只要你配置的模型 API 还能连通，使用体验和原生应用一致。\n\n**安装后如何刷新**：独立 PWA 窗口没有浏览器的刷新按钮。点侧栏顶部的 **↻** 图标（仅在独立模式下显示），或在 iOS / Android 上从消息列表顶端下拉。\n\n---\n\n## 🔌 模型供应商配置\n\n| 类型 | Base URL 示例 | API Key 来源 |\n| --- | --- | --- |\n| OpenAI 官方 | `https://api.openai.com/v1` | platform.openai.com |\n| DeepSeek | `https://api.deepseek.com/v1` | platform.deepseek.com |\n| Moonshot | `https://api.moonshot.cn/v1` | platform.moonshot.cn |\n| 硅基流动 | `https://api.siliconflow.cn/v1` | cloud.siliconflow.cn |\n| OpenRouter | `https://openrouter.ai/api/v1` | openrouter.ai |\n| Anthropic Claude | `https://api.anthropic.com/v1` | console.anthropic.com |\n| Google Gemini | `https://generativelanguage.googleapis.com/v1beta` | aistudio.google.com |\n| Ollama | `http://localhost:11434` | （可留空） |\n| LM Studio | `http://localhost:1234/v1` | （可留空） |\n| llama.cpp | `http://localhost:8080/v1` | （可留空） |\n\n任何\"OpenAI 兼容\"的中转 / 代理都可以填进 **OpenAI 兼容** 那一栏，会自动从 host 识别厂商名作为下拉前缀。\n\n---\n\n## 🌐 CORS 与浏览器直连\n\n因为是纯前端调用，所有请求都走 **浏览器直连**，需要目标服务允许跨域。\n\n- **OpenAI / Claude / Gemini 官方端点**：均原生支持 CORS，开箱即用。Claude 会自动带上 `anthropic-dangerous-direct-browser-access: true`。\n- **Ollama**：启动前需要设置环境变量 `OLLAMA_ORIGINS=*`，否则浏览器会被预检请求拦下。\n  ```bash\n  # macOS / Linux\n  OLLAMA_ORIGINS=* ollama serve\n\n  # Windows (PowerShell)\n  $env:OLLAMA_ORIGINS=\"*\"; ollama serve\n  ```\n- **自建反向代理**：确保返回 `Access-Control-Allow-Origin` 和 `Access-Control-Allow-Headers`。\n\n---\n\n## 🔒 隐私与安全\n\n- 所有 API Key、对话记录、配置都只存在 **本地 `localStorage`**，不会发往任何第三方（除了你配置的模型 API 本身）。\n- 请勿在公共电脑上使用；导出的 JSON 文件包含明文 Key，请妥善保管。\n- 渲染 Markdown 时使用 DOMPurify 进行 XSS 过滤。\n\n---\n\n## ⌨️ 快捷键\n\n| 快捷键 | 动作 |\n| --- | --- |\n| `Enter` | 发送 |\n| `Shift+Enter` | 换行 |\n| `Ctrl` / `⌘` + `Shift` + `O` | 新建对话 |\n| `Ctrl` / `⌘` + `N` | 新建对话（兜底 —— 大多数浏览器会把此组合保留给\"新建窗口\"）|\n| `Ctrl` / `⌘` + `K` | 清除上下文（保留可见历史）|\n\n---\n\n## 🛠️ 技术栈\n\n纯静态，无构建：\n\n- [marked](https://marked.js.org/) · Markdown 渲染\n- [highlight.js](https://highlightjs.org/) · 代码高亮\n- [KaTeX](https://katex.org/) · 数学公式\n- [DOMPurify](https://github.com/cure53/DOMPurify) · XSS 过滤\n- [pdf.js](https://mozilla.github.io/pdf.js/) · PDF 文本提取\n- [mammoth.js](https://github.com/mwilliamson/mammoth.js) · DOCX 文本提取\n\n所有库均通过 CDN 引入；如需完全离线，把 `\u003cscript\u003e` / `\u003clink\u003e` 改成本地路径即可。\n\n---\n\n## 📋 已知限制\n\n- 浏览器端调用对一些自建中转的 CORS 配置很敏感，遇到 `Failed to fetch` 优先排查 CORS。\n- 不支持 Function Calling / Tool Use（专注于普通对话场景）。\n- 不支持流式 token 用量统计（部分供应商也不返回）。\n- 图像生成、TTS、ASR 等非聊天能力不在范围内。\n\n---\n\n## 🗺️ 路线图\n\n欢迎在 Issues 里提建议：\n\n- [ ] 自定义供应商（任意 OpenAI 兼容端点都能加一个独立块）\n- [ ] 对话搜索\n- [ ] 提示词 / Prompt 库\n- [ ] PWA 离线可装\n\n---\n\n## 🤝 贡献\n\nPR / Issue 都欢迎。因为是单文件项目，改动直接编辑 `chatbox-lite/index.html` 即可，无需构建。\n\n---\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfbear%2Fchatbox-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfbear%2Fchatbox-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfbear%2Fchatbox-lite/lists"}