Examples (low code)

Calling public APIs is easy, but you pay for it with high costs, slow responses, limited control, and no real ownership - real control comes from building your own models. When you need faster, cheaper, domain-specific AI, training your own model gives you the edge.

These guides show you how to go from calling APIs to building your own custom models - fast, cleanly with a low-code experience

Why train your own models

Public LLMs are powerful generalists, but they aren't always the best fit for specific tasks like protein folding, financial forecasting, document classification, recommendation systems, or any domain where precision, speed, cost, or privacy really matter. When you need domain expertise, faster responses, lower costs, or full control over your AI system, training your own model gives you an edge.

Better with Lightning

Lightning makes scalable pretraining accessible to all via LitGPT. LitGPT allows you to focus on building great models - Lightning handles the rest.

1/3
2/3
3/3
mkdir -p custom_texts
curl https://www.gutenberg.org/cache/epub/24440/pg24440.txt --output custom_texts/book1.txt
curl https://www.gutenberg.org/cache/epub/26393/pg26393.txt --output custom_texts/book2.txt

litgpt pretrain EleutherAI/pythia-160m \
  --tokenizer_dir EleutherAI/pythia-160m \
  --initial_checkpoint_dir EleutherAI/pythia-160m \
  --data TextFiles \
  --data.train_data_path "custom_texts/" \
  --train.max_tokens 10_000_000 \
  --out_dir out/custom-model

litgpt chat out/custom-model/final

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close