Metadata-Version: 2.4
Name: langtune
Version: 0.1.33
Summary: Efficient LoRA Fine-Tuning for Large Language Models - Train smarter, not harder.
Author-email: Pritesh Raj <priteshraj41@gmail.com>
Maintainer-email: Langtrain AI <contact@langtrain.ai>
License: MIT License
        
        Copyright (c) 2025 Pritesh Raj
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/langtrain-ai/langtune
Project-URL: Documentation, https://github.com/langtrain-ai/langtune/tree/main/docs
Project-URL: Repository, https://github.com/langtrain-ai/langtune
Project-URL: Changelog, https://github.com/langtrain-ai/langtune/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/langtrain-ai/langtune/issues
Keywords: llm,lora,fine-tuning,machine-learning,deep-learning,transformers,nlp,language-model,pytorch,rlhf,dpo,ppo
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=1.10
Requires-Dist: numpy
Requires-Dist: tqdm
Requires-Dist: pyyaml
Requires-Dist: scipy
Requires-Dist: wandb
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: isort; extra == "dev"
Provides-Extra: all
Requires-Dist: transformers; extra == "all"
Requires-Dist: datasets; extra == "all"
Requires-Dist: accelerate; extra == "all"
Requires-Dist: bitsandbytes; extra == "all"
Dynamic: license-file

<div align="center">

<img src="https://raw.githubusercontent.com/langtrain-ai/langtune/main/static/langtune-white.png" alt="Langtune" width="400" />

<h3>The fastest way to fine-tune LLMs</h3>

<p>
  <strong>Production-ready LoRA fine-tuning in minutes, not days.</strong><br>
  Built for ML engineers who need results, not complexity.
</p>

<p>
  <a href="https://www.producthunt.com/products/langtrain-2" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1049974&theme=light" alt="Product Hunt" width="200" /></a>
</p>

<p>
  <a href="https://pypi.org/project/langtune/"><img src="https://img.shields.io/pypi/v/langtune.svg?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI" /></a>
  <a href="https://pepy.tech/project/langtune"><img src="https://img.shields.io/pepy/dt/langtune?style=for-the-badge&logo=python&logoColor=white&label=downloads" alt="Downloads" /></a>
  <a href="https://github.com/langtrain-ai/langtune/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="License" /></a>
</p>

<p>
  <a href="#quick-start">Quick Start</a> •
  <a href="#features">Features</a> •
  <a href="#why-langtune">Why Langtune</a> •
  <a href="https://langtrain.xyz/docs">Docs</a>
</p>

</div>

---

## ⚡ Quick Start

### 1-Click Install (Recommended)
The fastest way to get started. Installs Langtune in an isolated environment.

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

### Or using pip
```bash
pip install langtune
```

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

```python
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

<table>
<tr>
<td width="50%">

### 🚀 **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.

</td>
<td width="50%">

### 🔧 **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.

</td>
</tr>
</table>

---

## 🎯 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

```python
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

<details>
<summary><b>Custom Dataset Format</b></summary>

```python
# JSONL format (recommended)
{"text": "Your training example here"}
{"text": "Another example"}

# Or instruction format
{"instruction": "Summarize this:", "input": "Long text...", "output": "Summary"}
```

</details>

<details>
<summary><b>Distributed Training</b></summary>

```python
trainer = LoRATrainer(
    model_name="meta-llama/Llama-2-70b-hf",
    device_map="auto",  # Automatic multi-GPU
)
```

</details>

<details>
<summary><b>Export Formats</b></summary>

```python
# Export to different formats
trainer.export("gguf")  # For llama.cpp
trainer.export("onnx")  # For ONNX Runtime
trainer.export("hf")    # HuggingFace format
```

</details>

---

## 🤝 Community

<p align="center">
  <a href="https://discord.gg/langtrain">Discord</a> •
  <a href="https://twitter.com/langtrainai">Twitter</a> •
  <a href="https://langtrain.xyz">Website</a>
</p>

---

<div align="center">

**Built with ❤️ by [Langtrain AI](https://langtrain.xyz)**

*Making LLM fine-tuning accessible to everyone.*

</div>
