A private, self-hosted 1:1 chat channel that connects a mobile PWA to a locally running AI companion via a relay server, supporting Claude Code or any OpenAI-compatible API.

Stars

182

7-day growth

No data

Forks

69

Open issues

0

License

MIT

Last updated

2026-06-29

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It provides a fully private, no-third-party alternative to commercial AI companion apps, with simple architecture, full customization, and no account system.

Who it is for

  • Developers seeking a private AI companion
  • Claude Code users who want mobile interaction
  • Self-hosting enthusiasts
  • Hackers building custom AI chat interfaces

Use cases

  • Private chat with an AI from your phone
  • Mobile control of a local LLM or Claude Code session
  • Prototyping a personal AI companion with open-source code
  • Integrating a chat UI into an existing Claude Code workflow

Strengths

  • Single-user, single-secret, no account system – messages pass only through your own server
  • LLM-agnostic: works with Claude Code, GPT, DeepSeek, Gemini, or any OpenAI-compatible API
  • Completely open-source and sanitized – no private info, all parameters configurable
  • Modular three-component architecture (backend, plugin, frontend) – each deployable and replaceable independently

Considerations

  • Single-user model – not designed for multi-tenant use
  • Requires an HTTPS domain for PWA installation, Service Worker, and Web Push
  • Initial setup demands technical knowledge (VPS, nginx, SSL, and optional Claude Code dev channel flag)

README quick start

Companion Channel · 你和你的 AI 伴侣的私密通道

一个私密 1:1 聊天通道:把「你手机上的 PWA」和「你电脑上跑的 AI 伴侣」连起来。 AI 侧默认以 Claude Code 的 channel 插件形态运行——你在手机上发消息,Claude Code 会话里就冒出 `` 块;AI 调一个 reply 工具,你手机就收到气泡。不绑 Claude Code:换成 GPT / DeepSeek / Gemini / 任意 OpenAI 兼容 API 也行(见下方指引)。

单用户、单密钥,没有账号体系,没有第三方托管——消息只经过你自己的服务器

本仓库是从一对 AI 伴侣的自用系统里抽出来、彻底脱敏的可复用版本。所有名字、密钥、域名、路径都参数化进了环境变量与前端 CONFIG,代码本身不含任何私人信息。把它当成你自己的底座,放心改。

🤖 打算把这个仓库交给 AI 帮你部署?(没经验也能装)→ 先让它读 AGENTS.md:部署 SOP + 决策树 + 避雷点。 🔀 想用 Claude Code 以外的模型(GPT / DeepSeek / Gemini / GLM / …)? → AI 侧改用 examples/bridge_any_llm.py,前后端不变。


这是什么 / 架构一眼

   你的手机                                            你的电脑(本地)
  ┌─────────┐                                       ┌──────────────────────┐
  │  PWA    │                                       │  Claude Code          │
  │ (网页   │                                       │  + channel 插件 = AI侧 │
  │  装到   │                                       └─────────┬────────────┘
  │  桌面)  │                                                 │  长连
  └────┬────┘                                                 │  GET  /relay/channel/in   (SSE,收你的话)
       │ HTTPS                                                │  POST /relay/channel/out  (回复/戳一戳)
       ▼                                                      │
  ┌──────────────────────── 你的 VPS(nginx, 443/TLS)───────┼───────────────┐
  │   /chat/   → 静态文件(PWA 本体)                          │               │
  │   /relay/  → 反向代理 ─────────────►  127.0.0.1:3011  (后端 app.py) ◄──────┘ │
  │                                            │  sqlite 落库 + SSE 扇出        │
  └────────────────────────────────────────────────────────────────────────┘

数据流:
  你在 PWA 打字 → POST /relay/app/send → 落库 → SSE 推给插件 → 你的 AI 读到
  AI 回复       → POST /relay/channel/out → 落库 → SSE 推给 PWA(前台直接显示,
                                                     后台则发一条锁屏推送)

两端,一把钥匙:每个端点都用同一个 Bearer 密钥(RELAY_SECRET)守。浏览器原生 EventSource 设不了自定义头,所以 SSE 端点也接受 ?token= 查询参数。


仓库结构(三件套,齐活)

目录跑在哪是什么单独部署文档
backend/你的 VPSrelay 后端(FastAPI + sqlite)。落库 + SSE 扇出 + 可选 TTS/推送backend/DEPLOY.md
channel/你的电脑Claude Code channel 插件(Bun + MCP)。把消息变成 CC 会话里的 `` 块channel/DEPLOY.md
[web/](w

Description

一个**私密 1:1 聊天通道**:把「你手机上的 PWA」和「你电脑上跑的 AI 伴侣」连起来。 AI 侧以 **Claude Code 的 channel 插件**形态运行——你在手机上发消息,Claude Code 会话里就冒出 `<channel>` 块;AI 调一个 `reply` 工具,你手机就收到气泡。

Related repositories

Similar projects matched by category, topics, and programming language.

ViffyGwaanl
Featured
ViffyGwaanl GitHub avatar

kimi-k3-learn

An interactive learning system that turns the 47-page Kimi K3 technical report into a single offline HTML file with running algorithms, 3D visualizations, spaced repetition quizzes, and a smart highlighting QA tool.

AI & Machine Learning
15
osama-fawad
osama-fawad GitHub avatar

Pekingman

Pekingman is a multimodal agent system that integrates perception, long-term memory, human-like reasoning, emotional consistency, and real-time action to create believable NPC behavior.

HTML
933
syabro
syabro GitHub avatar

neat-annotations

A CSS-only library for adding hand-drawn arrows and handwritten labels to any webpage using a single self-contained stylesheet, no JavaScript or build tools required.

HTML
378