Instructions to use Tom09S/wikimind-moe-3B-A0.9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tom09S/wikimind-moe-3B-A0.9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tom09S/wikimind-moe-3B-A0.9B") 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("Tom09S/wikimind-moe-3B-A0.9B") model = AutoModelForCausalLM.from_pretrained("Tom09S/wikimind-moe-3B-A0.9B", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Tom09S/wikimind-moe-3B-A0.9B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M # Run inference directly in the terminal: llama cli -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M # Run inference directly in the terminal: llama cli -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Use Docker
docker model run hf.co/Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Tom09S/wikimind-moe-3B-A0.9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tom09S/wikimind-moe-3B-A0.9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tom09S/wikimind-moe-3B-A0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
- SGLang
How to use Tom09S/wikimind-moe-3B-A0.9B 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 "Tom09S/wikimind-moe-3B-A0.9B" \ --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": "Tom09S/wikimind-moe-3B-A0.9B", "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 "Tom09S/wikimind-moe-3B-A0.9B" \ --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": "Tom09S/wikimind-moe-3B-A0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Tom09S/wikimind-moe-3B-A0.9B with Ollama:
ollama run hf.co/Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
- Unsloth Desktop
- Pi
How to use Tom09S/wikimind-moe-3B-A0.9B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Tom09S/wikimind-moe-3B-A0.9B with Docker Model Runner:
docker model run hf.co/Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
- Lemonade
How to use Tom09S/wikimind-moe-3B-A0.9B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Run and chat with the model
lemonade run user.wikimind-moe-3B-A0.9B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Tom09S/wikimind-moe-3B-A0.9B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Tom09S/wikimind-moe-3B-A0.9B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "Tom09S/wikimind-moe-3B-A0.9B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
✦ En bref
wm3.5-3B-A0.9B transforme un modèle dense de 0,6 milliard de paramètres en un modèle à 10 experts dont 2 sont activés par token : ≈ 3 milliards de paramètres au total, mais seulement ≈ 0,9 milliard calculés à chaque token.
| Base | Qwen/Qwen3-0.6B-Base |
| Architecture | Qwen3MoeForCausalLM (chargeable avec 🤗 Transformers) |
| Experts | 10 experts, top-2, routeur appris |
| Contexte d'entraînement | 512 tokens |
| Entraînement | 750 steps (≈ 6 M tokens), meilleur checkpoint = step 750 |
| Langues | français (principalement), anglais |
| État | modèle de base, pas d'alignement (SFT prévu) |
✦ Résultats
| modèle | val loss | perplexité | tests de génération | répétition 3-gram ↓ |
|---|---|---|---|---|
| Qwen3-0.6B-Base | 2.0677 | 7.91 | 5/5 | 0.314 |
| wm3.5 initialisé | 2.0688 | 7.92 | 5/5 | 0.261 |
| wm3.5 entraîné | 1.9201 | 6.82 | 5/5 | 0.239 |
- Le modèle initialisé a la même perte que la base (2.0688 contre 2.0677) : l'upcycling préserve bien la fonction du modèle de départ.
- Spécialisation des experts : divergence de Jensen-Shannon entre experts 0.093 contre 0.005 au sein d'un même expert, soit un ratio ≈ 18×. Le routage n'est pas aléatoire.
- L'export fusionné a été rechargé avec Transformers (écart max des logits : 0.34, compatible avec du bruit bf16).
⚠️ Lecture honnête de ces chiffres. Le gain de 0.148 de loss peut venir de l'entraînement sur du texte français autant que de la structure MoE. Un témoin dense avec le même budget d'entraînement est prévu pour trancher. Ne pas en conclure que « MoE > dense » à ce stade.
✦ Comment il a été fabriqué
- Upcycling : chaque MLP du modèle dense est dupliqué en 10 experts, avec une petite perturbation gaussienne (σ = 0.01) pour casser la symétrie. Le routeur est initialisé avec σ = 0.002.
- Phase B (150 steps) : seul le routeur est entraîné.
- Phase C (600 steps) : routeur + adaptateurs LoRA (r = 8, α = 16) sur les experts, puis fusion des LoRA dans les poids à l'export.
- Pertes auxiliaires : équilibrage de charge (0.01) et z-loss (0.001).
Données
Mélange court (≈ 35 000 documents) : l'objectif était de valider la méthode, pas de saturer le modèle.
| source | usage | licence |
|---|---|---|
wikimedia/wikipedia (fr, 20231101) |
texte | CC-BY-SA 3.0 · GFDL |
HuggingFaceFW/fineweb-2 (fra_Latn) |
texte | ODC-By 1.0 |
HuggingFaceFW/fineweb-edu (sample-10BT) |
texte | ODC-By 1.0 |
openai/gsm8k |
maths | MIT |
HuggingFaceTB/smoltalk |
conversation | Apache-2.0 |
bigcode/self-oss-instruct-sc2-exec-filter-50k |
code | ODC-By 1.0 (voir la fiche du dataset) |
✦ Utilisation
🤗 Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Tom09S/wm3.5-3B-A0.9B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
prompt = "La capitale de la France est"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(
**inputs, max_new_tokens=120,
do_sample=True, temperature=0.7, top_p=0.9, repetition_penalty=1.1,
)
print(tok.decode(out[0], skip_special_tokens=True))
Il s'agit d'un modèle de base : utilisez du sampling (T ≈ 0.7, top-p ≈ 0.9) et une repetition_penalty ≈ 1.1. En greedy, il boucle facilement.
llama.cpp
huggingface-cli download Tom09S/wm3.5-3B-A0.9B wm3.5-3B-A0.9B-Q4_K_M.gguf --local-dir .
llama-completion -m wm3.5-3B-A0.9B-Q4_K_M.gguf \
-p "La capitale de la France est" -n 120 \
--temp 0.7 --top-p 0.9 --repeat-penalty 1.1
llama-cpp-python
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="Tom09S/wm3.5-3B-A0.9B",
filename="*Q4_K_M.gguf",
n_ctx=2048,
)
print(llm("La capitale de la France est", max_tokens=120, temperature=0.7, top_p=0.9, repeat_penalty=1.1)["choices"][0]["text"])
✦ Quantifications GGUF
Toutes générées depuis le F16 avec llama-quantize. Les tailles sont indicatives.
| fichier | taille ≈ | conseil |
|---|---|---|
…-F16.gguf |
6 Go | référence, pour requantifier |
…-Q8_0.gguf |
3.2 Go | quasi sans perte |
…-Q6_K.gguf |
2.5 Go | très bonne qualité |
…-Q5_K_M.gguf |
2.1 Go | excellent compromis |
…-Q5_K_S.gguf |
2.1 Go | |
…-Q4_K_M.gguf |
1.8 Go | choix par défaut |
…-Q4_K_S.gguf |
1.7 Go | |
…-Q4_0.gguf |
1.7 Go | ancien format, compatibilité |
…-Q3_K_L.gguf |
1.5 Go | machines modestes |
…-Q3_K_M.gguf |
1.4 Go | qualité visiblement réduite |
…-Q3_K_S.gguf |
1.3 Go | qualité réduite |
…-Q2_K.gguf |
1.1 Go | très dégradé, pour tester |
Sur un modèle de cette taille, en dessous de Q4 la dégradation se sent nettement.
✦ Limites
- Modèle de base, non aligné : il complète du texte, il ne suit pas fiablement des instructions et n'a pas de format de conversation.
- Boucles et répétitions, surtout en greedy : sur nos tests, les prompts « français » et « connaissances » bouclent encore (taux de 3-grams répétés de 0.55 et 0.71).
- Hallucinations factuelles fréquentes (le modèle a par exemple associé « 1789 » à la guerre de Vendée).
- Entraînement court (≈ 6 M tokens, contexte 512) : ne pas attendre les performances d'un modèle entraîné à grande échelle.
- Non évalué sur des benchmarks standards pour l'instant.
Exemples de génération (modèle entraîné)
| catégorie | début de la sortie | rép. 3-gram |
|---|---|---|
| maths | 391 (s'arrête proprement) |
0.00 |
| consigne | Oui (s'arrête proprement) |
0.00 |
| code | complète une fonction fibonacci |
0.08 |
| conversation | « Bonjour ! Je vais bien, merci de me le dire. Comment allez-vous ? … » | 0.00 |
| français | liste répétitive sur Paris | 0.55 |
| connaissances | boucle sur « 1789 : début de la guerre de Vendée » | 0.71 |
Contrairement à la base et au modèle initialisé, le modèle entraîné a appris à s'arrêter sur les prompts maths et consigne.
✦ Feuille de route
- Upcycling Qwen3-0.6B → MoE 10 experts, top-2
- Entraînement routeur + LoRA, export Hugging Face fusionné
- Quantifications GGUF (F16 → Q2_K)
- Témoin dense + LoRA, à budget égal
- SFT en français (conversation, réduction des boucles)
- Évaluation sur benchmarks standards
- GGUF du modèle final après SFT
✦ Remerciements
Construit sur Qwen3 (Alibaba Cloud), llama.cpp et les jeux de données listés ci-dessus. Merci à leurs auteurs.
Les données d'entraînement conservent leurs licences respectives (notamment CC-BY-SA 3.0 pour Wikipédia et ODC-By pour FineWeb) : vérifiez-les avant tout usage commercial.
- Downloads last month
- 3,326