1from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
2
3model_id = "kurakurai/Luth-2-0.8B"
4model = AutoModelForCausalLM.from_pretrained(
5 model_id,
6 device_map="auto",
7 dtype="bfloat16",
8 # attn_implementation="flash_attention_2" # uncomment on compatible GPU
9)
10tokenizer = AutoTokenizer.from_pretrained(model_id)
11streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
12
13prompt = "Quelle est la capitale de la France?"
14input_ids = tokenizer.apply_chat_template(
15 [{"role": "user", "content": prompt}],
16 add_generation_prompt=True,
17 return_tensors="pt",
18 tokenize=True,
19)["input_ids"].to(model.device)
20
21output = model.generate(
22 input_ids,
23 do_sample=True,
24 temperature=0.8,
25 top_p=0.95,
26 top_k=20,
27 max_new_tokens=512,
28 streamer=streamer,
29)
Evaluations can be reproduced using our
GitHub repository. The benchmarks are French subsets or verified translations, scored with
temperature=0.6, top_p=0.95, top_k=20, thinking disabled, averaged over 10 runs.
See the
French LLM Leaderboard for comparisons across models.
Questions or feedback? Reach us on LinkedIn:
Maxence Lasbordes and
Guillaume Pradel.
1@misc{luth2,
2 title = {Luth-2: Pushing the French Capabilities of SLMs with MOPD},
3 author = {Maxence Lasbordes and Guillaume Pradel},
4 year = {2026},
5 url = {https://huggingface.co/blog/MaxLSB/luth-2}
6}