Instructions to use mhndayesh/mosv with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mhndayesh/mosv 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 mhndayesh/mosv:F16 # Run inference directly in the terminal: llama cli -hf mhndayesh/mosv:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mhndayesh/mosv:F16 # Run inference directly in the terminal: llama cli -hf mhndayesh/mosv:F16
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 mhndayesh/mosv:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf mhndayesh/mosv:F16
Use Docker
docker model run hf.co/mhndayesh/mosv:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use mhndayesh/mosv with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mhndayesh/mosv" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mhndayesh/mosv", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mhndayesh/mosv:F16
- Ollama
How to use mhndayesh/mosv with Ollama:
ollama run hf.co/mhndayesh/mosv:F16
- Unsloth Desktop
- Pi
How to use mhndayesh/mosv with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mhndayesh/mosv:F16
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": "mhndayesh/mosv:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use mhndayesh/mosv with Docker Model Runner:
docker model run hf.co/mhndayesh/mosv:F16
- Lemonade
How to use mhndayesh/mosv with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mhndayesh/mosv:F16
Run and chat with the model
lemonade run user.mosv-F16
List all available models
lemonade list
- Hermes Agent
How to use mhndayesh/mosv with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mhndayesh/mosv:F16
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 mhndayesh/mosv:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mhndayesh/mosv with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mhndayesh/mosv:F16
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 "mhndayesh/mosv:F16" \ --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"
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf mhndayesh/mosv:F16# Run inference directly in the terminal:
llama cli -hf mhndayesh/mosv:F16Build 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 mhndayesh/mosv:F16# Run inference directly in the terminal:
./build/bin/llama cli -hf mhndayesh/mosv:F16Use Docker
docker model run hf.co/mhndayesh/mosv:F16MoSV: Mixture of Steering Vectors (Qwen3-4B)
Newest: MoSV-Qwen3-4B-Coder - Qwen3-4B with debugging, performance and security experts, trained supervised (no RL). Also: MoSV-Gemma-4-12B v6.0.1 - Gemma 4 12B with debugging, teaching and story experts. On 300 locked test prompts it passes more behavior checks than base on 98% of teaching, 81% of debugging and 62% of story prompts. Write-up: paper_v6_0_1.md.
GitHub: GitHub: code, training pipeline, tests and
write-ups (v3 to v6.0.1). A snapshot of that repo is also in this repo's code/ folder.
Qwen3-4B-Instruct-2507 with task steering built in. Small steering vectors, trained by RL with Claude Haiku as the judge, are stored inside the model as mixture-of-experts layers, and a gate picks one per token. One GGUF, no proxy and no custom code: it runs in stock llama.cpp and in LM Studio. Research project.
Run it
llama-server -m MoSV-Qwen3-4B-F16.gguf -ngl 999 -fa on --jinja
Or download the file and load it in LM Studio. You need a llama.cpp build that includes the hy_v3
architecture (LM Studio's ROCm 2.80.1+ and Vulkan 2.73+ engines were tested). It is 8.1 GB at F16 and fits one
16 GB GPU. Use a Q8_0 or Q4_0 KV cache; Q4_1 has no Flash Attention kernel.
How it works
At layers 9, 18 and 27 the original Qwen MLP stays as an always-on shared expert. Next to it sit expert 0 (all zeros = "no steering") and 8 small SwiGLU topic experts: engineering, story, teaching, debugging, math solving, explanation, professional email, how-to guide. A linear gate picks one expert per token (sigmoid, top-1, weight 1). The rest of the model is unchanged Qwen. The experts and gates were distilled from v3, which adds one RL-trained vector per topic after the same layers, with a router picking the vector once per prompt.
Results
86 held-out prompts, full-length answers, scored blind by Claude Haiku on a 5-criterion rubric per topic (1-5), each pair judged twice with the order swapped.
| Topic | Normal Qwen | v3 | MoSV (v4) |
|---|---|---|---|
| Debugging | 1.70 | 4.12 | 4.09 |
| Professional email | 3.22 | 4.01 | 4.03 |
| Story | 2.55 | 3.82 | 3.66 |
| Teaching | 2.72 | 3.43 | 3.55 |
| Explanation | 2.90 | 3.45 | 3.49 |
| How-to guide | 3.00 | 2.86 | 3.21 |
| Engineering | 2.48 | 2.18 | 2.41 |
| Math solving | 4.53 | 4.47 | 4.43 |
| All 80 topic prompts | 2.89 | 3.54 | 3.61 |
Limits:
- Engineering and math do not improve, and each topic has only 10 test prompts.
- Routing works well between turns of a conversation: 91-100% of each answer's tokens get the right expert.
- Inside one prompt that mixes two tasks, the second task's expert flickers token by token.
- There is no per-request override. To answer unsteered, use plain Qwen.
- Factual accuracy with the vectors on was not tested.
Files
| File | What |
|---|---|
MoSV-Qwen3-4B-F16.gguf |
v4, the model (arch hy_v3). sha256 35d00caba382fb0e1a593faeb07429289957fc628a47245c7b51e9847e139ba8 |
v3/vectors/steer-<topic>.gguf |
v3: the 8 vectors as llama.cpp control vectors (--control-vector, use with plain Qwen3-4B-Instruct-2507 F16) |
v3/router_qwen4b.pt |
v3: the router head (reads the hidden state after layer 9); used by v3/serve.py in the GitHub repo |
code/ |
Snapshot of the GitHub repo (v3 in code/v3/, v4 in code/moe/, papers in code/paper/). GitHub is the live copy |
Credit and license
Inspired by Meral et al., "RL Post-Training in Diffusion Transformers Is Activation Steering" (arXiv:2611.26627), adapted from diffusion models to a text LLM with one vector per topic and a router. Base model: Qwen/Qwen3-4B-Instruct-2507 (Apache-2.0).
Code, MoSV experts, routers and steering vectors: MIT (free to use, change and sell, keep the notice). The GGUF also contains the base model's weights, which stay under Qwen's Apache-2.0; that license also allows commercial use.
- Downloads last month
- 1,382
16-bit
Model tree for mhndayesh/mosv
Base model
Qwen/Qwen3-4B-Instruct-2507
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf mhndayesh/mosv:F16# Run inference directly in the terminal: llama cli -hf mhndayesh/mosv:F16