Skip to main content

Note: langtune is now part of the unified langtrain SDK. pip install "langtrain-ai[train]" adds AdaptiveRank and DatasetIntelligence on top of langtune. langtune continues to receive updates and remains fully supported.


Langtune

The fastest way to fine-tune LLMs

Production-ready LoRA fine-tuning in minutes, not days.
Built for ML engineers who need results, not complexity.

Product Hunt

PyPI Downloads License

Quick Start • Features • Why Langtune • Docs


⚡ Quick Start

The fastest way to get started. Installs Langtune in an isolated environment.

curl -fsSL https://raw.githubusercontent.com/langtrain-ai/langtrain_langtune/main/scripts/install.sh | bash

Or using pip

pip install langtune

Fine-tune your first model in 3 lines of code:

from langtune import LoRATrainer

trainer = LoRATrainer(model_name="meta-llama/Llama-2-7b-hf")
trainer.train_from_file("data.jsonl")

That's it. Your fine-tuned model is ready.


✨ Features

🚀 Blazing Fast

Train 7B models in under 30 minutes on a single GPU. Our optimized kernels squeeze every last FLOP.

🎯 Zero Config Required

Smart defaults that just work. No PhD required. Start training in seconds.

💾 Memory Efficient

4-bit quantization + gradient checkpointing = Train 70B models on consumer hardware.

🔧 Production Ready

Battle-tested at scale. Used by teams fine-tuning thousands of models daily.

🌐 Any Model, Any Data

Works with Llama, Mistral, Qwen, Phi, and more. JSONL, CSV, or HuggingFace datasets.

☁️ Cloud Native

One-click deployment to Langtrain Cloud. Or export to GGUF, ONNX, HuggingFace.


🎯 Why Langtune?

Langtune Others
Time to first training 30 seconds 2+ hours
Lines of code 3 100+
Memory usage 8GB 24GB+
Learning curve Minutes Days

📖 Full Example

from langtune import LoRATrainer
from langtune.config import TrainingConfig, LoRAConfig

# Configure your training
config = TrainingConfig(
    num_epochs=3,
    batch_size=4,
    learning_rate=2e-4,
    lora=LoRAConfig(rank=16, alpha=32)
)

# Initialize and train
trainer = LoRATrainer(
    model_name="mistralai/Mistral-7B-v0.1",
    output_dir="./my-model",
    config=config
)

# Train on your data
trainer.train_from_file("training_data.jsonl")

# Push to Hub (optional)
trainer.push_to_hub("my-username/my-fine-tuned-model")

🛠️ Advanced Usage

Custom Dataset Format
# JSONL format (recommended)
{"text": "Your training example here"}
{"text": "Another example"}

# Or instruction format
{"instruction": "Summarize this:", "input": "Long text...", "output": "Summary"}
Distributed Training
trainer = LoRATrainer(
    model_name="meta-llama/Llama-2-70b-hf",
    device_map="auto",  # Automatic multi-GPU
)
Export Formats
# Export to different formats
trainer.export("gguf")  # For llama.cpp
trainer.export("onnx")  # For ONNX Runtime
trainer.export("hf")    # HuggingFace format

🤝 Community

Discord • Twitter • Website


Built with ❤️ by Langtrain AI

Making LLM fine-tuning accessible to everyone.

Metadata

Release files for langtune 0.1.48

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

Source distribution (sdist)

Source distribution for langtune 0.1.48
File Size Uploaded Provenance Actions
langtune-0.1.48.tar.gz 120.0 kB Without provenance Details for langtune-0.1.48.tar.gz

Built distribution (wheel)

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

Total release size: 253.7 kB

Release files / langtune-0.1.48.tar.gz

Download URL langtune-0.1.48.tar.gz
Size 120.0 kB
Tags Source
SHA-256 checksum
How to use checksums
def5a8a5202b1097650b3f2ac8a099903d552c6d14013f563715150a7cbff8a7
BLAKE2b-256 checksum
How to use checksums
e86be0ed5f0b2b86d25c75a1c4abf4b9cfdd593c0b189d8e80b97fbe5bb66399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / langtune-0.1.48-py3-none-any.whl

Download URL langtune-0.1.48-py3-none-any.whl
Size 133.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
601adf6f34e438e4112a684e89402bafdd527b9c3c10f1396709fde248afadc6
BLAKE2b-256 checksum
How to use checksums
5ed1919e031c9ec98cb7bc5d3b87797703264c7b6790b9612a4fedc3781da450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for langtune 0.1.48

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.

Release history Release notifications | RSS feed

This release

0.1.48 This release

2 release files No provenance

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