A 144M-parameter French language model fully designed, implemented, and trained by Eric Houzelle. Every component — architecture, training pipeline, and inference engine — was written in PyTorch without relying on any pre-trained weights or third-party model code.
Klovis demonstrates that a single engineer can deliver a complete, modern Transformer with state-of-the-art architectural components, trained end-to-end on a single NVIDIA L40S GPU for a total compute budget of approximately €50.
1from transformers import AutoModelForCausalLM, AutoTokenizer
23model_id ="Klovis-ai/Klovis-144M-french"45tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)6model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)78prompt ="La France est un pays"9inputs = tokenizer(prompt, return_tensors="pt")10outputs = model.generate(11 inputs["input_ids"],12 max_new_tokens=100,13 temperature=0.7,14 top_p=0.9,15)16print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Conversational Mode (ChatML)
The model was fine-tuned with ChatML formatting for assistant-style interactions:
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
23model_id ="Klovis-ai/Klovis-144M-french"4tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)5model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)67prompt =(8"<|system|>\n"9"Tu es un assistant utile et concis. Réponds en français.<|end|>\n"10"<|user|>\n"11"Quelle est la capitale de la France ?<|end|>\n"12"<|assistant|>\n"13)1415inputs = tokenizer(prompt, return_tensors="pt")16outputs = model.generate(17 inputs["input_ids"],18 max_new_tokens=150,19 temperature=0.7,20 top_p=0.9,21 do_sample=True,22)23print(tokenizer.decode(outputs[0], skip_special_tokens=False))
Special Tokens
Token
Role
<|system|>
Start of system message
<|user|>
Start of user message
<|assistant|>
Start of assistant response
<|end|>
End of turn
Architecture
Klovis implements a decoder-only Transformer using the same building blocks found in LLaMA, Mistral, and Gemma — scaled down to a compact 144M-parameter footprint:
Component
Detail
Embedding dim
768
Transformer layers
14
Query heads
12
KV heads (GQA)
4
FFN hidden dim
3072
FFN activation
SwiGLU
Normalization
RMSNorm (pre-norm)
Position encoding
RoPE (Rotary Position Embedding)
Weight tying
Input embeddings ↔ output projection
Grouped-Query Attention (GQA): 12 query heads share 4 KV heads, reducing KV-cache memory by 3× while preserving attention capacity.
The codebase also implements an experimental Recurrent-Depth Transformer mode (inspired by OpenMythos/Parcae, Prairie et al. 2026), where a single Transformer block is applied iteratively:
The pre-trained model was fine-tuned on 6 curated French conversational datasets across 15 epochs, with prompt masking so that only assistant tokens contribute to the loss.
Klovis is a technical demonstration — showing that a single engineer can design, train, and deploy a modern Transformer on a single GPU for under €50.
With 144M parameters, the model is capable of:
Generating grammatically correct French text
Following the ChatML conversational format
Producing coherent responses on simple topics
Known limitations:
Factual responses are frequently incorrect or fabricated (hallucinations)
Logical reasoning is limited
Responses can be repetitive or drift off-topic
Context limited to 256 tokens
French only
This model is a demonstration of what a single developer can achieve with a modern architecture at small scale. It is not intended to replace larger models for production use.
Technical Details
Implementation Highlights
Custom implementation: every component (attention, RoPE, RMSNorm, SwiGLU, GQA, training loop, generation) is implemented in PyTorch — no external model code
Hugging Face compatible: inherits from PreTrainedModel and GenerationMixin, works with AutoModelForCausalLM
KV-cache inference: supports incremental decoding for efficient generation
Multiple weight-sharing modes: standard, shared FFN, full sharing, and Recurrent-Depth
Streaming chat: interactive CLI with real-time token-by-token output
Monitoring: integrated with Trackio for live training dashboards