Prototype: votes, saves, and profiles aren't stored on this hosted preview yet. No real accounts, and no emails or texts. Privacy

Recipes / Customer-support chat

Documentation chatbot from your own documents (HF Cookbook)

Llama 3.2 3B fine-tuned on question-and-answer pairs that Meta's Synthetic Data Kit generates from a document you give it.

  • Custom license
  • No license stated

Source: HF Cookbook ↗ · by Alan Ponnachan · last updated Jan 7, 2026

What a local business could build with it

Turn a handbook, price list or policy PDF into training questions and answers automatically, then tune a small model that knows your business. You still review the generated pairs.

How to run it

Commands are copied from the source, unchanged except where a notebook cell is cut at 40 lines (marked in the code). Placeholders like <you> are the source's own. Credit goes to the authors named on each block.

Install (as written in the notebook)

%%capture # In Colab, we skip dependency installation to avoid conflicts with preinstalled packages. # On local machines, we include dependencies for completeness. import os if "COLAB_" not in "".join(os.environ.keys()): !pip install unsloth vllm==0.8.2 else: !pip install --no-deps unsloth vllm==0.8.2 # Get https://github.com/meta-llama/synthetic-data-kit !pip install synthetic-data-kit

From HF Cookbook, fine_tune_chatbot_docs_synthetic ↗

Load the base model

from unsloth import FastLanguageModel import torch model, tokenizer = FastLanguageModel.from_pretrained( model_name = "unsloth/Llama-3.2-3B-Instruct", max_seq_length = 1024, # Choose any for long context! load_in_4bit = True, # 4 bit quantization to reduce memory load_in_8bit = False, # [NEW!] A bit more accurate, uses 2x memory full_finetuning = False, # [NEW!] We have full finetuning now! )

From HF Cookbook, fine_tune_chatbot_docs_synthetic ↗

Set up training

from trl import SFTTrainer, SFTConfig trainer = SFTTrainer( model = model, processing_class = tokenizer, train_dataset = dataset, eval_dataset = None, # Can set up evaluation! args = SFTConfig( dataset_text_field = "text", per_device_train_batch_size = 2, gradient_accumulation_steps = 4, # Use GA to mimic batch size! warmup_steps = 5, max_steps = 60, learning_rate = 2e-4, logging_steps = 1, optim = "adamw_8bit", weight_decay = 0.01, lr_scheduler_type = "linear", seed = 3407, report_to = "none", # Use this for WandB etc ), )

From HF Cookbook, fine_tune_chatbot_docs_synthetic ↗

Train

trainer_stats = trainer.train()

From HF Cookbook, fine_tune_chatbot_docs_synthetic ↗

Licenses

License flags to read before commercial use:

  • Model: Custom license: read it before commercial use. Llama 3.2 Community License
  • Dataset: No license stated. Generated from the documents you supply; the example's source docs weren't license-checked
PartLicense, as the source or Hub states it
CodeApache-2.0 (huggingface/cookbook)
Base modelLlama 3.2 Community License
DatasetGenerated from the documents you supply; the example's source docs weren't license-checked

Checked against the Hugging Face API and each repo on December 4, 2026. A grouping like “$10M revenue cap” is our shorthand, not legal advice.