Instructions to use legmlai/legml-v1.0-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use legmlai/legml-v1.0-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="legmlai/legml-v1.0-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("legmlai/legml-v1.0-8b") model = AutoModelForCausalLM.from_pretrained("legmlai/legml-v1.0-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use legmlai/legml-v1.0-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "legmlai/legml-v1.0-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "legmlai/legml-v1.0-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/legmlai/legml-v1.0-8b
- SGLang
How to use legmlai/legml-v1.0-8b 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 "legmlai/legml-v1.0-8b" \ --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": "legmlai/legml-v1.0-8b", "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 "legmlai/legml-v1.0-8b" \ --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": "legmlai/legml-v1.0-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use legmlai/legml-v1.0-8b with Docker Model Runner:
docker model run hf.co/legmlai/legml-v1.0-8b
legml-v1.0-base — L’Excellence Française du Pre-Training Continu
L'IA pure qui forme l'IA : un corpus 100 % francophone sélectionné et contrôlé
Curated by legml.ai – Leader in AI Data Curation & Quality Assurance
1 • Présentation
legmlai/legml-v1.0-base est un grand modèle de langage (LLM) francophone basé sur Qwen-3 · 8 B.
Il bénéficie d’un pré-entraînement continu (continued pre-training) visant à renforcer la cohérence et la richesse contextuelle de ses réponses en français.
Projet créé et maintenu par Mohamad Alhajar.
🙏 Merci à Nebius pour le sponsoring GPU : 24 × H100 80 Go qui ont permis cette release.
2 • Versions disponibles
| Modèle | Usage principal | Checkpoint | Héritage |
|---|---|---|---|
| legml-v1.0-base | Foundation — pré-entraînement continu | legmlai/legml-v1.0-base |
Qwen-3 8 B |
| legml-v1.0-instruct | Dialogue & instruction-tuning | legmlai/legml-v1.0-instruct |
Fine-tuning sur v1.0-base |
3 • Fiche technique de v1.0-base
| Paramètre | Valeur |
|---|---|
| Architecture | Transformer décodant (Qwen-3 8B), Rotary PE, FlashAttention-2 |
| Taille du modèle | ~ 16 Go (fp16) / 8 Go (bf16) |
| Vocabulaire | 151 k tokens (compat. Qwen) |
| Corpus | ≈ 1.2 T tokens, dont 1 % de FineFrench-v1 + corpus interne (juridique, tech, conversation) |
| Entraînement | 24 × H100 80 Go · 500 k steps · AdamW · LR cosine |
| Licence | Apache-2.0 |
4 • Exemple d’utilisation (base)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "legmlai/legml-v1.0-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto"
)
prompt = "Donne un résumé concis de la Déclaration des Droits de l’Homme et du Citoyen de 1789."
inputs = tokenizer(prompt, return_tensors="pt").to(device)
outputs = model.generate(
**inputs,
temperature=0.45,
top_p=0.9,
max_new_tokens=256
)
print(tokenizer.decode(outputs[0, inputs['input_ids'].shape[-1]:], skip_special_tokens=True))
5 • Exemple d’utilisation (instruct & chat)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "legmlai/legml-v1.0-instruct"
device = "cuda" if torch.cuda.is_available() else "cpu"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto"
)
messages = [
{"role": "system", "content": "Tu es un assistant francophone rigoureux et bienveillant."},
{"role": "user", "content": "Explique-moi la relativité restreinte en trois points."}
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(device)
out = model.generate(
**inputs,
temperature=0.4,
top_p=0.9,
max_new_tokens=512,
repetition_penalty=1.05
)
print(tok.decode(out[0, inputs['input_ids'].shape[-1]:], skip_special_tokens=True))
6 • Hyper-paramètres conseillés
| Cas d’usage | Température | top-p | max_new_tokens |
|---|---|---|---|
| Réponse courte & factuelle | 0.30-0.50 | 0.90 | 128-256 |
| Explication détaillée | 0.40-0.60 | 0.90 | 512-768 |
| Création littéraire | 0.70-0.90 | 0.95 | ≥ 512 |
7 • Limitations
- Couverture post-avril 2025 : connaissances partielles — vérifiez les faits récents.
- Maths olympiades : raisonnement complexe encore perfectible.
- Biais : malgré le focus francophone, certains biais des sources persistent.
8 • Citation
@misc{legml2025,
title = {legml-v1.0 base & instruct: French LLMs},
author = {Mohamad Alhajar},
howpublished = {\url{https://huggingface.co/legmlai/legml-v1.0-base}},
year = {2025}
}
© 2025 – legml.ai • Apache-2.0
- Downloads last month
- 2
Model tree for legmlai/legml-v1.0-8b
Base model
Qwen/Qwen3-8B-Base