FineTune Lab SDK
Python SDK for FineTune Lab - Training, inference, batch testing, and analytics for LLMs.
Installation
# API client only (lightweight)
pip install finetune-lab
# With training dependencies (requires GPU)
pip install finetune-lab[training]
Quick Start - API Client
from finetune_lab import FinetuneLabClient
client = FinetuneLabClient(api_key="wak_your_api_key_here")
# Or set FINETUNE_LAB_API_KEY environment variable
# Inference
response = client.predict(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.content)
# Batch Testing
test = client.batch_test.run(
model_id="gpt-4",
test_suite_id="suite_abc123"
)
print(f"Test started: {test.test_id}")
# Check status
status = client.batch_test.status(test.test_id)
print(f"Progress: {status.completed}/{status.total_prompts}")
Training (Requires GPU)
Supervised Fine-Tuning (SFT)
from finetune_lab import train_sft
# Just paste your config ID
train_sft("train_abc123")
Direct Preference Optimization (DPO)
from finetune_lab import train_dpo
train_dpo("train_xyz456")
RLHF Training
from finetune_lab import train_rlhf
train_rlhf("train_def789")
How It Works
- Upload your dataset in FineTune Lab
- Configure training parameters (or use templates)
- Click "Generate Training Package"
- Get your config ID (e.g.,
train_abc123) - Paste the 2-line snippet in HF Spaces/Colab/Kaggle
- Training starts automatically!
Features
- Automatic config and dataset loading from public API
- Pre-built training scripts for SFT, DPO, and RLHF
- Support for ChatML and ShareGPT dataset formats
- LoRA-enabled parameter-efficient fine-tuning
- Compatible with HuggingFace Transformers ecosystem
API Key Scopes
Your API key must have the appropriate scope for each operation:
| Operation | Required Scope |
|---|---|
predict() |
production or all |
batch_test.* |
testing or all |
analytics.* |
production or all |
Requirements
API Client only (lightweight):
- Python 3.8+
- requests
Training (full dependencies):
- Python 3.8+
- PyTorch 2.0+
- HuggingFace Transformers
- CUDA-capable GPU (recommended)
License
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
finetune_lab-0.6.0.tar.gz
(16.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finetune_lab-0.6.0.tar.gz.
File metadata
- Download URL: finetune_lab-0.6.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c376f25f72d21140763d79346ca242fa35c4e8e8fa0dc02152127c18b0ab6722
|
|
| MD5 |
4e63f8260699e282450319bc7c135ae2
|
|
| BLAKE2b-256 |
8952294bcbe610ea04228de941b295f0fbc64e107a0e2b20b43bc5026f288f90
|
File details
Details for the file finetune_lab-0.6.0-py3-none-any.whl.
File metadata
- Download URL: finetune_lab-0.6.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d849badf15f416e0e36006029cd8675bfb5c693e27c33239387853da396e2d
|
|
| MD5 |
580048a63867f746c32b8e8fc82ef6d2
|
|
| BLAKE2b-256 |
5d633f852c5b70ecde42590cc559f1223bfb9c4bf5bd68b22f6a0a6bda9d18dc
|