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
Metadata
Release files for finetune-lab 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| finetune_lab-0.6.0.tar.gz | 16.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| finetune_lab-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.4 kB
Release files / finetune_lab-0.6.0.tar.gz
| Download URL | finetune_lab-0.6.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c376f25f72d21140763d79346ca242fa35c4e8e8fa0dc02152127c18b0ab6722
|
|
BLAKE2b-256 checksum How to use checksums |
8952294bcbe610ea04228de941b295f0fbc64e107a0e2b20b43bc5026f288f90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / finetune_lab-0.6.0-py3-none-any.whl
| Download URL | finetune_lab-0.6.0-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38d849badf15f416e0e36006029cd8675bfb5c693e27c33239387853da396e2d
|
|
BLAKE2b-256 checksum How to use checksums |
5d633f852c5b70ecde42590cc559f1223bfb9c4bf5bd68b22f6a0a6bda9d18dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for finetune-lab 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.