Instructions to use PleIAs/Monad with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PleIAs/Monad with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PleIAs/Monad") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PleIAs/Monad") model = AutoModelForCausalLM.from_pretrained("PleIAs/Monad", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PleIAs/Monad with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PleIAs/Monad" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PleIAs/Monad", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PleIAs/Monad
- SGLang
How to use PleIAs/Monad 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 "PleIAs/Monad" \ --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": "PleIAs/Monad", "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 "PleIAs/Monad" \ --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": "PleIAs/Monad", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PleIAs/Monad with Docker Model Runner:
docker model run hf.co/PleIAs/Monad
Update README.md
#6
by pdelobelle - opened
- README.md +0 -69
- figures/pleias.jpg +0 -0
- figures/training_efficiency.jpeg +0 -0
README.md
CHANGED
|
@@ -1,69 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- en
|
| 4 |
-
license: apache-2.0
|
| 5 |
-
pipeline_tag: text-generation
|
| 6 |
-
tags:
|
| 7 |
-
- transformers
|
| 8 |
-
library_name: transformers
|
| 9 |
-
datasets:
|
| 10 |
-
- PleIAs/SYNTH
|
| 11 |
-
---
|
| 12 |
-
|
| 13 |
-
# ⚛️ Monad
|
| 14 |
-
|
| 15 |
-
<div align="center">
|
| 16 |
-
<img src="figures/pleias.jpg" width="60%" alt="Pleias" />
|
| 17 |
-
</div>
|
| 18 |
-
|
| 19 |
-
<p align="center">
|
| 20 |
-
<a href="https://pleias.fr/blog/blogsynth-the-new-data-frontier"><b>Blog announcement</b></a>
|
| 21 |
-
</p>
|
| 22 |
-
|
| 23 |
-
**Monad** is a 56 million parameters generalist Small Reasoning Model, trained on 200 billions tokens from <a href="https://huggingface.co/PleIAs/Baguettotron">SYNTH</a>, a fully open generalist dataset.
|
| 24 |
-
|
| 25 |
-
As of 2025, Monad is the best contender for the smallest viable language models. Despite being less than half of gpt-2, Monad not only answers in consistent English but performs significanly beyond chance on MMLU and other major industry benchmarks.
|
| 26 |
-
|
| 27 |
-
<p align="center">
|
| 28 |
-
<img width="80%" src="figures/training_efficiency.jpeg">
|
| 29 |
-
</p>
|
| 30 |
-
|
| 31 |
-
Monad's name is a reference to Leibniz concept and general idea of the smallest possible unit of intelligence.
|
| 32 |
-
|
| 33 |
-
## Features
|
| 34 |
-
Monad has been natively trained for instructions with thinking traces. We implemented a series of dedicated pipelines for:
|
| 35 |
-
* Memorization of encyclopedic knowledge (50,000 vital articles from Wikipedia), though in this size range hallucinations have to be expected.
|
| 36 |
-
* Retrieval-Augmented Generation with grounding (following on our initial experiments with Pleias-RAG series)
|
| 37 |
-
* Arithmetic and simple math resolution problem
|
| 38 |
-
* Editing tasks
|
| 39 |
-
* Information extraction
|
| 40 |
-
* Creative writing, including unusual synthetic exercises like lipograms or layout poems.
|
| 41 |
-
|
| 42 |
-
Monad is strictly monolingual in English. We trained a new custom tokenizer (likely one of the smallest tokenizer to date, less than 8,000 individual tokens), exclusively trained on SYNTH so that we maintain a relatively good compression ratio.
|
| 43 |
-
|
| 44 |
-
## Model design and training
|
| 45 |
-
Monad is a 56M parameters decoders with a standard Qwen/Llama-like design, except for its extremely compact size and overall opiniated architecture for depth (with 64 layers)
|
| 46 |
-
<p align="center">
|
| 47 |
-
<img width="80%" src="figures/monad_structure.png">
|
| 48 |
-
</p>
|
| 49 |
-
|
| 50 |
-
Monad was trained on 16 h100 from Jean Zay (compute plan n°A0191016886). Full pre-training took a bit less than 6 hours.
|
| 51 |
-
|
| 52 |
-
## Evaluation
|
| 53 |
-
Monad attains performance on MMLU significantly beyond chance with close to 30% of positive rate. We also find non-random results on gsm8k (8%) and HotPotQA (8%)
|
| 54 |
-
|
| 55 |
-
To our knowledge, there is no model remotely close in this size range for evaluation comparison. Spiritually and practically, Monad remains unique.
|
| 56 |
-
|
| 57 |
-
## Use and deployment
|
| 58 |
-
Monad has been trained on the standard instruction style from Qwen.
|
| 59 |
-
|
| 60 |
-
```xml
|
| 61 |
-
<|im_start|>user
|
| 62 |
-
Who are you?<|im_end|>
|
| 63 |
-
<|im_start|>assistant
|
| 64 |
-
<think>
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
Monad has no support yet for multi-turn.
|
| 68 |
-
|
| 69 |
-
A major envisioned use case for Monad is explainability, as the model does provide a unique trade-off between observability and actual reasoning performance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
figures/pleias.jpg
DELETED
|
Binary file (45.4 kB)
|
|
|
figures/training_efficiency.jpeg
DELETED
|
Binary file (44.6 kB)
|
|
|