Instructions to use legmlai/legml-v1.0-8b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use legmlai/legml-v1.0-8b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="legmlai/legml-v1.0-8b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("legmlai/legml-v1.0-8b-instruct") model = AutoModelForCausalLM.from_pretrained("legmlai/legml-v1.0-8b-instruct", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use legmlai/legml-v1.0-8b-instruct 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-instruct" # 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-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/legmlai/legml-v1.0-8b-instruct
- SGLang
How to use legmlai/legml-v1.0-8b-instruct 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-instruct" \ --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-instruct", "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-instruct" \ --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-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use legmlai/legml-v1.0-8b-instruct with Docker Model Runner:
docker model run hf.co/legmlai/legml-v1.0-8b-instruct
Download README.md from legmlai/legml-v1.0-8b-instruct: direct link, hf CLI and curl.
- Browser
- Download file 6.34 kB
-
https://huggingface.co/legmlai/legml-v1.0-8b-instruct/resolve/main/README.md
- Command line
-
hf download hf://legmlai/legml-v1.0-8b-instruct/README.md
-
curl -L -o README.md https://huggingface.co/legmlai/legml-v1.0-8b-instruct/resolve/main/README.md
library_name: transformers
license: apache-2.0
base_model: legmlai/legml-v1.0-base
tags:
- llama-factory
- full
- generated_from_trainer
model-index:
- name: legml-v1.0-instruct
results:
- task:
type: text-generation
name: Text Generation
dataset:
name: gpqa-fr
type: ai2_arc
config: le-leadboard/gpqa-fr
split: test
args:
num_few_shot: 25
metrics:
- type: acc
value: 14.56
name: accuracy
- task:
type: text-generation
name: Text Generation
dataset:
name: IFEval-fr
type: le-leadboard/IFEval-fr
split: validation
args:
num_few_shot: 10
metrics:
- type: acc
value: 13.55
name: accuracy
- task:
type: text-generation
name: Text Generation
dataset:
name: MMMLU-fr
type: le-leadboard/MMMLU-fr
config: all
split: test
args:
num_few_shot: 5
metrics:
- type: acc
value: 64.57
name: accuracy
- task:
type: text-generation
name: Text Generation
dataset:
name: bbh-fr
type: le-leadboard/bbh-fr
config: multiple_choice
split: validation
args:
num_few_shot: 0
metrics:
- type: acc
value: 38.71
name: accuracy
- task:
type: text-generation
name: Text Generation
dataset:
name: musr-fr
type: le-leadboard/musr-fr
config: le-leadboard/musr-fr
split: validation
args:
num_few_shot: 5
metrics:
- type: acc
value: 4.41
name: accuracy
- task:
type: text-generation
name: Text Generation
dataset:
name: MATH_LVL5_fr
type: le-leadboard/MATH_LVL5_fr
config: le-leadboard/MATH_LVL5_fr
split: test
args:
num_few_shot: 5
metrics:
- type: acc
value: 34.44
name: accuracy
datasets:
- legmlai/finefrench-v1
- legmlai/openhermes-fr
language:
- fr
legml-v1.0-instruct — L’Excellence Française de l’Instruction-Tuning
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-instruct est la déclinaison instruction-tuned de legml-v1.0-base (Qwen-3 · 8 B).
Elle a été affinée sur Open-Hermes-FR, un corpus de 799 875 paires instruction/réponse exclusivement en français, issu de la traduction puis distillation d’OpenHermes original :contentReference[oaicite:0]{index=0}.
Projet conçu et maintenu par Mohamad Alhajar.
🙏 Merci à Nebius pour le sponsoring GPU : 24 × H100 80 Go qui ont permis cet entraînement.
2 • Spécifications
| Paramètre | Valeur |
|---|---|
| Base | legmlai/legml-v1.0-base (Qwen-3 · 8 B) |
| Taille modèle | ≈ 16 Go (fp16) / 8 Go (bf16) |
| Jeu d’instructions | Open-Hermes-FR – 799 875 paires, 100 % français :contentReference[oaicite:1]{index=1} |
| Méthode | SFT multi-tour + DPO léger |
| Licence | Apache-2.0 |
3 • À propos d’Open-Hermes-FR
- Origine : traduction GPT-4o → français, puis génération des réponses et filtrage automatique.
- Taille : ~ 800 k exemples, schéma
prompt/accepted_completion(+ flags qualité) :contentReference[oaicite:2]{index=2} - Licence : ODC-BY 1.0 (libre, obligation d’attribution) :contentReference[oaicite:3]{index=3}
- Objectif : fournir un socle cohérent et riche pour l’alignement des LLMs francophones (dialogue, raisonnement, QA).
4 • Exemple d’utilisation « chat »
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "legmlai/legml-v1.0-instruct"
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))
5 • Hyper-paramètres conseillés
| Scénario | Température | top-p | max_new_tokens |
|---|---|---|---|
| Réponse factuelle | 0.3 – 0.5 | 0.9 | 128 – 256 |
| Explication détaillée | 0.4 – 0.6 | 0.9 | 512 – 768 |
| Création littéraire | 0.7 – 0.9 | 0.95 | ≥ 512 |
6 • Limitations connues
- Connaissances post-avril 2025 limitées — vérifiez toujours les faits récents.
- Raisonnement mathématique compétition encore perfectible.
- Biais : certaines traces des datasets sources et de GPT-4o subsistent.
7 • Citation
@misc{legml2025_instruct,
title = {legml-v1.0-instruct : French Instruction-Tuned LLM},
author = {Mohamad Alhajar},
howpublished = {https://huggingface.co/legmlai/legml-v1.0-instruct},
year = {2025}
}
© 2025 – legml.ai • Apache-2.0