InstallationΒΆ
This guide covers different ways to install TuFT.
π No GPU? No problem!
The instructions below assume a machine with a GPU. No GPU? You can deploy TuFT to a pay-as-you-go cloud provider β Modal (serverless, scale-to-zero) or Lambda Cloud β and fine-tune from your laptop. See the Deployment guides.
Quick InstallΒΆ
Note: This script supports unix platforms. For other platforms, see the manual installation sections below.
Install TuFT with a single command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/agentscope-ai/tuft/main/scripts/install.sh)"
This installs TuFT with full backend support (GPU dependencies, persistence, flash-attn) and a bundled Python environment to ~/.tuft. After installation, restart your terminal and run:
tuft
GPU wheel selection and installer optionsΒΆ
By default (--torch-backend auto) the installer inspects the NVIDIA driver before downloading anything, selects the validated CUDA 13.0 wheel variant (cu130) for the pinned torch/vLLM stack, and runs import and CUDA smoke tests after installing. If the driver does not support CUDA 13.0, it fails with guidance instead of installing a broken environment. Pass a backend explicitly to override, e.g. when building an image on a machine without a GPU or using custom wheels:
# Explicit CUDA 13.0 wheels
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/agentscope-ai/tuft/main/scripts/install.sh)" -- --torch-backend cu130
# CPU-only environment
TUFT_TORCH_BACKEND=cpu /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/agentscope-ai/tuft/main/scripts/install.sh)"
tuft upgrade reuses the backend recorded at install time (in $TUFT_HOME/torch-backend), so upgrades resolve packages the same way; override with tuft upgrade --torch-backend .... Use --skip-gpu-checks (or TUFT_SKIP_GPU_CHECKS=1) to turn GPU preflight/smoke-test failures into warnings.
The installer also honors these environment variables:
Variable |
Purpose |
|---|---|
|
Installation directory (default: |
|
Virtual environment location (default: |
|
Default value for |
|
Override the default PyPI requirement |
|
Passed through to uv for cache placement, link mode (e.g. |
Install from Source CodeΒΆ
We recommend using uv for dependency management.
Clone the repository:
git clone https://github.com/agentscope-ai/TuFTCreate a virtual environment:
cd TuFT uv venv --python 3.12Activate environment:
source .venv/bin/activateInstall dependencies:
# Install minimal dependencies for non-development installs uv sync # If you need to develop or run tests, install dev dependencies uv sync --extra dev # If you want to run the full feature set (e.g., model serving, persistence), # please install all dependencies uv sync --all-extras python scripts/install_flash_attn.py # If you face issues with flash-attn installation, you can try installing it manually: # uv pip install flash-attn --no-build-isolation
Install via PyPIΒΆ
uv pip install "tuft>=0.1.8"
# Install optional dependencies as needed
uv pip install "tuft[dev,backend,persistence]>=0.1.8"
Use the Pre-built Docker ImageΒΆ
If you face issues with local installation or want to get started quickly, you can use the pre-built Docker image.
Pull the latest image from GitHub Container Registry:
docker pull ghcr.io/agentscope-ai/tuft:latestRun the Docker container and start the TuFT server on port 10610:
docker run -it \ --gpus all \ --shm-size="128g" \ --rm \ -p 10610:10610 \ -v <host_dir>:/data \ ghcr.io/agentscope-ai/tuft:latest \ tuft launch --port 10610 --config /data/tuft_config.yamlPlease replace
<host_dir>with a directory on your host machine where you want to store model checkpoints and other data.Suppose you have the following structure on your host machine:
<host_dir>/ βββ checkpoints/ βββ Qwen3-4B/ βββ Qwen3-8B/ βββ tuft_config.yaml
Run the ServerΒΆ
The CLI starts a FastAPI server:
tuft launch --port 10610 --config /path/to/tuft_config.yaml
The config file tuft_config.yaml specifies server settings including available base models, authentication, persistence, and telemetry. Below is a minimal example:
supported_models:
- model_name: Qwen/Qwen3-4B
model_path: Qwen/Qwen3-4B
max_model_len: 32768
tensor_parallel_size: 1
- model_name: Qwen/Qwen3-8B
model_path: Qwen/Qwen3-8B
max_model_len: 32768
tensor_parallel_size: 1
See config/tuft_config.example.yaml in the repository for a complete example configuration with all available options.