Train and deploy your first custom AI model in under 5 minutes. No infrastructure required.
Install the Langtrain SDK using pip. We recommend doing this inside a virtual environment.
1pip install langtrain-ai
Create a .jsonl file. Each line must be a JSON object with a messages array in standard OpenAI format.
1{"messages": [{"role": "user", "content": "What is Langtrain?"}, {"role": "assistant", "content": "It's a platform for fine-tuning LLMs."}]}2{"messages": [{"role": "user", "content": "How do I start?"}, {"role": "assistant", "content": "Use the LoRATrainer class!"}]}
Use the LoRATrainer to fine-tune your model. LoRA trains only a fraction of the parameters, making it insanely fast and memory-efficient.
1from langtrain import LoRATrainer23trainer = LoRATrainer(4 model="meta-llama/Llama-3.3-8B",5 output_dir="./my-model"6)78# Start training!9trainer.train("training_data.jsonl")
Push your trained model directly to Langtrain Cloud for instant production inference.
1# Deploy to Langtrain Cloud2trainer.push("my-custom-model")34# Your model is now available via REST API!