Two pasted directives switch DeepSeek V4's thinking style for role-play, and neither is guaranteed to fire
Documentation of DeepSeek-V4's special control directives for role-play.
At a glance
- What is it?
- victorchen96/deepseek_v4_rolepaly_instruct documents two control directives for DeepSeek-V4: one makes the chain of thought speak as the character, the other forces plain analysis. It is a short Chinese-language guide with an English companion file, and its own text admits the effect is probabilistic.
- Who is it for?
- Use this guide if you role-play on DeepSeek's expert mode or on the deepseek-v4-flash and deepseek-v4-pro APIs and want control over whether the thinking trace stays in character. Skip it if you rely on the fast mode in the app or web, which the guide says is unsupported, or if you need a guarantee, since it says the directive cannot trigger every time.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 164 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.
Star history
- victorchen96/deepseek_v4_rolepaly_instruct2,331 ★ · +7
| Repository | 2026-10-14 | 2026-11-07 |
|---|---|---|
| victorchen96/deepseek_v4_rolepaly_instruct | 2.3k | 2.3k |
7 Stars in the last 24 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The guide targets the 20260424 version of DeepSeek V4 role-play, not the model in general
The README title names a dated version: DeepSeek V4, the 20260424 role-play version. The document describes special control directives for role-play, used to switch the style of the chain of thought while the model is in thinking mode.
Scope is stated up front. It applies to the expert mode of DeepSeek's official app and web page, and to the deepseek-v4-flash and deepseek-v4-pro APIs. The fast mode in the app and on the web is not supported for now.
That last line is a practical boundary. If you chat in the fast mode and paste the directive, the guide gives you no basis to expect any change. The repository is documentation, with a Python primary language label coming from the helper scripts in the root, such as lottery_0526.py and lottery_0528.py, not from a library.
There are three modes, and two of them need a pasted directive
The default mode adds nothing, and the model picks a thinking style according to how complex the scene is. The role immersion mode appends the directive that begins with the tag 【角色沉浸要求】 at the end of the first turn, and the thinking then contains the character's inner monologue wrapped in brackets. The pure analysis mode appends the directive tagged 【思维模式要求】, and the thinking contains only logical analysis with no inner monologue.
The README is careful to say that the tag is not the instruction. Pasting the bracketed words alone does nothing, because the full directive text below them is what you must copy. The guide's illustration contrasts an actor-style trace with a director-style plan, and marks the sample as an example, not real output.
The three-way choice gives you a clean test. Run the same scene in default mode first, then with each directive, and open the thinking view to compare.
The immersion directive is three numbered rules about first-person brackets
The role immersion directive is short and exact. It asks the model, inside the think tags, to follow three rules:
【角色沉浸要求】在你的思考过程(<think>标签内)中,请遵守以下规则:
1. 请以角色第一人称进行内心独白,用括号包裹内心活动,例如"(心想:……)"或"(内心OS:……)"
2. 用第一人称描写角色的内心感受,例如"我心想""我觉得""我暗自"等
3. 思考内容应沉浸在角色中,通过内心独白分析剧情和规划回复The pure analysis directive is its mirror. It forbids round brackets around inner monologue, forbids first-person inner description with phrases like 我心想, and tells the model to focus on plot direction and reply planning, without acting out inner drama in the thinking.
Because the two are opposites, never paste both into the same conversation. The guide handles switching by starting a new conversation and pasting the other directive in its first message.
On the web, the directive goes at the end of the first message and stays there
The web usage is one step: paste the directive at the end of the first message, leave a blank line between your text and the directive, and then chat normally. The example opens a scene in a coffee shop, then continues with later turns that carry no directive at all.
The guide explains why this works. Each reply sees the whole conversation history, so the first-turn directive remains in context for the entire chat. There is no need to repeat it.
Three tips follow. To change modes, open a new conversation and paste the other directive first. To drop the feature, add nothing and the model chooses its own thinking style. To verify, open the option to view the thinking process and check whether the trace matches the mode. That view is the only confirmation the guide offers.
API users append a marker string to the first user message
The API section defines two Python constants, INNER_OS_MARKER and NO_INNER_OS_MARKER. Each starts with two newline characters and then repeats the corresponding directive text. A function named build_messages takes a system prompt, the first user message and a mode, where mode defaults to "default" and "inner_os" selects the immersion marker. The README text is cut off partway through the function, so read the full file in the repository for the remaining branches.
The FAQ settles one placement question. Putting the directive in the system prompt is allowed, but the README advises appending it to the end of the first user message instead. It calls that the injection position used in training, which makes it the most stable choice.
Another FAQ entry says the directive affects only the thinking. The final reply can still change indirectly: immersion makes emotion feel more real, and pure analysis makes structure steadier.
The README admits the directive cannot reach 100 percent and may need several rerolls
The opening note says the effect is probabilistic. It cannot currently trigger every time, but it steadily raises the chance of the desired format appearing. If one attempt does not take, the guide says to roll again several times.
A second technique is labelled a pure lottery, with no dedicated training. You add an instruction to the first-turn directive telling the model to begin its thinking output exactly with the fixed token <|begin▁of▁thinking|> followed by the opening words you want, such as 嗯 or 好的, and to emit that token only once. The idea, per the README, is that changing the starting characters pushes the model into a different pattern, such as Q&A, writing, reasoning or agent. Because those patterns were not trained for role-play, the README says the result depends on luck.
The repository root also holds files named lottery_0526.md and lottery_0528.md with matching Python scripts, though the README text does not explain them.
No license is listed and the root carries feedback reports
The top-level files include README.md and README_EN.md, so an English version exists, along with deepseek_v4_feedback_report_20260520.md, deepseek_v4_feedback_report_20260526.md and two feedback_user_list files with the same dates. There is no LICENSE file in the root, and the repository license is unknown, so reuse rights for the directive text are unclear.
The last push is 2026-05-28, and there are no GitHub releases. The guide is tied to a dated model version, 20260424, so a later model update can change how the directives behave without any change to this repository. Test after each model update.
Editorial conclusion
Use this guide if you role-play on DeepSeek's expert mode or on the deepseek-v4-flash and deepseek-v4-pro APIs and want control over whether the thinking trace stays in character. Skip it if you rely on the fast mode in the app or web, which the guide says is unsupported, or if you need a guarantee, since it says the directive cannot trigger every time. Before building on it, check the repository's license, because none is listed and the last push is 2026-05-28.
Frequently asked questions
Is DeepSeek V4 Pro good for roleplay with this guide?
The guide says its directives apply to the deepseek-v4-pro and deepseek-v4-flash APIs and to the expert mode in the app and web. It makes no quality claim, and it says the effect cannot trigger 100 percent of the time.
How do I use DeepSeek V4 with the role-play directives?
Paste the full directive at the end of your first message and then chat normally. Through the API, append the marker string to the end of the first user message.
Can I put the deepseek_v4_rolepaly_instruct directive in the system prompt?
It is possible, but the FAQ advises the end of the first user message, which it calls the injection position used in training and the most stable.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/victorchen96-deepseek-v4-rolepaly-instruct)Star history chart for your README
[](https://hysenlabs.com/projects/victorchen96-deepseek-v4-rolepaly-instruct)Was this useful?