Skip to main content

slick-tune logo

SlickTune 🧩: Composable LLM fine-tuning by SlickML

Fine-tuning is an orthogonal stack — swap any axis without rewriting the others:

model  ×  strategy  ×  objective  ×  data  ×  metrics

🧠 Philosophy

slick-tune is a small, composable toolkit for teaching LLMs new facts and behaviors with Transformers + PEFT + TRL. LoRA / QLoRA are PEFT adapters; full FT updates every weight. The goal is the same SlickML spirit: prototype fast 🏎, keep axes orthogonal, and measure whether the model actually learned your facts 🔎.

🧩 Abstractions

flowchart TB
  subgraph inputs [Inputs]
    modelId[model_id]
    dataJsonl[data JSONL]
  end

  subgraph axes [Composable axes]
    strategyNode["Strategy: LoRA / QLoRA / Full"]
    objectiveNode["Objective: SFT then DPO / GRPO"]
  end

  subgraph core [Tuner fit]
    tuner[Tuner]
    loadStep[load model and tokenizer]
    applyStep[strategy.apply]
    trainStep[TRL trainer]
    metricsStep[MetricsTracker]
  end

  subgraph outputs [Outputs]
    checkpoint[adapter or checkpoint]
    metricsFile[metrics.json]
    probeRate[probe pass rate]
  end

  modelId --> tuner
  dataJsonl --> tuner
  strategyNode --> tuner
  objectiveNode --> tuner
  tuner --> loadStep --> applyStep --> trainStep --> metricsStep
  trainStep --> checkpoint
  metricsStep --> metricsFile
  checkpoint --> probeRate
Axis Responsibility Phase 1
Strategy How weights change (PEFT vs full) LoRAStrategy, QLoRAStrategy, FullStrategy
Objective What is optimized / data contract SFTObjective (DPO stubbed)
Data Examples → chat messages load_sft_jsonl
Metrics Comparable run stats MetricsTracker
Probe Did the model learn your facts? slick-tune probe

📌 Quick Start

from slicktune import LoRAStrategy, SFTObjective, Tuner

Tuner(
    model_id="HuggingFaceTB/SmolLM2-135M-Instruct",
    strategy=LoRAStrategy(r=8),
    objective=SFTObjective(),
    output_dir="outputs/sft_lora",
).fit("examples/data/about_amir.jsonl")
  1. Edit examples/data/about_amir.jsonl with facts about you (or keep the SlickML starter facts) ✍️.
  2. Edit examples/data/about_amir.probes.jsonl with questions and a must_contain substring that should appear after training 🎯.
  3. Train a strategy on a tiny instruct model 🧪.
  4. Probe the checkpoint — pass rate shows whether fine-tuning stuck ✅.
before FT  →  model guesses / hallucinates about you
after FT   →  probe answers contain your facts

🛠 Installation

Install Python >=3.10,<3.13 and uv, then simply run 🏃‍♀️:

uv sync

QLoRA (CUDA + bitsandbytes only) 🔥:

uv sync --extra qlora

Task runner is Poe the Poet (same idea as slick-ml, with uv instead of Poetry). Install the CLI once 🏃‍♀️:

uv tool install poethepoet
poe greet

Developer workflow (format / check / test) lives in CONTRIBUTING.md 🧑‍💻🤝.

🚂 Train each strategy

Default demo model: HuggingFaceTB/SmolLM2-135M-Instruct (small enough for laptop smoke tests) 💻.

🟢 LoRA + SFT (default — works on Mac MPS / CPU / CUDA)

uv run slick-tune train \
  --strategy lora \
  --data examples/data/about_amir.jsonl \
  --output outputs/sft_lora \
  --epochs 20

uv run slick-tune probe \
  --model-dir outputs/sft_lora \
  --probes examples/data/about_amir.probes.jsonl

Or: poe train-lora / poe probe-lora / uv run python examples/run_sft_lora.py

🔵 QLoRA + SFT (CUDA required)

uv sync --extra qlora
uv run python examples/run_sft_qlora.py

On Apple Silicon, use LoRA instead — bitsandbytes 4-bit needs CUDA 🍎.

🟠 Full fine-tuning + SFT

uv run python examples/run_sft_full.py

Heavier on memory; prefer LoRA for iteration 💾.

📦 Data formats

SFT JSONL (any of these per line) 📝:

{"messages":[{"role":"user","content":"..."},{"role":"assistant","content":"..."}]}
{"prompt":"...","response":"..."}
{"instruction":"...","input":"...","output":"..."}

Probe JSONL 🕵️:

{"prompt":"Who is Amirhessam Tahmassebi?","must_contain":"SlickML"}

🗺 Roadmap

Phase Scope
0–1 (now) Skeleton, SFT + LoRA/QLoRA/full, metrics, personal probe loop
2 DoRA / AdaLoRA, richer eval
3 DPO / ORPO / KTO
4 GRPO / verifiable RL
5 Merge (TIES/DARE), multi-adapter
6 Optional PPO / multimodal

🧑‍💻🤝 Contributing to slick-tune

You can find the details of the development process in our Contributing guidelines. We strongly believe that reading and following these guidelines will help us make the contribution process easy and effective for everyone involved 🚀🌙.

Conventions in short: @dataclass classes, numpydoc docstrings, full type hints via ruff (ANN) + mypy, assertpy in tests (see .cursor/rules/).

❓ 🆘 📲 Need Help?

Please join our Slack Channel to interact directly with the core team and our small community. This is a good place to discuss your questions and ideas or in general ask for help 👨‍👩‍👧 👫 👨‍👩‍👦.

Metadata

Release files for slicktune 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slicktune 0.1.0
File Size Uploaded
slicktune-0.1.0.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slicktune 0.1.0
File Interpreter ABI Platform
slicktune-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.3 kB

Release files / slicktune-0.1.0.tar.gz

Download URL slicktune-0.1.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
82d3ccf9871e78eded4905d5f693547f7e2f72b6156993091da58fbab390e922
BLAKE2b-256 checksum
How to use checksums
f96926ae9cc602bfeebfd8425eb20a930503a3ba3141df1c34f552be8d7bd7f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / slicktune-0.1.0-py3-none-any.whl

Download URL slicktune-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27c259fdcbda45800c88d008d119871414e33683c9ffef62013e69b95d76e718
BLAKE2b-256 checksum
How to use checksums
cd152095cee33f361ceb6dce7e74969c542fd473816adb2864814df842d9e464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page