This directory contains setup scripts for different LocoTrainer deployment scenarios.
Installs LocoTrainer CLI with uv for use with external API providers.
Use case: You want to use LocoTrainer with OpenAI, DashScope, OpenRouter, or other cloud APIs.
Requirements: Python 3.10+
Installation:
curl -O https://raw.githubusercontent.com/LocoreMind/LocoTrainer/main/scripts/setup_locotrainer.sh
chmod +x setup_locotrainer.sh
./setup_locotrainer.shWhat it does:
- Checks/installs uv
- Creates venv at
~/.venv/locotrainer - Installs locotrainer via
uv pip install - Creates config template at
~/.locotrainer.env
After installation:
# Edit config with your API key
nano ~/.locotrainer.env
# Run
source ~/.venv/locotrainer/bin/activate
export $(cat ~/.locotrainer.env | xargs)
locotrainer run -q "What are the default LoRA settings in ms-swift?"Installs vLLM + LocoTrainer for local deployment of LocoTrainer-4B model.
Use case: You have an NVIDIA GPU (40GB+ VRAM) and want to run LocoTrainer-4B locally at zero API cost.
Requirements:
- Python 3.10+
- NVIDIA GPU with 40GB+ VRAM (A100 40GB recommended for 128K context)
- CUDA 12.1+
Installation:
curl -O https://raw.githubusercontent.com/LocoreMind/LocoTrainer/main/scripts/setup_locotrainer_vllm.sh
chmod +x setup_locotrainer_vllm.sh
./setup_locotrainer_vllm.shWhat it does:
- Checks for NVIDIA GPU
- Checks/installs uv
- Creates venv at
~/.venv/locotrainer - Installs vLLM + locotrainer
- Creates
~/start_vllm.shstartup script - Creates config at
~/.locotrainer.env(points to localhost:8080)
After installation:
# Start vLLM server (background)
nohup ~/start_vllm.sh > ~/vllm.log 2>&1 &
# Or use screen (recommended)
screen -S vllm
~/start_vllm.sh
# Press Ctrl+A D to detach
# Wait for model to load (check logs)
tail -f ~/vllm.log
# Run LocoTrainer
source ~/.venv/locotrainer/bin/activate
export $(cat ~/.locotrainer.env | xargs)
locotrainer run -q "How does ms-swift implement GRPO training?"Sets up development environment from source for contributors.
Use case: You want to contribute to LocoTrainer or modify the source code.
Requirements: Python 3.10+
Installation:
git clone https://github.com/LocoreMind/LocoTrainer.git
cd LocoTrainer
./scripts/setup_locotrainer_dev.shWhat it does:
- Checks/installs uv
- Runs
uv syncto install dependencies - Creates
.envfrom.env.example
After installation:
# Edit config
nano .env
# Run from source
uv run locotrainer run -q "Your question"| Script | Install Location | Use Case | GPU Required |
|---|---|---|---|
setup_locotrainer.sh |
~/.venv/locotrainer |
Cloud API users | No |
setup_locotrainer_vllm.sh |
~/.venv/locotrainer |
Local model deployment | Yes (40GB+) |
setup_locotrainer_dev.sh |
./LocoTrainer/.venv |
Development/contribution | No |
Script fails with "uv: command not found"
- The script should auto-install uv, but if it fails, manually install:
curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH"
vLLM script fails with CUDA errors
- Verify CUDA version:
nvidia-smi - vLLM requires CUDA 12.1+
- Check GPU memory:
nvidia-smi --query-gpu=memory.total --format=csv
"locotrainer: command not found" after installation
- Activate the venv first:
source ~/.venv/locotrainer/bin/activate - Or use full path:
~/.venv/locotrainer/bin/locotrainer