Langtrain Logo
Langtrain
PricingDocsBlog
Sign inStart training

Langtune·Open-source library

Fine-tune open modelson your own GPU.

Langtune is an open-source Python library for fine-tuning text models like Llama, Mistral, Qwen and Phi. It runs on your machine, so your training data stays there, and the weights you train are files you keep.

Read the docsView on GitHub
train.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from langtune import FastLanguageModel

# Load an open model in 4-bit
model, tokenizer = FastLanguageModel.from_pretrained(
    "meta-llama/Llama-3.1-8B",
    load_in_4bit=True,
)

# Add a LoRA adapter
model = FastLanguageModel.get_peft_model(model, r=16, method="qlora")

# Train on your data; the adapter is saved to ./output
FastLanguageModel.train(
    model, tokenizer, dataset,
    output_dir="./output",
)

What you get

Sensible defaults. Your hardware.

  • Runs locally

    Training happens on your GPU. A run only goes to the cloud when a Langtrain API key is set.

  • Fits smaller GPUs

    Models load in 4-bit with FlashAttention 2 and gradient checkpointing on by default, to keep memory use down.

  • Cloud when you need it

    Need a bigger GPU? Start the run on Langtrain's GPUs from the dashboard, then take the weights back.

  • Your data as it is

    Train from JSONL, CSV or a Hugging Face dataset, in plain text or instruction format.

  • Adapters or preferences

    Pick a method per run: LoRA-style adapters, or preference training like DPO.

  • MIT licensed

    Read the code, change it, and use it commercially.

Training methods

Eight methods. One argument.

Change method= to switch. The rest of your script stays the same.

  • LoRASmall adapter on a frozen model
  • QLoRALoRA on a 4-bit model; the default
  • DoRAWeight-decomposed LoRA
  • IA³Even fewer trainable parameters
  • Prefix tuningLearned prompt vectors
  • DPOLearn from preferred answers
  • ORPOPreferences without a reference model
  • KTOLearn from thumbs up / down

The Langtrain family

Four ways in. One model you own.

Use whichever fits how you work. They share one account and one API, so a run started in the cloud from any of them shows up in all of them.

  • Langtrain StudioDesktop appManage datasets and fine-tuning runs from a native app for Windows and Linux.
  • Langtrain SDKPython & TypeScriptUpload data, fine-tune and follow runs from code, with the lt command line.
  • You're hereLangtuneOpen-source libraryFine-tune open text models like Llama, Mistral and Qwen on your own GPU.
  • LangvisionOpen-source libraryFine-tune vision-language models like LLaVA and Qwen-VL on your own images.

Train your firstmodel tonight.

Install it, point it at your data, and run. The docs give the one-line install with the Hugging Face libraries it trains with.

Read the docsView on GitHub
Langtrain Logo
Langtrain

The fine-tuning platform for production LLMs.
Built for builders who demand sovereignty.

  • Github
  • HuggingFace
System status

Product

  • Langtrain Studio
  • Langtrain SDK
  • Langtune
  • Langvision
  • Model Hub
  • Downloads
  • Pricing
  • Enterprise

Use Cases

  • Customer Support AI
  • Internal Code Assistants
  • Healthcare
  • Financial Services
  • Legal Document QA
  • E-Commerce & Retail
  • Education & EdTech
  • Manufacturing
  • Research & Data Teams
  • All Use Cases

Resources

  • Documentation
  • Quick Start
  • API Reference
  • Python SDK
  • Node SDK
  • Blog(opens in a new tab)
  • ComparisonsNew
  • GlossaryNew
  • Changelog
  • Status

Company

  • About Us
  • Careers
  • Contact
  • Community
  • Support
Langtrain

© 2026 QUADTREE AI TECHNOLOGIES PRIVATE LIMITED.

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Data Processing Agreement
  • Made with ♥love in India