WeClone README

项目的 README,来自 github.com/xming521/WeClone。合并为一个 markdown 文件:README.md。

WeClone

Build a portrait of your life. Assistants that know you better. Clones that sound more like you.

GitHub stars GitHub release Telegram Twitter 小红书 WeClone①

Featured|HelloGitHub xming521%2FWeClone | Trendshift

简体中文| English| Project Homepage | Documentation

WeClone distills your identity, goals, preferences and current situation from your digital life into a life portrait, organized into domains such as work, family and health, that you can review, trace and share on your own terms. The portrait serves as long-term memory for your personal assistants and will power clones with your personal style.

Life portrait in the web UI

✨ Core Features

WeClone feature overview

[!NOTE] WeClone now goes beyond fine-tuned clones. The original fine-tuning workflow remains fully supported, see Fine-tuned clone.

The portrait and its extraction prompts are currently in Chinese, and English chats have not been tested yet. The web UI is available in English and Chinese.

📰 Recent Updates

📥 Supported Data Sources

The life portrait reads text messages only. The table shows the message types the fine-tuned clone supports. See Preparing data for exporting and setup.

Platform Text Images Voice Video Animated Emojis/Stickers Links (Sharing) Quote Forward Location Files
Telegram ✅ ✅ ❌ ❌ ⚠️ Converted to Emoji ❌ ❌ ✅ ✅ ❌
WhatsApp 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧
Discord 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧
Slack 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧

Chats from other platforms can be converted to WeClone's generic CSV format and placed in dataset/csv/. See Preparing Data on the docs site for the format.

🚀 Quick Start

1. Install

Python 3.12 is required. uv is recommended:

git clone https://github.com/xming521/WeClone.git && cd WeClone
uv venv .venv --python=3.12
source .venv/bin/activate   # Windows: .venv\Scripts\activate
uv pip install -e .
cp settings.template.jsonc settings.jsonc

All settings live in settings.jsonc. The base install is enough to build your portrait and connect personal assistants. By default the portrait is extracted through the Codex CLI, which must be installed and signed in. Any OpenAI-compatible API works as well, see Installation and configuration.

2. Prepare your data

Telegram chats are supported today. Export them as JSON with Telegram Desktop, put the ChatExport_* folders in dataset/telegram/, then set platform to telegram and telegram_args.my_id to your user ID in settings.jsonc. Chats from other platforms can be converted to the generic CSV format and placed in dataset/csv/. See Preparing data.

3. Build your portrait and connect personal assistants

weclone-cli server

Open http://127.0.0.1:5175, set a password, and build your portrait on the Build portrait page, which checks the setup and shows the progress. Then review your portrait fact by fact, approve the summaries on the Portrait summary page, then generate a token on the Assistants page and run the commands it shows for Claude Code or Codex. You can also copy the export text on the Portrait summary page into an assistant's memory. See Life portrait and assistants.

4. Fine-tune a clone

An NVIDIA GPU is required. The default Qwen2.5-7B-Instruct with LoRA needs about 16GB of VRAM. Install the dependencies and download the model as described in Fine-tuned clone, then run:

weclone-cli make-dataset                     # build training data, filtering personal information
weclone-cli train-sft                        # LoRA fine-tuning
weclone-cli server --inference --port 8005   # OpenAI-compatible API

Connect the trained clone to chat platforms through AstrBot or LangBot, see Chat bots.

🔒 Privacy and Security

See Security.

🏗️ Architecture

Show the architecture diagram: the modules, the data flow and the files each step writes. Click it for the full-size image. WeClone architecture and implementation

📚 Documentation

Document Covers
Installation and configuration What to install, model backend, speaking style and fine-tuning dependencies
Preparing data Supported sources, Telegram export, generic CSV format
Life portrait and assistants build-profile, web review, portrait summary, MCP
Fine-tuned clone Hardware, model download, training data, training and inference
Chat bots Bot token, AstrBot, LangBot
Security Storage modes, password, keys and tokens, request logs

Full tutorials, configuration reference and FAQ are on the documentation site.

📌 Roadmap

💬 Troubleshooting

❤️ Contributing

Issues and pull requests are welcome, and so is help reviewing PRs. Please discuss new features in an issue first. See the contributing guide for the development environment, tests and frontend builds.

🙏 Acknowledgments

Thanks to BUPT VCIS Lab for its support, and to the following code contributors and other community members for their contributions.

This project also benefits from excellent open source projects such as LLaMA-Factory, AstrBot, LangBot, and others.

Powered by DartNode

⚠️ Disclaimer

[!IMPORTANT] This project is intended for learning and research. Assess the risks yourself before using it in production or offering it as a service.

Click to view the disclaimer terms
  • Provided as is: the project comes without warranties of any kind. The authors are not liable for any direct or indirect loss arising from its use and do not commit to ongoing maintenance or support.
  • Data and consent: chat history contains other people's messages. Make sure that collecting and using the data complies with local laws and that the people involved have consented.
  • Portrait extraction by LLMs: while your portrait is built, chat content, including the other side's messages, is sent to the model service you configured and handled under that service's data policy. Choose a provider you trust and check its data retention and training terms. Leave chats you don't want sent out of the data directory.
  • Portrait content: the portrait collects and infers personal information about you, touches on the people around you, and may include sensitive topics such as health or relationships. Keep result directories and exported files safe, and review the portrait before giving assistants access.
  • Model output: portraits, summaries and clone replies are generated by models. They may be inaccurate and do not represent the real views of you or anyone else.
  • AI disclosure: when a clone talks to other people, make clear that it is an AI so that no one mistakes it for a real person.
  • Lawful use: do not use this project for any unlawful purpose.

This disclaimer may be revised as the project evolves.

⭐ Star History

[!TIP] If this project is helpful to you, or if you are interested in the future development of this project, please give the project a Star, thank you

Star History Chart

We clone, soul and all.

WeClone (xming521/WeClone)

正在搜索数据库…

这是干什么的?WeClone 是一个开源工具包,能把你的聊天记录变成 AI 分身:它用你自己的消息对大语言模型做微调,让聊天机器人用你个人的说话风格来回复。
那我实际装的是什么——是一个应用还是一堆脚本?是一套 Python 命令行流程:数据预处理、基于 LLaMA Factory 的 LoRA 微调、用于测试的浏览器演示页面,以及用 weclone-cli 启动的 API 服务。所有训练和推理设置都放在一个 settings.jsonc 文件里。
我怎么把它跑起来?先安装 CUDA 12.6+ 和 uv 包管理器,克隆仓库,让 uv 创建 Python 环境并安装依赖,把配置模板复制为 settings.jsonc,然后从 Hugging Face 下载默认模型。
现在有哪些不完善的地方?项目还在快速迭代中:7B 模型的效果被认为一般(14B 以上的模型效果更好),Windows 尚未经过测试,推荐用 WSL,而且微调后的模型不支持工具调用,所以必须关闭机器人的工具插件。
我的聊天记录里全是个人信息,这个怎么处理?所有处理都在本地进行。Microsoft Presidio 会从数据中剔除手机号、邮箱、卡号、IP 地址、地名和加密货币钱包地址,另外你还可以手动设置黑名单——但作者提醒,这些过滤并不保证 100% 彻底。
许可证里有什么坑吗?许可证是 AGPL-3.0,而且 README 强调这个项目只用于学习、研究和实验——如果用于生产环境,会有很大风险,需要你自己承担。
我需要很好的显卡吗?本地训练的话,需要:默认的 7B 模型配合 LoRA 大约需要 16GB 显存,不过 4-bit QLoRA 可以把它压到 6GB 左右。对更大的模型做全量微调则要消耗多得多的显存。
它能从图片里学习吗,还是只认文字?图片是可以的:微调支持图像模态数据,默认的 Qwen2.5-VL 模型本身就有视觉能力,所以你发过的图片也能影响这个分身。
它能导入哪些聊天软件,又在哪些平台上回复?目前可以导入 Telegram 的聊天记录(文字、图片、转发消息、位置;语音和视频会被忽略)。部署方面可以接入 Telegram、Discord、Slack 和个人微信号;WhatsApp、Discord 和 Slack 的导入功能还在开发中。
我怎么把 Telegram 的聊天记录喂给它?在 Telegram Desktop 里打开聊天窗口,点击 Export chat history(导出聊天记录),消息类型选 Photos(照片),格式选 JSON,然后把导出的文件夹放进 ./dataset/telegram。群聊不推荐。
路线图上还有哪些计划中的功能?记忆支持、更丰富的上下文(参与者、时间)、更多数据来源、数据增强、图形界面,以及思维链(Chain-of-Thought);多模态图像支持已经实现了。
作者
xming521
大小
12.4 MB
星标
18.4K
时长
2年
提交 · 90 天