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.52

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.52
File Size Uploaded Provenance Actions
langtune-0.1.52.tar.gz 120.0 kB Without provenance Details for langtune-0.1.52.tar.gz

Built distribution (wheel)

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

Total release size: 253.7 kB

Release files / langtune-0.1.52.tar.gz

Download URL langtune-0.1.52.tar.gz
Size 120.0 kB
Tags Source
SHA-256 checksum
How to use checksums
31f3622475a0a4a45f5bb3a7a08e0955d3fbaeb00c4922fb80faf91def0a1d0f
BLAKE2b-256 checksum
How to use checksums
ed2d2cca3736b74e811df46ad1eff664231ebf07ec74acd5b4982e9fff2edc74
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.52-py3-none-any.whl

Download URL langtune-0.1.52-py3-none-any.whl
Size 133.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39d45ff72e7b0a630dc6bdb66ebc9e5f3c765bef6d85c85b93d8bf993edf946e
BLAKE2b-256 checksum
How to use checksums
4494f8f3d4fb4aef7c7742af49b6d8b042ce9d12858ebba39cce3904d4081c09
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.52

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.52 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