Installation
What to install
| Use | Install | Also needs |
|---|---|---|
| Life portrait, web UI, assistants | uv pip install -e . | Codex CLI or any OpenAI-compatible API. No GPU |
Speaking style (build-profile --purpose clone) | ltp and scipy on top | The LTP model, runs on CPU |
| Fine-tuned clone | uv pip install --group main -e . | NVIDIA GPU, CUDA 12.6 or later, a spaCy model |
Base install
Python 3.12 is required. uv is recommended for the environment, see the uv documentation to install it.
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.jsoncNOTE
All settings live in settings.jsonc, described in Configuration File. Use weclone-cli --config-path <file> or the WECLONE_CONFIG_PATH environment variable to point to another file.
Model backend
Portrait extraction, memory organization and domain summaries call API models. agent_distill_args.llm_provider selects the backend:
codex_exec(default): calls models through the local Codex CLI, which must be installed and signed in. Set the model, reasoning effort and concurrency incodex_exec_args.api: any OpenAI-compatible API. Put the URL, key and model name inbase_url,llm_api_keyandmodel_nameofmake_dataset_args, and concurrency, timeout and output limit inbatch_size,timeoutandmax_tokensofagent_distill_args.build-profilethen needs--max-context-tokenswith the model's input limit.
"agent_distill_args": {
"llm_provider": "api",
"batch_size": 10,
"timeout": 120
},
"make_dataset_args": {
"base_url": "https://xxx/v1",
"llm_api_key": "xxxxx",
"model_name": "xxx",
...
}WARNING
While your portrait is built, chat content is sent to the chosen model service. The command line shows the backend and asks you to confirm first.
Speaking style dependencies
Needed only for the clone purpose (build-profile --purpose clone):
uv pip install ltp scipy
hf download LTP/base --local-dir models/LTPbaseLTP handles Chinese word segmentation and parsing and runs on CPU by default.
Fine-tuning dependencies
- Install CUDA 12.6 or later (skip if already installed), see the LLaMA Factory installation guide.
- Install the fine-tuning dependencies and the spaCy model used for privacy filtering (
en_core_web_smfor English chats):bashuv pip install --group main -e . uv pip install https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-3.8.0/zh_core_web_sm-3.8.0-py3-none-any.whl - Check that PyTorch sees CUDA (NVIDIA GPU users):bash
python -c "import torch; print('CUDA available:', torch.cuda.is_available())" - (Optional) Install FlashAttention to speed up training and inference:bashFor version mismatches, use the prebuild-wheels.
uv pip install flash-attn --no-build-isolation
Windows
Windows has not been rigorously tested. vLLM supports Linux only, so training data can't be cleaned with a local model on Windows. WSL2 is recommended (about 5% GPU performance loss), see the WSL2 installation guide.