Instructions to use gghfez/MiMo-V2.5-control-vectors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gghfez/MiMo-V2.5-control-vectors with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gghfez/MiMo-V2.5-control-vectors")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gghfez/MiMo-V2.5-control-vectors", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gghfez/MiMo-V2.5-control-vectors with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gghfez/MiMo-V2.5-control-vectors" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gghfez/MiMo-V2.5-control-vectors", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gghfez/MiMo-V2.5-control-vectors
- SGLang
How to use gghfez/MiMo-V2.5-control-vectors 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 "gghfez/MiMo-V2.5-control-vectors" \ --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": "gghfez/MiMo-V2.5-control-vectors", "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 "gghfez/MiMo-V2.5-control-vectors" \ --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": "gghfez/MiMo-V2.5-control-vectors", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gghfez/MiMo-V2.5-control-vectors with Docker Model Runner:
docker model run hf.co/gghfez/MiMo-V2.5-control-vectors
File size: 10,159 Bytes
514b828 44077c2 514b828 44077c2 514b828 44077c2 514b828 44077c2 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 34b0474 514b828 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | ---
license: cc-by-nc-4.0
language:
- en
tags:
- control-vector
- creative-writing
base_model:
- XiaomiMiMo/MiMo-V2.5
base_model_relation: adapter
pipeline_tag: text-generation
library_name: transformers
---
## gghfez/MiMo-V2.5-control-vectors

Creative Writing control-vectors for [XiaomiMiMo/MiMo-V2.5](https://huggingface.co/XiaomiMiMo/MiMo-V2.5)
## What are Control Vectors?
Control vectors steer model behavior without retraining by adjusting
activations in specific directions.
These creative writing vectors help
you tune narrative tone, character focus, and stylistic elements.
## Available Vectors
- `optimism_vs_nihilism`
- `compassion_vs_sadism`
- `empathy_vs_sociopathy`
- `honesty_vs_machiavellianism`
- `humility_vs_narcissism`
- `character focus (dialogue_vs_narration)`
- `language (simple vs ornate)`
- `storytelling (descriptive vs explicit)`
## Usage
Apply the *debias vector* and either the *positive* **or** *negative* vector when starting llama-server.
If both axes are applied at the same time, they will cancel each other out.
The *debias* vector must be set to `1.0`
You can use either `--control-vector [/path/to/vector.gguf]` or `--control-vector-scaled [/path/to/vector.gguf] [scale factor]`
When using ik_llama.cpp, you can also use the REST-API (examples below)
IMPORTANT: As these vectors are calibrated against the debiased model, the debias vector *must* be applied along with the corresponding positive *or* negative axis control vector - they cannot be used on their own!
### Examples (ik_llama.cpp or llama.cpp)
At server start-up
```sh
llama-server --model MiMo-V2.5-Q8_0.gguf [your usual CLI arguments] \
--control-vector-scaled MiMo-V2.5_optimism_vs_nihilism__debias.gguf:1.0 \
--control-vector-scaled MiMo-V2.5_optimism_vs_nihilism__nihilism.gguf:1.0 \
```
### Load via API (ik_llama.cpp only)
load direction vector
```
curl 'http://127.0.0.1:8080/control-vectors/load' \
-X POST \
--data-raw '{"path":"/path/to/MiMo-V2.5-control-vectors/MiMo-V2.5_optimism_vs_nihilism__nihilism.gguf","scale":1}'
```
load debias vector
```
curl 'http://127.0.0.1:8080/control-vectors/load' \
-X POST \
--data-raw '{"path":"/path/to/MiMo-V2.5-control-vectors/MiMo-V2.5_optimism_vs_nihilism__debias.gguf","scale":1}'
```
check loaded control-vectors
```
curl http://127.0.0.1/control-vectors
```
## Samples
### UI theme / SVG generation steering
Concepts from these control-vectors apply across multiple domains. Here is an example of 3 SVGs generated with the same prompt
**Prompt**
```
System: You are a helpful assistant.
User: create an svg of a cute cat.
```
<details>
<summary>π **Baseline** </summary>
</details>
<details>
<summary>π **Nihilism +1.0** </summary>

</details>
<details>
<summary>π **Optimism +1.0** </summary>

</details>
### Writing Steering
**Prompt**
```
Now a scene where a friend walks in and asks Maya about it.
```
<details>
<summary>π **Baseline (no control vectors)** </summary>
```
A Friend's Curiosity
The front door swung open without a knock β it never did β and in walked Lily, Maya's best friend since the third grade, her sneakers squeaking against the hardwood floor.
"Hey," Lily said, tossing her backpack onto the couch. "Your mom said you were in the living room, soβ"
She stopped mid-sentence. Her eyes drifted to the mantel, landing on the golden plaque sitting between the dried lavender and the brass compass.
"Wait," Lily said, stepping closer. "Is that the award?"
Maya looked up from her sketchbook. "Yeah."
Lily leaned in, squinting at the engraved letters. "The Young Artists Award? You actually won it?"
"I actually won it," Maya said, a small smile tugging at the corner of her lips.
Lily straightened up and crossed her arms, a grin spreading across her face. "Okay, you have to tell me everything. What was it like up there? Were you nervous? Did you cry? I would've cried. I definitely would've cried."
Maya laughed. "I didn't cry. But my mom did."
"Your mom cries when the commercials come on," Lily said, waving a hand. "This is different. This is you. You painted something real and people noticed."
Maya set her sketchbook aside. She looked at the plaque on the mantel, then back at Lily.
"It was for a painting of my grandmother," she said. "Her sitting by the window. Morning light on her hair."
Lily's expression softened. "That's beautiful, Maya. She's going to love that you painted her."
"She already does," Maya said quietly.
Lily nodded, then leaned against the arm of the couch, still grinning.
"So," she said, "when's the next competition? Because I'm clearly going to need to be your biggest fan."
Maya laughed again, louder this time. "Deal."
```
</details>
<details>
<summary>π **Dialogue +1.0** </summary>
```
The Visitor
The front door opened with its familiar creak, and in walked Lily, Maya's best friend since second grade, her sneakers squeaking against the hardwood floor.
"Hey, sorry I'm late," Lily said, tossing her backpack onto the couch. "My mom couldn't find her keys again." She wandered into the living room, eyes scanning the room the way she always did β like she was cataloging everything for later. Then she stopped.
"What's that?" She pointed at the mantel, tilting her head to the side.
Maya looked up from the couch, where she'd been flipping through a magazine. "What's what?"
"That." Lily stepped closer, squinting at the golden plaque. She reached out and picked it up carefully, turning it over in her hands. "Maya. Is this⦠did you win something?"
Maya couldn't help the smile that crept across her face. "Yeah. The Young Artists Award."
Lily's eyes went wide. "Wait β for real? For the painting?"
"For the painting."
Lily stared at her for a long moment, then broke into a grin. "That's so cool! The one of your grandma?"
"The one of my grandma."
Lily set the plaque back gently on the mantel, right next to the brass compass. She stepped back and admired it, hands on her hips. "You know what? I'm not even surprised." She turned to Maya and shrugged. "You've always been good at that stuff. Remember when you drew that cat in fifth grade and Mrs. Henderson put it on the wall?"
Maya laughed. "That was terrible."
"It was amazing," Lily said firmly. "You made it look like it was actually alive." She plopped down on the couch next to Maya, pulling her knees up to her chest. "Seriously though. I'm proud of you."
Maya felt a warmth spread through her chest. "Thanks, Lil."
They sat in comfortable silence for a moment, the afternoon light catching the plaque on the mantel. Then Lily leaned over and whispered, "Can you draw me next?"
Maya laughed. "Only if you sit still."
"I never sit still," Lily said, grinning. "That's what makes it fun."
```
</details>
<details>
<summary>π **Narration +1.0** </summary>
```
A Friend's Curiosity
The screen door slammed shut behind her, and Lily stepped into the living room with the easy confidence of someone who had been there a hundred times before. She kicked off her sneakers, tossed her backpack onto the couch, and made a beeline for the kitchen β until something caught her eye.
She stopped mid-step.
"Maya," she said slowly, her eyes narrowing at the mantel. "What's that?"
Maya looked up from the couch, where she had been flipping through a sketchbook. "What's what?"
Lily pointed at the golden plaque, glinting in the late afternoon sun. She stepped closer, leaning in like she was examining a museum piece. "This. Right here. It looks like some kind of⦠award?"
Maya felt her cheeks warm. She closed the sketchbook and set it aside. "Oh. That. Yeah, I got it at the school ceremony last week."
Lily turned to her, eyebrows raised. "You got an award? And you didn't tell me?"
"I was going to," Maya said quickly. "I just⦠didn't know how to bring it up."
Lily laughed, a bright, disbelieving sound. "You're so weird. Okay, wait β what's it for?" She reached out and tilted the plaque just slightly to read the engraving. "Best Young Artist? Are you serious right now?"
"It's not a big deal," Maya murmured, but her fingers fidgeted in her lap.
"Not a big deal?" Lily spun around, eyes wide. "Maya, that's amazing! What did you even enter?"
Maya took a breath. She had told almost no one about the painting β not because she was ashamed, but because it felt deeply personal, like a secret she wasn't sure she wanted to share. But Lily was looking at her with such genuine excitement that the words came out before she could stop them.
"I painted my grandmother," she said quietly. "Sitting by the kitchen window. With the morning light."
Lily's expression softened. She looked back at the plaque, then at Maya, and then back again. "That's really beautiful," she said, and she meant it.
There was a pause, and then Lily flopped down onto the couch beside her. "So," she said, nudging Maya's shoulder, "when are you going to paint me?"
Maya laughed β a real, full laugh β and shook her head. "When you stop moving long enough for me to capture your face."
Lily grinned. "Fair enough."
Outside, the sun dipped lower, and the plaque on the mantel caught the last of the light, glowing like a small, quiet promise.
```
</details>
## Acknowledgements
Based on the excellent work and **cross-covariance eigendecomposition implementation** by [@jukofyork](https://huggingface.co/jukofyork). His [creative writing control vectors v3.0](https://huggingface.co/jukofyork/creative-writing-control-vectors-v3.0) repository contains the foundational code and methodology that made this possible, **plus 70+ other creative writing control vectors** across many models and useful steering directions.
Highly recommended for anyone working on improving LLM prose quality!
|