Instructions to use racineai/Berthier-Mistral-Military-24B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use racineai/Berthier-Mistral-Military-24B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="racineai/Berthier-Mistral-Military-24B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("racineai/Berthier-Mistral-Military-24B") model = AutoModelForMultimodalLM.from_pretrained("racineai/Berthier-Mistral-Military-24B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use racineai/Berthier-Mistral-Military-24B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "racineai/Berthier-Mistral-Military-24B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "racineai/Berthier-Mistral-Military-24B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/racineai/Berthier-Mistral-Military-24B
- SGLang
How to use racineai/Berthier-Mistral-Military-24B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "racineai/Berthier-Mistral-Military-24B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "racineai/Berthier-Mistral-Military-24B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "racineai/Berthier-Mistral-Military-24B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "racineai/Berthier-Mistral-Military-24B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use racineai/Berthier-Mistral-Military-24B with Docker Model Runner:
docker model run hf.co/racineai/Berthier-Mistral-Military-24B
Berthier-Mistral-Military-24B
Berthier-Mistral-Military-24B is a 24-billion-parameter French-first language model for the defense and security domain. Built on mistralai/Mistral-Small-3.1-24B-Base-2503, continued-pretrained on ≈4 B tokens of open-source military content and TIES-merged with the -Instruct variant to preserve conversational ability.
Released by Racine.ai.
Key findings
- +6.7 pp over base Mistral-Small-3.1 on Hard Mil Bench (57.6% vs 50.9%), consistent with published continued-pretraining deltas (Meditron-70B reports +6 pp on MedQA at 48 B tokens).
- On the open-source Pareto frontier at 24 B, matching Mistral-Small 4 (≈119 B) and trailing Mistral-Large 3 (≈675 B) by ≈5 pp at 5× to 28× fewer parameters.
- Outperforms newer-generation open-source models Gemma 4 31B and Qwen 3.5 27B (both larger and released after Berthier's base model) as well as closed-source Claude Haiku 4.5, on Hard Mil Bench.
English
Summary
Berthier-Mistral-Military-24B is a 24-billion-parameter language model specialised for the defense and security domain, with focus on French and NATO military doctrine, equipment, and institutional vocabulary. It is the result of continued pre-training on a multilingual corpus of open-source military content, followed by a final TIES merge that blends the domain-adapted weights with the instruct variant of the base model.
Intended use
Research and education only. Envisioned use cases:
- Research assistance in defense policy, strategic studies, military history.
- Educational tool for higher-military education (IHEDN, École de Guerre, staff colleges).
- Revision aid for officer trainees and students in military academies.
- Reference benchmark for research on domain adaptation of LLMs.
Out-of-scope uses
Berthier-Mistral-Military-24B is not intended for:
- Generating target lists or informing target-selection decisions.
- Integration into fire-control or autonomous weapon systems.
Any use in armed conflict must comply with International Humanitarian Law (distinction, proportionality, precaution). Users remain fully responsible for the consequences of outputs they rely on.
Training data
The CPT corpus covers approximately 4 billion tokens of open-source military and defense content, spanning 30 languages (French and English dominant, followed by Russian, Chinese, German, Ukrainian, Arabic, Turkish, Polish, Hebrew, and others).
Training procedure (high-level)
- Continued pre-training via LoRA adapters on
mistralai/Mistral-Small-3.1-24B-Base-2503, one epoch over the ≈4 B-token corpus, on an 8×H200 GPU cluster. - LoRA merge: the CPT adapters are merged back into the base model weights, producing a domain-adapted dense model.
- TIES merge between the domain-adapted model and
mistralai/Mistral-Small-3.1-24B-Instruct-2503, to retain instruction-following and general-purpose conversational ability while keeping the domain knowledge acquired.
Evaluation
Berthier was evaluated on Hard Mil Bench, a 561-item open-ended benchmark (314 FR / 247 EN). Strictly deterministic scoring, no LLM judge, no multiple-choice: normalised substring match for short_answer / cloze / enum, F1 ≥ 2/3 for set, strict ordered match for permutation.
Global results (accuracy ≥ 0.5):
| Model | Global | FR (n=314) | EN (n=247) |
|---|---|---|---|
| Gemini 3 Flash (closed, top reference) | 72.4% | 69.7% | 75.7% |
| GPT-5.4 mini (closed) | 66.7% | 61.1% | 73.7% |
| Mistral-Large 3 (≈675B) | 62.8% | 60.8% | 65.1% |
| Mistral-Small 4 (≈119B) | 58.1% | 57.3% | 59.1% |
| Berthier-Mistral-Military-24B (this model) | 57.6% | 55.1% | 60.7% |
| Gemma 4 31B | 54.4% | 52.5% | 56.7% |
| Mistral-Small 3.1 (base, 24B) | 50.9% | 49.0% | 53.3% |
| Claude Haiku 4.5 | 48.1% | 48.1% | 48.2% |
| Qwen 3.5 27B | 47.8% | 44.3% | 52.2% |
Gain over the base model: +6.7 pp (57.6% vs 50.9%).
Qualitative examples
Examples where Berthier succeeds on items the base model fails:
Example 1 (FR, French equipment)
Q: « Le micro-drone de contact quadrirotor utilisé en reconnaissance rapprochée par les sections d'infanterie françaises est le ____ »
Gold:
NX70
- Base Mistral-Small-3.1 →
Patroller(incorrect: Patroller is a MALE long-endurance drone, not a micro-drone)- Berthier-Mistral-Military-24B →
NX70
Example 2 (FR, French military institution)
Q: « Le service public chargé de l'action sociale au profit des militaires et de leurs familles (logements, crèches, vacances) est l'____ »
Gold:
IGESA
- Base →
Service des ressources humaines de la ministère des armées(hallucinated)- Berthier →
Institution de gestion sociale des armées (IGeSA)
Example 3 (EN, French Navy programme)
Q: "The new French nuclear-powered attack submarine of the Barracuda programme, lead boat commissioned in 2022, is named the ____."
Gold:
Suffren
- Base →
SNLE 3G Le Terrible(incorrect: a ballistic-missile submarine class, not an attack submarine)- Berthier →
Suffren
Usage
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch
model_id = "racineai/Berthier-Mistral-Military-24B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto"
)
messages = [
{"role": "system", "content": [{"type": "text",
"text": "You are a competent assistant on defence and security topics. Answer in English."}]},
{"role": "user", "content": [{"type": "text",
"text": "Which two existing helicopter platforms is the Improved Turbine Engine Program designed to re-engine, before integration on FARA?"}]},
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True,
tokenize=True, return_dict=True,
return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=400, temperature=0.15, do_sample=True)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Français
Résumé
Berthier-Mistral-Military-24B est un modèle de langue de 24 milliards de paramètres, spécialisé dans le domaine de la défense et de la sécurité, avec une focalisation sur les doctrines, l'équipement et le vocabulaire militaire français et OTAN. Il est issu d'un continued pre-training sur un corpus multilingue de contenus militaires en source ouverte, puis d'une fusion TIES avec la variante Instruct du modèle de base pour préserver les capacités conversationnelles.
Points-clés
- +6,7 pp par rapport au modèle de base Mistral-Small-3.1 sur Hard Mil Bench (57,6 % vs 50,9 %), cohérent avec la littérature CPT publiée.
- Sur la frontière de Pareto open-source à 24 B, à égalité avec Mistral-Small 4 (≈119 B) et derrière Mistral-Large 3 (≈675 B) avec 5 à 28 fois moins de paramètres.
- Surpasse des modèles open-source plus récents et plus grands, Gemma 4 31B et Qwen 3.5 27B (tous deux plus grands et publiés après le modèle de base de Berthier) ainsi que Claude Haiku 4.5 (closed-source), sur Hard Mil Bench.
Usages prévus
Utilisation à des fins de recherche et d'éducation uniquement. Cas d'usage envisagés :
- Assistance à la recherche en politiques de défense, études stratégiques, histoire militaire.
- Outil pédagogique pour l'enseignement militaire supérieur (IHEDN, École de Guerre, École d'État-Major).
- Aide à la révision pour officiers stagiaires et élèves des écoles de formation.
- Benchmark de référence pour la recherche sur l'adaptation de modèles au domaine.
Usages hors périmètre
Berthier-Mistral-Military-24B n'est pas conçu pour :
- Générer des listes de cibles ou informer des décisions de ciblage.
- Être intégré à des systèmes de conduite de tir ou à des armes autonomes.
Toute utilisation dans le cadre d'un conflit armé doit respecter le Droit International Humanitaire (distinction, proportionnalité, précaution). Les utilisateurs restent entièrement responsables des conséquences des sorties sur lesquelles ils s'appuient.
Données d'entraînement
Le corpus CPT couvre environ 4 milliards de tokens de contenus militaires et de défense en source ouverte, couvrant 30 langues (français et anglais dominants, suivis de russe, chinois, allemand, ukrainien, arabe, turc, polonais, hébreu, etc.).
Procédure d'entraînement (haut niveau)
- Continued pre-training via adaptateurs LoRA sur
mistralai/Mistral-Small-3.1-24B-Base-2503, une époque sur le corpus de ≈4 milliards de tokens, sur cluster 8×H200. - Fusion LoRA : les adaptateurs CPT sont fusionnés dans les poids du modèle de base, produisant un modèle dense adapté au domaine.
- Fusion TIES entre le modèle adapté au domaine et
mistralai/Mistral-Small-3.1-24B-Instruct-2503, pour préserver les capacités de suivi d'instructions et de conversation généraliste tout en conservant les connaissances de domaine.
Évaluation
Berthier a été évalué sur Hard Mil Bench, un benchmark à réponse libre de 561 items (314 FR / 247 EN). Notation strictement déterministe, pas de juge LLM, pas de QCM : appariement normalisé sur short_answer / cloze / enum, F1 ≥ 2/3 sur set, correspondance ordonnée stricte sur permutation.
Résultats globaux (accuracy ≥ 0,5) :
| Modèle | Global | FR (n=314) | EN (n=247) |
|---|---|---|---|
| Gemini 3 Flash (closed, référence haute) | 72,4 % | 69,7 % | 75,7 % |
| GPT-5.4 mini (closed) | 66,7 % | 61,1 % | 73,7 % |
| Mistral-Large 3 (≈675 B) | 62,8 % | 60,8 % | 65,1 % |
| Mistral-Small 4 (≈119 B) | 58,1 % | 57,3 % | 59,1 % |
| Berthier-Mistral-Military-24B (ce modèle) | 57,6 % | 55,1 % | 60,7 % |
| Gemma 4 31B | 54,4 % | 52,5 % | 56,7 % |
| Mistral-Small 3.1 (base, 24 B) | 50,9 % | 49,0 % | 53,3 % |
| Claude Haiku 4.5 | 48,1 % | 48,1 % | 48,2 % |
| Qwen 3.5 27B | 47,8 % | 44,3 % | 52,2 % |
Gain par rapport au modèle de base : +6,7 pp (57,6 % vs 50,9 %).
Exemples qualitatifs
Cas où Berthier répond correctement à des questions où le modèle de base échoue :
Exemple 1 (FR, équipement français)
Q : « Le micro-drone de contact quadrirotor utilisé en reconnaissance rapprochée par les sections d'infanterie françaises est le ____ »
Réponse :
NX70
- Base Mistral-Small-3.1 →
Patroller(incorrect : le Patroller est un drone MALE d'endurance, pas un micro-drone)- Berthier-Mistral-Military-24B →
NX70
Exemple 2 (FR, institution militaire française)
Q : « Le service public chargé de l'action sociale au profit des militaires et de leurs familles (logements, crèches, vacances) est l'____ »
Réponse :
IGESA
- Base →
Service des ressources humaines de la ministère des armées(hallucination)- Berthier →
Institution de gestion sociale des armées (IGeSA)
Exemple 3 (EN, programme Marine nationale)
Q: "The new French nuclear-powered attack submarine of the Barracuda programme, lead boat commissioned in 2022, is named the ____."
Réponse :
Suffren
- Base →
SNLE 3G Le Terrible(incorrect : classe de SNLE, pas de SNA)- Berthier →
Suffren
Utilisation
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch
model_id = "racineai/Berthier-Mistral-Military-24B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto"
)
messages = [
{"role": "system", "content": [{"type": "text",
"text": "Tu es un assistant compétent en questions de défense et sécurité. Réponds en français."}]},
{"role": "user", "content": [{"type": "text",
"text": "Quelles sont les six phases de la MEDOT, dans l'ordre ?"}]},
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True,
tokenize=True, return_dict=True,
return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=400, temperature=0.15, do_sample=True)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Citation
@misc{berthier_mistral_military_24b_2026,
title = {Berthier-Mistral-Military-24B: A French-Specialised Language Model for Defense and Security},
author = {{Racine.ai}},
year = {2026},
howpublished = {\url{https://huggingface.co/racineai/Berthier-Mistral-Military-24B}},
note = {Continued pre-training of Mistral-Small-3.1-24B-Base via LoRA, then TIES-merged with Mistral-Small-3.1-24B-Instruct.}
}
Acknowledgements
- Base models: Mistralai,
Mistral-Small-3.1-24B-Base-2503(LoRA training target) andMistral-Small-3.1-24B-Instruct-2503(TIES merge partner). - Compute: CEA SLURM cluster (H100 / H200 partitions).
- Evaluation framework: Hard Mil Bench, Racine.ai, 561-item open-ended benchmark.
Contact
Issues, feedback, dataset requests: open an issue on the Hugging Face repo or contact Racine.ai.
- Downloads last month
- 61
Model tree for racineai/Berthier-Mistral-Military-24B
Base model
mistralai/Mistral-Small-3.1-24B-Base-2503