Instructions to use gghfez/DeepSeek-V4-Flash-control-vectors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gghfez/DeepSeek-V4-Flash-control-vectors with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gghfez/DeepSeek-V4-Flash-control-vectors")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gghfez/DeepSeek-V4-Flash-control-vectors", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gghfez/DeepSeek-V4-Flash-control-vectors with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gghfez/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-control-vectors", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gghfez/DeepSeek-V4-Flash-control-vectors
- SGLang
How to use gghfez/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-control-vectors", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gghfez/DeepSeek-V4-Flash-control-vectors with Docker Model Runner:
docker model run hf.co/gghfez/DeepSeek-V4-Flash-control-vectors
gghfez/DeepSeek-V4-Flash-control-vectors
Creative Writing control-vectors for deepseek-ai/DeepSeek-V4-Flash
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_nihilismempathy_vs_sociopathyhonesty_vs_machiavellianismhumility_vs_narcissismcharacter focus (dialogue_vs_narration)language (simple vs ornate)storytelling (descriptive vs explicit)compassion_vs_sadism
NOTES
compassion_vs_sadism-> I'll have to re-do this one after working around refusals.language-> The ornate direction may cause infinite reasoning.
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
llama-server --model DeepSeek-V4-Flash-Q8_0.gguf [your usual CLI arguments] \
--control-vector-scaled DeepSeek-V4-Flash-optimism_vs_nihilism__debias.gguf:1.0 \
--control-vector-scaled DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-control-vectors/DeepSeek-V4-Flash-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/DeepSeek-V4-Flash-control-vectors/DeepSeek-V4-Flash-optimism_vs_nihilism__debias.gguf","scale":1}'
check loaded control-vectors
curl http://127.0.0.1/control-vectors
Samples (TODO)
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.
π **Baseline**
π **Nihilism +1.0**
π **Optimism +1.0**
Writing Steering
Prompt
Now a scene where a friend walks in and asks Maya about it.
π **Baseline (no control vectors)**
π **Dialogue +1.0**
π **Narration +1.0**
Acknowledgements
Based on the excellent work and cross-covariance eigendecomposition implementation by @jukofyork. His 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!
- Downloads last month
- 266
We're not able to determine the quantization variants.
Model tree for gghfez/DeepSeek-V4-Flash-control-vectors
Base model
deepseek-ai/DeepSeek-V4-Flash