Instructions to use Nactium/Nactium-39M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nactium/Nactium-39M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nactium/Nactium-39M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Nactium/Nactium-39M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nactium/Nactium-39M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nactium/Nactium-39M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nactium/Nactium-39M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nactium/Nactium-39M
- SGLang
How to use Nactium/Nactium-39M 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 "Nactium/Nactium-39M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nactium/Nactium-39M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Nactium/Nactium-39M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nactium/Nactium-39M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nactium/Nactium-39M with Docker Model Runner:
docker model run hf.co/Nactium/Nactium-39M
Nactium 39M
Nactium est un petit modèle de langue causal (type GPT) d'environ 39 millions de paramètres, conçu pour le français.
Résumé
| Architecture | Transformer décodeur (Nactium39MForCausalLM) |
| Paramètres | ~39M |
| Langue principale | Français |
| Longueur de contexte | 1024 tokens |
| Taille du vocabulaire | 32 000 |
Architecture
Couches (num_hidden_layers) |
7 |
Taille cachée (hidden_size) |
512 |
Têtes d'attention (num_attention_heads) |
8 |
Taille intermédiaire du MLP (intermediate_size) |
2048 |
| Fonction d'activation | GELU |
Contexte maximal (max_position_embeddings) |
1024 |
Vocabulaire (vocab_size) |
32 000 |
Embeddings liés (tie_word_embeddings) |
Oui |
Utilisation
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "Nactium/Nactium-39M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
prompt = "Quelle est la capitale de la France ?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=50,
do_sample=True,
temperature=0.8,
top_p=0.95,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Dans la configuration actuelle,
use_cacheest désactivé (false). La génération fonctionne, mais elle peut être plus lente sur de longues séquences.
Évaluation
Les évaluations ont été réalisées avec lm-evaluation-harness, en 0-shot.
Résultats de Nactium 39m
| Benchmark | Langue | Métrique | Score | Écart-type | Hasard |
|---|---|---|---|---|---|
| ARC Challenge | FR | acc | 18,39 % | ± 1,18 | 25 % |
| ARC Challenge | FR | acc_norm | 24,04 % | ± 1,25 | 25 % |
| Grammar | FR | acc | 64,7 % | ± 4,42 | 25 % |
| Vocab | FR | acc | 58,82 % | ± 4,56 | 25 % |
| PIQA | EN | acc | 56,15 % | ± 1,16 | 50 % |
| PIQA | EN | acc_norm | 55,50 % | ± 1,16 | 50 % |
Comparaison avec d'autres petits modèles
| Benchmark (acc) | Nactium 39M | Houzeric mini-gpt-french 60M | Klovis 144M |
|---|---|---|---|
| ARC Challenge (FR) | 18,39 | 19,85 | 21,13 |
| Grammar (FR) | 64,7 | 27,73 | 21,85 |
| Vocab (FR) | 58,82 | 21,85 | 25,21 |
| PIQA (EN) | 56,15 | 53,48 | 51,90 |
| Moyenne | 49,5 | 30,7 | 30,0 |
Entraînement
Le modèle a été entraîné sur 12 milliards de tokens, à partir des jeux de données suivants :
- CATIE-AQ/facebook-community-alignment-dataset_french_dpo
- angeluriot/french_instruct
- ksolovev/fine-news
- mlfoundations/dclm-baseline-1.0
- Kant1/French_Wikipedia_articles
Citation
@misc{nactium39m,
title = {Nactium 39M},
author = {Nactium},
year = {2026}
}
- Downloads last month
- 36
docker model run hf.co/Nactium/Nactium-39M