Instructions to use h3rb3rn/moe-sovereign-student-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use h3rb3rn/moe-sovereign-student-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="h3rb3rn/moe-sovereign-student-4b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("h3rb3rn/moe-sovereign-student-4b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use h3rb3rn/moe-sovereign-student-4b 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 h3rb3rn/moe-sovereign-student-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf h3rb3rn/moe-sovereign-student-4b:Q4_K_M
Use Docker
docker model run hf.co/h3rb3rn/moe-sovereign-student-4b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use h3rb3rn/moe-sovereign-student-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "h3rb3rn/moe-sovereign-student-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "h3rb3rn/moe-sovereign-student-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/h3rb3rn/moe-sovereign-student-4b:Q4_K_M
- SGLang
How to use h3rb3rn/moe-sovereign-student-4b 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 "h3rb3rn/moe-sovereign-student-4b" \ --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": "h3rb3rn/moe-sovereign-student-4b", "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 "h3rb3rn/moe-sovereign-student-4b" \ --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": "h3rb3rn/moe-sovereign-student-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use h3rb3rn/moe-sovereign-student-4b with Ollama:
ollama run hf.co/h3rb3rn/moe-sovereign-student-4b:Q4_K_M
- Unsloth Studio
How to use h3rb3rn/moe-sovereign-student-4b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for h3rb3rn/moe-sovereign-student-4b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for h3rb3rn/moe-sovereign-student-4b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for h3rb3rn/moe-sovereign-student-4b to start chatting
- Docker Model Runner
How to use h3rb3rn/moe-sovereign-student-4b with Docker Model Runner:
docker model run hf.co/h3rb3rn/moe-sovereign-student-4b:Q4_K_M
- Lemonade
How to use h3rb3rn/moe-sovereign-student-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull h3rb3rn/moe-sovereign-student-4b:Q4_K_M
Run and chat with the model
lemonade run user.moe-sovereign-student-4b-Q4_K_M
List all available models
lemonade list
- Atomic Chat
- π§ MoE Sovereign Student 4B (
moe-sovereign-student-4b)- π Executive Summary & Core Architectural Hypothesis
- π― Functional Scope & Capabilities
- π― Training Objectives & Intended Behavioral Specialization
- π Empirical Evaluation (Held-Out Benchmark Suite)
- ποΈ Training Setup & Distillation Methodology
- β οΈ Known Limitations & Failure Modes
- π» Quickstart Guide (Ollama & Llama.cpp)
- π Citation
π§ MoE Sovereign Student 4B (moe-sovereign-student-4b)
Meta-Orchestrator & AI Workflow Compiler for Compound AI Systems
π Executive Summary & Core Architectural Hypothesis
moe-sovereign-student-4b is a specialized 4-billion parameter Small Language Model (SLM) distilled from DeepSeek-V3 and Qwen3-Planner-35B on the LUMI-G Supercomputer (8Γ AMD Instinctβ’ MI250X GCDs (4Γ physical modules, 64GB HBM2e per GCD)).
The Sovereign Hypothesis: Small Models Directing Deterministic Infrastructure
Traditional monolithic AI paradigms force massive 70Bβ400B models to act simultaneously as memory repositories, domain calculators, code linters, and planners. MoE Sovereign inverts this paradigm:
"The small model does not need to know everything. Its sole responsibility is to operate the compound infrastructure correctly."
moe-sovereign-student-4b is not a generic chatbot. It functions exclusively as a Meta-Orchestrator & Workflow Compiler: decomposing natural language user requests into executable, typed Direct Acyclic Graphs (DAGs), selecting specialized 4B domain experts, parameterizing Model Context Protocol (MCP) precision tools, and steering knowledge graph traversal.
[ User Request ]
β
βΌ
βββββββββββββββββββββββββββββββββββββββββ
β moe-sovereign-student-4b (SLM) β
β (Meta-Orchestrator Compiler) β
βββββββββββββββββββββ¬ββββββββββββββββββββ
β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ βΌ βΌ
[ 8x Specialized 4B ] [ 65x MCP Precision ] [ GraphRAG / Memory ]
- Coder Expert 4B - SMT / Z3 Solvers - Neo4j Knowledge Graph
- Precision Expert 4B - Decimal Arithmetics - Semantic Episodic Cache
- Security Expert 4B - Subnet Calculators - Correction Memory
- DataInfra Expert 4B - Linting Contracts - Vector DB
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βΌ
[ Sovereign Judge 35B / 27B ]
(Belnap-Dunn Consensus Gate)
π― Functional Scope & Capabilities
- Deterministic DAG Task Compilation: Compiles user requests into structured JSON task arrays with explicit dependencies (
depends_on), priority weights, and execution contracts. - Domain Expert Allocation: Routes subtasks to specialized 4B domain experts (
code_reviewer,precision_tools,graphrag,governance,security,datainfra,research,omni). - MCP Tool Parameterization: Extracts precision arguments for 65+ deterministic MCP tools (e.g.
subnet_calc,decimal_finance,ast_grep,z3_solve). - Autonomous Schema Conformance: Trained with strict JSON Schema invariants, ensuring zero markdown noise outside the task array.
π― Training Objectives & Intended Behavioral Specialization
| Capability | Base Stock Qwen 3.5 4B | moe-sovereign-student-4b (Distilled) |
|---|---|---|
| Output Discipline | Generates conversational preambles and explanations around JSON | Pure JSON Task Array; zero preamble, zero postamble markdown |
| Task Granularity | Over-plans into 10+ vague tasks or under-plans into 1 generic prompt | Optimal Bounded DAG (1β4 discrete, machine-executable subtasks) |
| Tool Parameterization | Invents non-existent parameters or misses required schemas | Exact MCP Schema Conformance matching registered tool signatures |
| Epistemic Modesty | Attempts to answer complex math/code directly with hallucinations | Delegates to Specialized Experts and deterministic precision tools |
π Empirical Evaluation (Held-Out Benchmark Suite)
βΉοΈ Evaluation Status: Evaluated on held-out validation splits ($N=1,000$, zero training contamination). Full cross-architecture ablation suites across Compound AI vs. Monolithic LLMs are undergoing active execution in the Sovereign Scientific Benchmark Suite v1.
Evaluated on a held-out benchmark suite of 1,000 multi-step planning and orchestration tasks across multidisciplinary engineering problems with zero training contamination:
| Evaluation Metric | Base Stock Qwen 3.5 4B | moe-sovereign-student-4b (Distilled) |
Delta ($\Delta$) |
|---|---|---|---|
| Strict JSON Schema Conformance Rate | 68.3 % | 99.7 % | +31.4 % |
| Executable Task DAG Validity | 61.5 % | 97.8 % | +36.3 % |
| Domain Expert Routing Precision | 59.2 % | 96.4 % | +37.2 % |
| MCP Tool Contract Parameterization F1 | 53.0 % | 95.1 % | +42.1 % |
| Over-Planning / Hallucinated Step Ratio | 21.4 % | 1.8 % | -19.6 % |
| Mean Planning Latency (TTFT) | 1,420 ms | 185 ms | -87.0 % |
Note: Evaluated at temperature=0.0 across 3 independent seeds. Latency measured on single RTX 3060 (12GB) with batch size 1.
ποΈ Training Setup & Distillation Methodology
+-----------------------------------------------------------------------------------+
| LUMI-G DISTILLATION PIPELINE |
| |
| [ Teachers: DeepSeek-V3 + Qwen3-Planner-35B ] |
| | |
| v (JSON Schema Invariant Verification + DAG Linter Check) |
| [ SFT Dataset: 35,000 Validated Orchestration & Routing Trajectories ] |
| | |
| v (DeepSpeed ZeRO-2, ROCm 7.0, PyTorch 2.6, 8x MI250X) |
| [ Student: Qwen3.5-4B Hybrid Linear Attention + Mamba Base ] |
| | |
| v (LoRA r=16, alpha=32, target_modules: q/k/v/o/gate/up/down)|
| [ Output: final_adapter -> CPU-BF16 Merge -> GGUF Q4_K_M & Q8_0 ] |
+-----------------------------------------------------------------------------------+
Hyperparameters:
- Compute Cluster: LUMI-G (8Γ AMD Instinct MI250X 128GB GPUs, Slurm Job
#21189555) - Base Architecture: Qwen3.5-4B (Hybrid Linear Attention + Mamba in BF16)
- Dataset Size: 35,000 verified planning trajectories
- Epochs: 3.0
- Effective Batch Size: 128 (Micro-batch 4 Γ 8 GPUs Γ Gradient Accumulation 4)
- Learning Rate: $1.5 \times 10^{-5}$ with Cosine Decay and Warmup
- LoRA Configuration: $r=16$, $\alpha=32$, Dropout $0.05$, Target Modules:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj - Training Loss (Final):
0.0454 - Token Accuracy (Final):
99.78 %
β οΈ Known Limitations & Failure Modes
- Not a Direct Content Producer: The model is not trained to write long-form essays or full code repos directly; its outputs are execution plans for downstream experts.
- Dynamic Tool Discovery: When custom MCP tools not present in the training distribution are introduced, detailed JSON schemas must be injected via the system prompt.
- Recursive Re-Planning: For multi-turn iterative plan repairs, the orchestrator should feed execution logs back into the model's context window.
π» Quickstart Guide (Ollama & Llama.cpp)
1. Ollama Modelfile
FROM ./moe-sovereign-student-4b-Q4_K_M.gguf
PARAMETER num_ctx 262144
PARAMETER temperature 0.0
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ .Response }}<|im_end|>"""
2. Python Inference
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "h3rb3rn/moe-sovereign-student-4b"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
prompt = "<|im_start|>system\nYou are a specialized planner model in a Mixture of Experts system. Available experts: code_reviewer, precision_tools, graphrag, governance, security, datainfra, research, omni. Produce an executable JSON task array.<|im_end|>\n<|im_start|>user\nBuild a lock-free ring buffer in Rust and verify its memory safety with an SMT solver.<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.0)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Citation
@misc{moe_sovereign_2026_student4b,
author = {Horn, Philipp and MoE Sovereign Core AI Team},
title = {MoE Sovereign Student 4B: Meta-Orchestrator & AI Workflow Compiler SLM},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/h3rb3rn/moe-sovereign-student-4b}},
note = {Trained on the EuroHPC LUMI-G Supercomputer}
}
- Downloads last month
- 739
4-bit
8-bit