WeClone README

The project's README from github.com/xming521/WeClone. As one markdown file: README.md.

download

🚀 One-stop solution for creating your digital avatar from chat history 💡

GitHub stars GitHub release Telegram Twitter 小红书 WeClone①

Featured|HelloGitHub xming521%2FWeClone | Trendshift Ask DeepWiki

简体中文| English| Project Homepage | Documentation

✨Core Features


WeClone × Infistar.cc 无限星河|全模型 API · 为 AI 数字分身持续注入智能

Infistar.cc 无限星河

感谢 Infistar.cc 无限星河 赞助本项目!
⚡ 稳定高效的模型服务:价格低至官方渠道 1 折,模型倍率公开透明,多节点冗余保障,降低限流、429 与服务中断的影响;
🧠 主流模型一站式接入:一个 API Key 即可调用 Claude、ChatGPT、Gemini、Kimi、GLM、DeepSeek 等模型;
👤 助力数字分身生态扩展:适用于对话效果测试、人格提示词优化、内容生成及机器人能力扩展,为 WeClone 数字分身提供更多模型选择;
🎁 WeClone 用户专属福利:通过 专属推广链接 注册即可领取 5 美元等值测试额度 / 首充专属优惠,快速体验多模型 API 服务!


📋Features & Notes

Data Source Platform Support

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

Deployment Platform Support

Platform Deployment Support
Telegram ✅
WhatsApp 🚧
WeChat (Personal Account) ✅ (Based on openclaw-weixin)
Discord ✅
Slack ✅

[!IMPORTANT]

  • WeClone is still in rapid iteration phase, current performance does not represent final results.
  • LLM fine-tuning effectiveness largely depends on model size, quantity and quality of chat data. Theoretically, larger models with more data yield better results.
  • The performance of the 7B model is average, while models with 14B or more parameters tend to deliver better results.
  • Windows environment has not been rigorously tested. You can use WSL as the runtime environment.

Recent Updates

[25/07/10] Data source added Telegram
[25/06/05] Support for image modal data fine-tuning

Hardware Requirements

The project uses Qwen2.5-VL-7B-Instruct model by default with LoRA method for SFT stage fine-tuning. You can also use other models and methods supported by LLaMA Factory.

Estimated VRAM requirements:

Method Precision 7B 14B 30B 70B xB
Full (bf16 or fp16) 32 120GB 240GB 600GB 1200GB 18xGB
Full (pure_bf16) 16 60GB 120GB 300GB 600GB 8xGB
Freeze/LoRA/GaLore/APOLLO/BAdam 16 16GB 32GB 64GB 160GB 2xGB
QLoRA 8 10GB 20GB 40GB 80GB xGB
QLoRA 4 6GB 12GB 24GB 48GB x/2GB
QLoRA 2 4GB 8GB 16GB 24GB x/4GB

Environment Setup

  1. CUDA installation (skip if already installed, requires version 12.6 or above)

  2. It is recommended to use uv to install dependencies, which is a very fast Python environment manager. After installing uv, you can use the following commands to create a new Python environment and install dependencies.

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 --group main -e . 
  1. Copy the configuration file template and rename it to settings.jsonc, and make subsequent configuration changes in this file:
cp examples/tg.template.jsonc settings.jsonc

[!NOTE] Training and inference related configurations are unified in the file settings.jsonc

  1. Use the following command to test whether the CUDA environment is correctly configured and can be recognized by PyTorch (not needed for Mac):
  python -c "import torch; print('CUDA Available:', torch.cuda.is_available());"
  1. (Optional) Install FlashAttention to accelerate training and inference: uv pip install flash-attn --no-build-isolation.

Model Download

It is recommended to use Hugging Face to download models, or use the following command:

git lfs install
git clone https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct models/Qwen2.5-VL-7B-Instruct

Data Preparation

Please use Telegram Desktop to export chat records. Click the top right corner in the chat interface, then click "Export chat history". Select Photos for message types and JSON for format. You can export multiple contacts (group chat records are not recommended), then place the exported ChatExport_* in the ./dataset/telegram directory, meaning put different people's chat record folders together in ./dataset/telegram.

Data Preprocessing

[!IMPORTANT] 🚨 Please be sure to protect personal privacy and do not leak personal information!

weclone-cli make-dataset

More Parameter Details: Data Preprocessing

Configure Parameters and Fine-tune Model

Single GPU Training

weclone-cli train-sft

Multi-GPU Training

Uncomment the deepspeed line in settings.jsonc and use the following command for multi-GPU training:

uv pip install "deepspeed<=0.16.9"
deepspeed --num_gpus=number_of_gpus weclone/train/train_sft.py

Simple Inference with Browser Demo

Test suitable temperature and top_p values, then modify infer_args in settings.jsonc for subsequent inference use.

weclone-cli webchat-demo

Inference Using API

weclone-cli server

Test with Common Chat Questions

Does not include questions asking for personal information, only daily conversation. Test results are in test_result-my.txt.

weclone-cli server
weclone-cli test-model

🖼️ Results Showcase

[!TIP] We're looking for interesting examples of native English speakers chatting with WeClone! Feel free to share them with us on Twitter.

🤖 Deploy to Chat Bots

AstrBot

AstrBot is an easy-to-use multi-platform LLM chatbot and development framework ✨ Supports Discord, Telegram, Slack, Feishu and other platforms.

Usage steps:

  1. Deploy AstrBot
  2. Deploy messaging platforms like Discord, Telegram, Slack in AstrBot
  3. Execute weclone-cli server to start the API service
  4. Add a new service provider in AstrBot, select OpenAI type, fill in the API Base URL according to AstrBot's deployment method (e.g., for docker deployment it might be http://172.17.0.1:8005/v1), fill in the model as gpt-3.5-turbo, and enter any API Key
  5. Tool calling is not supported after fine-tuning, please turn off the default tools first by sending the command: /tool off_all on the messaging platform, otherwise the fine-tuned effect won't be visible.
  6. Set the system prompt in AstrBot according to the default_system used during fine-tuning. 5

    [!IMPORTANT] Check the api_service logs to ensure that the large model service request parameters are consistent with those used during fine-tuning as much as possible, and turn off all tool plugin capabilities.

LangBot

LangBot is an easy-to-use open-source LLM chatbot platform suitable for various scenarios. It connects to various global instant messaging platforms. You can set up your IM bot in just 5 minutes.

image
  1. Deploy LangBot
  2. Add a bot (Discord, Telegram, Slack, Lark e.g.) in LangBot
  3. Execute weclone-cli server to start the WeClone API service
  4. Add a new model in the model page, name it gpt-3.5-turbo, select OpenAI as the provider, fill in the request URL as WeClone's address. For detailed connection methods, refer to the documentation, and enter any API Key.
image
  1. Select the model you just added in the pipeline configuration, or modify the prompt configuration
image

📌 Roadmap

Troubleshooting

Official Documentation FAQ

It is also recommended to use DeepWiki for problem solving.

❤️ Contributing

Any Issues/Pull Requests are welcome!

You can contribute by checking Issues or helping review PRs (Pull Requests). For new feature additions, please discuss through Issues first.
Development environment:

uv pip install --group dev -e .
pre-commit install

The project uses pytest for testing, pyright for type checking, and ruff for code formatting.
Before submitting your code, you should run pytest tests to ensure all tests pass.

🙏 Acknowledgments

Thanks to the following code contributors and other community members for their contributions

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

Powered by DartNode

⚠️ Disclaimer

[!CAUTION] This project is for learning, research and experimental purposes only. There are significant risks in using it for production environments, please assess carefully. Do not use for illegal purposes, consequences are at your own risk.

[!IMPORTANT]

WeClone is currently not partnered with any platform and has not issued any cryptocurrency. The only official website is: weclone.love. Beware of imitations.

Click to view disclaimer terms

1. Use at Your Own Risk

  • Users should fully understand and bear all related risks when using this project
  • The project authors are not responsible for any direct or indirect losses arising from the use of this project
  • Including but not limited to: data loss, financial loss, legal disputes, personal reputation damage, social relationship impact, psychological trauma, career development obstacles, business reputation damage, etc.

2. Production Environment Risk Warning

  • Use for commercial purposes or providing external services requires bearing all risks yourself
  • All consequences that may result from production environment use (including but not limited to service interruption, data security issues, user complaints, legal liability, etc.) are entirely borne by the user
  • It is recommended to conduct thorough testing, verification and risk assessment before using in production environments

3. Model Output Unreliability

  • Fine-tuned models may produce inaccurate, harmful or misleading content
  • Model outputs do not represent the views or intentions of real persons
  • Users should conduct manual review and verification of model outputs

4. Data Security and Privacy

  • Users should ensure that uploaded chat records and other data comply with relevant laws and regulations
  • Users should obtain appropriate authorization from data-related persons
  • This project is not responsible for data leakage or privacy infringement
  • Users should ensure that using this project complies with local laws and regulations
  • Involving artificial intelligence, data protection, intellectual property and other related laws
  • Users bear the consequences of illegal use

6. Technical Support Limitations

  • This project is provided "as is" without any express or implied warranties
  • Authors do not promise to provide continuous technical support or maintenance
  • No guarantee of project stability, reliability or applicability

Usage Recommendations

Mandatory Bot Identity Identification

When using digital avatars generated by this project, it is strongly recommended to:

  • Clearly identify as "AI Bot" or "Digital Avatar" at the beginning of each conversation
  • Prominently mark "AI-generated content" in the user interface
  • Avoid letting users mistake it for real human conversation, which could cause risks

Risk Assessment Recommendations

If you must use in production environments, it is recommended to:

  1. Conduct comprehensive security testing
  2. Establish complete content review mechanisms
  3. Develop emergency response plans
  4. Purchase appropriate insurance coverage
  5. Consult legal professionals for advice

This disclaimer may be revised with project updates, users should regularly check the latest version. Continuing to use this project indicates agreement with the latest disclaimer terms.

Once you download, clone, modify, distribute or use the code or models of this project in any way, it indicates that you have fully read, understood and agreed to unconditionally accept all terms of this disclaimer.

Please carefully read and understand all contents of this disclaimer, ensuring strict compliance with relevant regulations when using this project.

⭐ 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

WeClone (xming521/WeClone)

Searching Database…

18.3K ·GitHub
Что это такое?WeClone — это open-source набор инструментов, который превращает вашу историю чатов в AI-двойника: он дообучает LLM на ваших собственных сообщениях, чтобы чат-бот отвечал в вашем личном стиле.
Так что именно я устанавливаю — приложение или кучу скриптов?Консольный пайплайн на Python: предобработка данных, LoRA-дообучение на базе LLaMA Factory, демо в браузере для тестирования и API-сервер, который запускается через weclone-cli. Все настройки обучения и инференса лежат в одном файле settings.jsonc.
Как его запустить?Установите CUDA 12.6+ и менеджер пакетов uv, склонируйте репозиторий, позвольте uv создать окружение Python и установить зависимости, скопируйте шаблон конфигурации в settings.jsonc, а затем скачайте модель по умолчанию с Hugging Face.
Какие сейчас есть шероховатости?Проект активно развивается: результаты 7B описывают как средние (модели 14B+ справляются лучше), Windows не тестировалась, поэтому рекомендуется WSL, а дообученная модель не умеет вызывать инструменты — плагины с tool calling у бота придётся отключить.
В моей истории чатов полно личных данных — как с этим обращаются?Всё работает локально. Microsoft Presidio удаляет из данных номера телефонов, адреса электронной почты, номера карт, IP-адреса, названия мест и адреса криптокошельков, плюс есть ручной блок-лист — но авторы предупреждают, что эта фильтрация не гарантирует стопроцентной полноты.
Есть ли подвох в лицензии?Лицензия — AGPL-3.0, и в README подчёркивается, что проект предназначен для обучения, исследований и экспериментов — использование в продакшене несёт серьёзные риски, которые вы берёте на себя.
Мне нужна мощная видеокарта для этого?Для локального обучения — да: модели 7B по умолчанию с LoRA нужно около 16 ГБ видеопамяти, хотя 4-битный QLoRA умещает её примерно в 6 ГБ. Полное дообучение более крупных моделей требует намного больше памяти.
Он учится и на картинках, или только на тексте?Картинки работают: дообучение поддерживает изображения, а модель Qwen2.5-VL по умолчанию умеет работать с картинками, так что отправленные вами фотографии тоже повлияют на двойника.
Из каких мессенджеров он может импортировать историю и в каких отвечать?Сейчас можно импортировать чаты Telegram (текст, изображения, пересланные сообщения, геолокацию; голосовые и видео игнорируются). Для работы бот подключается к Telegram, Discord, Slack и личным аккаунтам WeChat; импорт из WhatsApp, Discord и Slack ещё в разработке.
Как скормить ему мою историю из Telegram?В Telegram Desktop откройте чат, нажмите Export chat history, выберите Photos как тип сообщений и JSON как формат, затем положите экспортированные папки внутрь ./dataset/telegram. Групповые чаты использовать не рекомендуется.
Что ещё запланировано в дорожной карте?Поддержка памяти, более широкий контекст (участники, время), больше источников данных, аугментация данных, графический интерфейс и цепочки рассуждений (Chain-of-Thought); поддержка картинок (multimodal) уже реализована.
Creator
xming521
Size
6.6 MB
Stars
18.3K
Age
2y
Commits · 90 Days