FineTune Lab SDK - Training, inference, batch testing, and analytics for LLMs
Project description
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
Project details
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.3.0.tar.gz
(14.1 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.3.0.tar.gz.
File metadata
- Download URL: finetune_lab-0.3.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d16cb91ef409a3789bce6324f97bea1039450fac0776de03659fa689545c35
|
|
| MD5 |
db8f81145c80a5e99ac927e869762659
|
|
| BLAKE2b-256 |
043b9e666f565a5d201f7c6958a06c45eeb1a3c09c213c5a54f7f6ccd95895c8
|
File details
Details for the file finetune_lab-0.3.0-py3-none-any.whl.
File metadata
- Download URL: finetune_lab-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.3 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 |
09c024e94b0fcfb631770c79cfdbdc868a93bbc8e2111861cb4b25457433672e
|
|
| MD5 |
1b55429071c517cc7566dceb2f84f033
|
|
| BLAKE2b-256 |
2ab01f4f9e162abd2833f3f7fe24751d96597b44b45f445876583204c2880fc6
|