Skip to main content

Efficient LoRA Fine-Tuning for Large Language Models - Train smarter, not harder.

Project description

Note: langtune is now part of the unified langtrain SDK. pip install langtrain[train] includes everything from langtune plus AdaptiveRank, DatasetIntelligence, and vision LLM support. 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 StartFeaturesWhy LangtuneDocs


⚡ Quick Start

1-Click Install (Recommended)

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

curl -fsSL https://raw.githubusercontent.com/langtrain-ai/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

DiscordTwitterWebsite


Built with ❤️ by Langtrain AI

Making LLM fine-tuning accessible to everyone.

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

langtune-0.1.43.tar.gz (118.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langtune-0.1.43-py3-none-any.whl (133.8 kB view details)

Uploaded Python 3

File details

Details for the file langtune-0.1.43.tar.gz.

File metadata

  • Download URL: langtune-0.1.43.tar.gz
  • Upload date:
  • Size: 118.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for langtune-0.1.43.tar.gz
Algorithm Hash digest
SHA256 0b465855059b0ec7b20d297276130e1d869e65720d778efd3626459adf861612
MD5 95cb3ba65e7e4f0ce903befdea2d23fb
BLAKE2b-256 99c4a66ca6838851b8f2caebb6af8561c983a7e4542957c79d1075d7839931fe

See more details on using hashes here.

File details

Details for the file langtune-0.1.43-py3-none-any.whl.

File metadata

  • Download URL: langtune-0.1.43-py3-none-any.whl
  • Upload date:
  • Size: 133.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for langtune-0.1.43-py3-none-any.whl
Algorithm Hash digest
SHA256 5afb0e8be25594879f348cd1231ca30efd5180e371a0571caf8f97af9f10ef0c
MD5 24abe496739de7af8345c0335fa65738
BLAKE2b-256 e09aed330eea097e575164b5f27eaf2db3b831fddfdbd486966e2840806db841

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page