{"id":51090445,"url":"https://github.com/yuluyangguang1/linger","last_synced_at":"2026-06-24T01:30:47.532Z","repository":{"id":353567958,"uuid":"1215008564","full_name":"yuluyangguang1/linger","owner":"yuluyangguang1","description":"🌌 关系宇宙 — AI 陪伴宇宙：恋人·朋友·家人·宠物·导师·数字怀念","archived":false,"fork":false,"pushed_at":"2026-05-12T10:44:19.000Z","size":5818,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T11:36:37.615Z","etag":null,"topics":["ai-companion","chatbot","digital-human","fastapi","llm","python"],"latest_commit_sha":null,"homepage":"https://yuluyangguang1.github.io/linger/","language":"JavaScript","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/yuluyangguang1.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-04-19T11:02:57.000Z","updated_at":"2026-05-12T10:44:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yuluyangguang1/linger","commit_stats":null,"previous_names":["yuluyangguang1/relationverse","yuluyangguang1/linger"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yuluyangguang1/linger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Flinger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Flinger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Flinger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Flinger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuluyangguang1","download_url":"https://codeload.github.com/yuluyangguang1/linger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Flinger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34713789,"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-23T02:00:07.161Z","response_time":65,"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":["ai-companion","chatbot","digital-human","fastapi","llm","python"],"created_at":"2026-06-24T01:30:46.738Z","updated_at":"2026-06-24T01:30:47.526Z","avatar_url":"https://github.com/yuluyangguang1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linger · 余温\n\n\u003e 有些人，不会真的离开。\n\u003e AI 情感陪伴原型 — 纯静态、零服务器、自带 API Key（BYOK）。\n\n## 这是什么\n\nLinger 是一个情感陪伴类交互原型。当前版本 **完全运行在浏览器里**，不需要你搭服务器、不需要买 App Store 开发者账号 — 只要一个 GitHub Pages 站点就够了。\n\n聊天回复走 **BYOK**（Bring Your Own Key）：你自己去 OpenRouter / DeepSeek / 硅基流动 / OpenAI 任一服务商申请一个 API Key，在 App 里「我 → 设置」填进去，浏览器会直接调用这些接口。Key 只保存在你的 `localStorage`，不经过任何中间服务器。\n\n没填 Key 时，App 会退化成\"演示模式\" — 用预置剧本回复，足以走完新用户冷启动流程。\n\n## 访问\n\n打开 GitHub Pages 部署好的站点即可。推送到 `main` 会自动触发 `.github/workflows/pages.yml` 重新部署。\n\n默认地址形如：`https://\u003c你的用户名\u003e.github.io/linger/`\n\n## 目录结构\n\n```\nlinger/\n├── index.html                 # 单页入口\n├── src/\n│   ├── app.js                 # 主应用（路由、页面钩子、聊天、宠物、设置）\n│   ├── llm-client.js          # BYOK 流式 LLM 客户端（OpenAI 兼容）\n│   ├── local-store.js         # localStorage 数据层（角色/宠物/聊天历史）\n│   ├── onboarding.js          # 冷启动剧本引擎\n│   ├── style.css              # 主样式\n│   ├── liquid-glass.css       # 苹果液态玻璃风格辅助样式\n│   ├── pages.js               # 预留\n│   └── assets/\n│       ├── avatars/           # 角色头像\n│       ├── icons/             # Tab 图标\n│       └── logo-*             # Logo 各尺寸\n├── .github/workflows/pages.yml  # GitHub Pages 自动部署\n├── docs/                        # 设计文档（不参与部署）\n├── backend/                     # 旧版 FastAPI 后端（已废弃，仅保留做参考）\n└── scripts/                     # 辅助脚本\n```\n\n## 本地预览\n\n```bash\n# 任意静态服务器都行，比如：\npython -m http.server 8000\n# 然后访问 http://localhost:8000\n```\n\n直接用 `file://` 打开 `index.html` 会遇到跨域限制，**必须走 HTTP 服务器**。\n\n## 配置 API Key（BYOK）\n\n1. 打开 App → 底部 tab「我」→ 点「设置（API Key）」\n2. 选一个服务商，推荐按以下顺序尝试：\n\n| 服务商 | 国内直连 | 免费额度 | Key 申请 |\n|---|---|---|---|\n| **DeepSeek** | ✅ | 有注册送 | https://platform.deepseek.com/api_keys |\n| **硅基流动 SiliconFlow** | ✅ | 有免费模型 | https://cloud.siliconflow.cn/account/ak |\n| **OpenRouter** | 需梯子 | 有免费模型 | https://openrouter.ai/keys |\n| **OpenAI** | 需梯子 + 卡 | 无 | https://platform.openai.com/api-keys |\n| **自定义** | 任何 OpenAI 兼容接口 | — | — |\n\n3. 粘贴 Key，点「测试连接」，绿色勾就成功了。\n4. 点「保存」。之后所有聊天会走你填的模型。\n\n### Key 安全说明\n\n- Key **仅保存在浏览器 localStorage**，不会上传到任何服务器（包括这个仓库的 GitHub Pages）。\n- 仓库是公开的；**别把你的 Key 直接写进代码然后推上去**。\n- 如果你在共享电脑上用完，记得在设置页点「清除 API Key」。\n\n## 架构说明\n\n```\n┌─────────────────────────────────────────────────────────┐\n│  浏览器 (GitHub Pages 托管的纯静态 HTML/JS/CSS)          │\n│                                                         │\n│  ┌────────────┐  ┌─────────────┐  ┌──────────────────┐  │\n│  │  UI 层      │→│ local-store │→│ localStorage      │  │\n│  │ (app.js)   │  │   .js       │  │  角色/宠物/历史    │  │\n│  └────────────┘  └─────────────┘  └──────────────────┘  │\n│         ↓                                                │\n│  ┌───────────────┐                                       │\n│  │ llm-client.js │── fetch ──► OpenAI 兼容接口          │\n│  └───────────────┘             (用户自带的 API Key)      │\n└─────────────────────────────────────────────────────────┘\n```\n\n没有中间服务器，没有数据库，没有后端部署，没有账号体系。\n\n## 功能\n\n- 8 种预置角色人设（温柔学姐 / 傲娇大小姐 / 腹黑总裁 …），每种有独立 system prompt 和说话风格\n- 流式聊天（SSE），回复逐字显示\n- 聊天历史本地留存（最近 40 条）\n- 亲密度 / 等级系统（本地状态机）\n- 宠物养成（喂食、玩耍、清洁、对话），本地属性衰减\n- 纪念模式（数字怀念）\n- 冷启动剧本：首次访问会演播开场 + 角色瞬间选择\n\n## 旧版后端\n\n`backend/` 下的 FastAPI 实现已不再使用，保留做以下用途：\n- 人设数据源（`backend/config/personas.json` → `src/local-store.js` 里的静态数据）\n- 未来如果你想上一个\"代理服务器模式\"，可以把它捡起来\n\n部署时 `pages.yml` 会显式跳过 `backend/`，不会被推到 Pages。\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuluyangguang1%2Flinger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuluyangguang1%2Flinger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuluyangguang1%2Flinger/lists"}