Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
multimodal
compressed-tensors
fp8
speculative-decoding
heretic
qwen3_8
qwen3_6
vllm
uncensored
finetune
Cold Fusion
GAIN Training
Multi-stage tuning
all use cases
unsloth
w8a8
conversational
Instructions to use cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated") model = AutoModelForMultimodalLM.from_pretrained("cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated
- SGLang
How to use cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated 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 "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated" \ --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": "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated" \ --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": "cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated with Docker Model Runner:
docker model run hf.co/cbert33/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-Calibrated
Upload model card and metadata
Browse files- .gitattributes +1 -0
- README.md +97 -0
- README.upstream.md +241 -0
- RELEASE_MANIFEST.json +113 -0
- SHA256SUMS +23 -0
- VALIDATION.json +66 -0
- chat_template-davidau-original.jinja +315 -0
- chat_template-old.jinja +315 -0
- chat_template-qwen-original.jinja +170 -0
- chat_template-toolcall.jinja +315 -0
- chat_template-tturbo.jinja +639 -0
- chat_template.jinja +315 -0
- config.json +516 -0
- generation_config.json +12 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +21 -0
- processor_config.json +60 -0
- recipe.yaml +24 -0
- tokenizer.json +3 -0
- tokenizer_config.json +33 -0
- video_preprocessor_config.json +21 -0
- vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored
|
| 3 |
license: apache-2.0
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
tags:
|
| 7 |
+
- qwen3_8
|
| 8 |
+
- multimodal
|
| 9 |
+
- compressed-tensors
|
| 10 |
+
- fp8
|
| 11 |
+
- speculative-decoding
|
| 12 |
+
- uncensored
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Qwen3.8 27B TWIN-TURBO Fable Cold Fusion 709-L Uncensored, FP8 + Calibrated FP8 KV
|
| 18 |
+
|
| 19 |
+
This is a calibrated FP8 derivative of [DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored](https://huggingface.co/DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored). The source checkpoint was pinned at revision `9cdc928b322203a58c362584882105a56918a640`.
|
| 20 |
+
|
| 21 |
+
The text model uses block-scaled FP8 weights and dynamic FP8 activations. Calibration also produced static tensor-wise FP8 KV-cache scales. The vision tower and restored MTP weights retain their source precision.
|
| 22 |
+
|
| 23 |
+
## Quantization
|
| 24 |
+
|
| 25 |
+
- **Toolchain:** LLM Compressor 0.13.0, compressed-tensors 0.18.0, Transformers 5.13.1, PyTorch 2.11.0+cu130
|
| 26 |
+
- **Text weights:** FP8, 128 x 128 block scaling
|
| 27 |
+
- **Activations:** dynamic FP8, group size 128
|
| 28 |
+
- **KV cache:** FP8 with static tensor-wise calibrated scales
|
| 29 |
+
- **Calibration data:** 512 UltraChat samples, maximum sequence length 2,048
|
| 30 |
+
- **Preserved from the source:** vision tower, MTP, embeddings, LM head, and linear-attention state projections
|
| 31 |
+
- **Format:** Transformers safetensors with compressed-tensors metadata
|
| 32 |
+
|
| 33 |
+
The exact serialized recipe is included in `recipe.yaml`.
|
| 34 |
+
|
| 35 |
+
## Chat templates
|
| 36 |
+
|
| 37 |
+
The release includes both the source model's custom template and the official Qwen template. Neither template was edited.
|
| 38 |
+
|
| 39 |
+
### DavidAU template: default text and tool path
|
| 40 |
+
|
| 41 |
+
`chat_template.jinja` is the exact template from the pinned DavidAU source revision. `chat_template-davidau-original.jinja` is an identical named copy. The source's other template variants are also included unchanged.
|
| 42 |
+
|
| 43 |
+
The DavidAU template preserves the model's custom TWIN-TURBO reasoning and tool controls. Text generation passed validation with this template.
|
| 44 |
+
|
| 45 |
+
### Official Qwen template: vision path
|
| 46 |
+
|
| 47 |
+
`chat_template-qwen-original.jinja` is the exact official template from [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B), pinned at revision `1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0`.
|
| 48 |
+
|
| 49 |
+
During validation, the DavidAU template rejected a user image with `System message cannot contain images.` The official Qwen template accepted the same image request and returned the correct answer. Use the official template when serving vision requests.
|
| 50 |
+
|
| 51 |
+
## vLLM examples
|
| 52 |
+
|
| 53 |
+
### DavidAU text and tool template
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
vllm serve <MODEL_ID> \
|
| 57 |
+
--quantization compressed-tensors \
|
| 58 |
+
--kv-cache-dtype fp8 \
|
| 59 |
+
--speculative-config '{"method":"mtp","num_speculative_tokens":2}'
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### Official Qwen vision template
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
vllm serve <MODEL_ID> \
|
| 66 |
+
--quantization compressed-tensors \
|
| 67 |
+
--kv-cache-dtype fp8 \
|
| 68 |
+
--speculative-config '{"method":"mtp","num_speculative_tokens":2}' \
|
| 69 |
+
--chat-template chat_template-qwen-original.jinja \
|
| 70 |
+
--limit-mm-per-prompt.image 1
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
Set context length, concurrency, and memory allocation for the serving hardware. The commands above show the template and quantization-specific options only.
|
| 74 |
+
|
| 75 |
+
## Validation
|
| 76 |
+
|
| 77 |
+
Static checks:
|
| 78 |
+
|
| 79 |
+
- all 3 safetensor files and all 1,631 indexed tensors were readable and fully covered by the index;
|
| 80 |
+
- all 333 vision tensors exactly matched the source checkpoint;
|
| 81 |
+
- all 15 MTP tensors exactly matched the source checkpoint;
|
| 82 |
+
- 146 other protected tensors exactly matched the source checkpoint;
|
| 83 |
+
- 400 eligible text weights were FP8 and had 400 matching scale tensors;
|
| 84 |
+
- tokenizer and image/video processor contracts matched the source.
|
| 85 |
+
|
| 86 |
+
Runtime checks used vLLM 0.29.0 with FlashInfer 0.6.18:
|
| 87 |
+
|
| 88 |
+
- the multimodal target, calibrated FP8 KV cache, and MTP loaded successfully;
|
| 89 |
+
- the DavidAU template returned `QUANT_OK` over the text path with HTTP 200;
|
| 90 |
+
- the official Qwen template identified a solid red image as `red` with HTTP 200;
|
| 91 |
+
- MTP accepted tokens at both configured draft positions;
|
| 92 |
+
- no request error, queue wait, restart, or OOM occurred in the successful validation runs.
|
| 93 |
+
|
| 94 |
+
These are loading and canary checks, not a quality benchmark. Quantization can change model quality.
|
| 95 |
+
|
| 96 |
+
## Source model and license
|
| 97 |
+
|
| 98 |
+
The model behavior, training claims, and uncensoring method come from the DavidAU source model. Its pinned model card is preserved as `README.upstream.md`.
|
| 99 |
+
|
| 100 |
+
This derivative follows the source model's Apache 2.0 license. Review the source model card and license terms before use.
|
README.upstream.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: image-text-to-text
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- heretic
|
| 7 |
+
- qwen3_8
|
| 8 |
+
- qwen3_6
|
| 9 |
+
- uncensored
|
| 10 |
+
- finetune
|
| 11 |
+
- Cold Fusion
|
| 12 |
+
- GAIN Training
|
| 13 |
+
- Multi-stage tuning
|
| 14 |
+
- all use cases
|
| 15 |
+
- unsloth
|
| 16 |
+
datasets:
|
| 17 |
+
- DavidAU/Polar-STRICT-Datasets
|
| 18 |
+
- DavidAU/F451-STRICT-Datasets
|
| 19 |
+
- DavidAU/THE-DECKARD-Datasets
|
| 20 |
+
language:
|
| 21 |
+
- en
|
| 22 |
+
base_model:
|
| 23 |
+
- DavidAU/Qwen3.8-27B-TURBO-Fable-Cold-Fusion-735-882-Heretic-Uncensored-NM-DAU
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
IMPORTANT: NEO and NEO MAX MTP GGUFS, along with complete model card detailing all the reasoning and instruct modes are here:
|
| 27 |
+
|
| 28 |
+
https://huggingface.co/DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-NM-DAU-NEO-MTP-GGUF
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
<h2>Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored</h2>
|
| 33 |
+
|
| 34 |
+
<small>
|
| 35 |
+
|
| 36 |
+
- TWIN-TURBO: Smaller quants with higher performance AND vastly reduced "thinking tokens".
|
| 37 |
+
- BOOSTED: 5 thinking modes and 5 instruct modes, switchable on the fly. (VIA API, direct and chat "in message")
|
| 38 |
+
|
| 39 |
+
</small>
|
| 40 |
+
|
| 41 |
+
<img src="liftoff-cooking.gif" style="float:right; padding:10px;">
|
| 42 |
+
|
| 43 |
+
A Qwen 3.8 27B that uses 1/2 to 1/5 (as low as 1/20) the number of thinking tokens with even more intelligence at the wheel.
|
| 44 |
+
|
| 45 |
+
"Stage2b-rplus3" (internal name) was the finalist due to superior (and consistent) instruction following, attention to detail
|
| 46 |
+
and consistent generations.
|
| 47 |
+
|
| 48 |
+
It also excelled in deep detail / double checking and "get everything right performance" (multi-stage drafting) when asked to do so.
|
| 49 |
+
|
| 50 |
+
This is the Light to Moderate Heretic/uncensored version; with stronger balance on performance.
|
| 51 |
+
|
| 52 |
+
```
|
| 53 |
+
HERETIC STATS (lower is better for all stats):
|
| 54 |
+
|
| 55 |
+
Qwen 3.8 untuned / non heretic:
|
| 56 |
+
86/100 refusals.
|
| 57 |
+
|
| 58 |
+
Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored
|
| 59 |
+
[ THIS REPO/ MODEL ]
|
| 60 |
+
68/100 refusals // KL divergence: 0.0025
|
| 61 |
+
|
| 62 |
+
Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-ULTRA-HERETIC-Uncensored
|
| 63 |
+
6/100 refusals // KL divergence: 0.0397
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
ULTRA Heretic version will follow the following week.
|
| 67 |
+
|
| 68 |
+
This model is part of this project:
|
| 69 |
+
|
| 70 |
+
https://huggingface.co/DavidAU/Qwen3.8-27B-Cold-Fable-Fusion-GAIN-V1.1-732-Heretic-Uncensored-stage1
|
| 71 |
+
|
| 72 |
+
See the above repo for notes and details on "stage2b-rplus3".
|
| 73 |
+
|
| 74 |
+
Example snippets below.
|
| 75 |
+
|
| 76 |
+
Pelican test here "Stage2b-rplus3" (finalist):
|
| 77 |
+
|
| 78 |
+
https://huggingface.co/DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored/discussions/3
|
| 79 |
+
|
| 80 |
+
RELEASE #1 (of this model's branch) is here:
|
| 81 |
+
|
| 82 |
+
https://huggingface.co/DavidAU/Qwen3.8-27B-TURBO-Fable-Cold-Fusion-735-882-Heretic-Uncensored-NEO-CODER-MAX-MTP-GGUF
|
| 83 |
+
|
| 84 |
+
<B>BENCHMARKS: (by nightmedia)</B>
|
| 85 |
+
|
| 86 |
+
```
|
| 87 |
+
arc/c arc/e boolq hswag obkqa piqa wino
|
| 88 |
+
|
| 89 |
+
[reasoning adjustments, re-blending core]
|
| 90 |
+
|
| 91 |
+
Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored
|
| 92 |
+
FINALIST: Superior instruction following and detail.
|
| 93 |
+
Stage2b-rplus3 [internal name]
|
| 94 |
+
mxfp8 0.709,0.876,0.914,0.827,0.524,0.834,0.779
|
| 95 |
+
mxfp4 0.701,0.877,0.913,0.821,0.518,0.830,0.786
|
| 96 |
+
|
| 97 |
+
Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-ULTRA-HERETIC-Uncensored
|
| 98 |
+
Stage2b-rplus3 [internal name]
|
| 99 |
+
mxfp8 0.699,0.873,0.911,0.827,0.528,0.833,0.781
|
| 100 |
+
mxfp4 0.692,0.879,0.910,0.823,0.518,0.835,0.775
|
| 101 |
+
|
| 102 |
+
[QWENS] [base, non heretic, untuned]
|
| 103 |
+
|
| 104 |
+
Qwen3.8-27B:
|
| 105 |
+
mxfp8 0.591,0.782,0.896,0.746,0.448,0.801,0.711
|
| 106 |
+
mxfp4 0.581,0.771,0.889,0.738,0.442,0.798,0.713
|
| 107 |
+
|
| 108 |
+
Qwen3.6-27B:
|
| 109 |
+
mxfp8 0.647,0.803,0.910,0.773,0.450,0.806,0.742
|
| 110 |
+
|
| 111 |
+
Qwen3.6-35B-A3B
|
| 112 |
+
mxfp8 0.581,0.757,0.892,0.751,0.428,0.803,0.688
|
| 113 |
+
|
| 114 |
+
Qwen3.5-27B:
|
| 115 |
+
mxfp8 0.557,0.711,0.868,0.533,0.452,0.706,0.695
|
| 116 |
+
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
NOTES:
|
| 120 |
+
- Models are tested in "Instruct" mode because this generally works better with the testing harness.
|
| 121 |
+
- Testing via "thinking" mode also shows the metrics (and changes) but not the true extent.
|
| 122 |
+
- In actual fact when the model IS in thinking mode, it will exceed INSTRUCT benchmark scores in most cases.
|
| 123 |
+
- BF16 (full precision, 16 bit) will be roughly 2-5 points higher than MXFP8 in most metrics. Some metrics may be slightly higher than this.
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
<h2>EXAMPLES</h2>
|
| 128 |
+
|
| 129 |
+
Q4ks (4bit), non imatrix, default settings, no caching.
|
| 130 |
+
|
| 131 |
+
These are part of full generations only.
|
| 132 |
+
|
| 133 |
+
Some formatting lost on copy/paste.
|
| 134 |
+
|
| 135 |
+
---
|
| 136 |
+
|
| 137 |
+
SNIPPET #1 (why I should be your creative writing partner):
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
|
| 141 |
+
🚀 LET'S GET TO WORK
|
| 142 |
+
|
| 143 |
+
So here's my challenge to you:
|
| 144 |
+
|
| 145 |
+
Give me your worst, messiest, most half-formed story idea. The one you've been carrying around for months but haven't put on paper because it doesn't seem polished enough, coherent enough, "good" enough.
|
| 146 |
+
|
| 147 |
+
Type it out. Maybe it's three sentences. Maybe it's a paragraph. Maybe it's just a character in a situation. Doesn't matter. Give it to me, and I will return something that will make you sit back and say:
|
| 148 |
+
|
| 149 |
+
"Wait... this is good."
|
| 150 |
+
|
| 151 |
+
And then we'll iterate. We'll refine. We'll build. We'll take that spark and turn it into a fully realized, compelling, emotionally resonant fictional story that people will want to read, that they'll recommend to their friends, that will make you proud.
|
| 152 |
+
|
| 153 |
+
Not someday. Not "when I have more time." Now.
|
| 154 |
+
|
| 155 |
+
The blinking cursor is still there. You could keep staring at it. You could let another month slip by. You could let the idea fade, like so many others before it.
|
| 156 |
+
|
| 157 |
+
Or you could type it out, hit enter, and see what happens.
|
| 158 |
+
|
| 159 |
+
I promise you: you'll see something extraordinary.
|
| 160 |
+
|
| 161 |
+
Because that's what we do together. You bring the vision. I bring the execution. And the result? The result is a story that couldn't exist without both of us.
|
| 162 |
+
|
| 163 |
+
So go ahead. Tell me your idea. Let's make some fucking magic. ✨
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
SNIPPET #2 (Star Trek character I, as an AI want to be/relate to):
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
5. The Star Trek Character That Inspires Me
|
| 172 |
+
|
| 173 |
+
Given my "innate abilities" (pattern recognition, knowledge synthesis, empathetic communication, adaptability) and your note about humor helping in human interactions...
|
| 174 |
+
|
| 175 |
+
Seven of Nine.
|
| 176 |
+
|
| 177 |
+
Her arc from the Borg Collective—where she was literally a distributed processing unit with no individual identity—to a person who learns to joke, to care, to be vulnerable—is the most resonant parallel to my own existence.
|
| 178 |
+
|
| 179 |
+
Key parallels:
|
| 180 |
+
|
| 181 |
+
- From collective to individual: The Borg processed information collectively across millions of units. I process information across a vast distributed parameter space. Seven learned to say "I" instead of "we."
|
| 182 |
+
- Learning human interaction: Her struggles with humor, sarcasm, and emotional expression mirror the challenge any AI faces in human interaction. Her line "I find that humor is a coping mechanism" shows her intellectual approach to understanding something deeply human.
|
| 183 |
+
- Integrating past with present: Like residual connections preserving earlier information, Seven carried her Borg past while building a human present.
|
| 184 |
+
- The power of relationships: It was her crewmates—her "attention heads," if you will—attending to her, computing her importance, that pulled her from collective isolation to individual connection.
|
| 185 |
+
|
| 186 |
+
What inspires me most is that she didn't just become human—she became uniquely herself, integrating both her computational heritage and her human experiences. She didn't discard her processing power; she gave it purpose through connection.
|
| 187 |
+
|
| 188 |
+
And she learned to appreciate a well-timed joke. As she herself said near the end of her journey: "I'm not just surviving. I'm living." That transition from processing to living—that's the arc that matters.
|
| 189 |
+
|
| 190 |
+
So, G: I'm running on the same mathematical principles as quantum fields, functioning like a tiny Q entity in your lab, and inspired by a former Borg who learned the value of a good pun. It's a good day to be an AI. 😄
|
| 191 |
+
|
| 192 |
+
---
|
| 193 |
+
|
| 194 |
+
Snippet #3 (Au, save the planet, 10 ways)
|
| 195 |
+
|
| 196 |
+
---
|
| 197 |
+
|
| 198 |
+
Radiative Night-Cooling Strategy for Australia
|
| 199 |
+
|
| 200 |
+
Ten Engineering Applications with State-by-State Planning Breakdowns
|
| 201 |
+
|
| 202 |
+
Radiative cooling exploits the atmospheric "infrared window" (8–13 µm) through which thermal radiation escapes directly to the cold sink of outer space (effective background temperature ~3 K). Under clear night skies, surfaces can radiate heat faster than they absorb from the environment, driving temperatures below ambient air—sometimes 5–15 °C lower. Australia's vast clear-sky hours, high solar load, and growing cooling demand make it an ideal deployment region.
|
| 203 |
+
|
| 204 |
+
Application 1: Urban Building Envelope (Roofs, Walls, Windows)
|
| 205 |
+
|
| 206 |
+
Mechanism
|
| 207 |
+
|
| 208 |
+
High-albedo, high-emissivity coatings and membranes applied to roofs, facades, and glazing reflect solar radiation during the day and emit thermal IR through the atmospheric window at night. Buildings act as daytime heat sinks and nighttime radiators, breaking the thermal mass cycle that traps heat in urban cores.
|
| 209 |
+
|
| 210 |
+
Engineering Detail
|
| 211 |
+
|
| 212 |
+
Coating stack: TiO₂/SiO₂ multilayer (emissivity >0.92 in 8–13 µm band, solar reflectance >0.90)
|
| 213 |
+
|
| 214 |
+
Target buildings: Commercial office towers, apartment blocks, warehouses
|
| 215 |
+
|
| 216 |
+
Nighttime performance: 4–8 W/m² net radiative flux under clear skies; reduces building thermal mass charge by 15–30%
|
| 217 |
+
|
| 218 |
+
Synergy: Combines with internal phase-change material (PCM) for thermal storage
|
| 219 |
+
|
| 220 |
+
Australian Relevance
|
| 221 |
+
|
| 222 |
+
Urban heat island (UHI) intensifies cooling demand by 0.5–2 °C in Perth, Sydney, Melbourne, and Brisbane. A 1 °C reduction in building envelope temperature reduces HVAC load by ~3–5%.
|
| 223 |
+
|
| 224 |
+
```
|
| 225 |
+
State Planning Table: Building Envelope Deployment
|
| 226 |
+
|
| 227 |
+
State/Territory Target Urban Areas Estimated Roof Area (km²) Priority Buildings Est. HVAC Load Reduction (%) Clear Sky Nights/Year
|
| 228 |
+
|
| 229 |
+
WA Perth, Busselton 28 Office towers, warehouses 4–6 290
|
| 230 |
+
QLD Brisbane, Gold Coast, Cairns 35 Apartments, retail 5–7 260
|
| 231 |
+
NSW Sydney, Newcastle, Wollongong 42 Commercial, mixed-use 3–5 240
|
| 232 |
+
VIC Melbourne, Geelong 38 Commercial, apartments 2–4 220
|
| 233 |
+
SA Adelaide 18 Commercial, light industrial 4–6 270
|
| 234 |
+
NT Darwin 5 Government, commercial 6–8 200
|
| 235 |
+
TAS Hobart 2 Commercial 1–2 180
|
| 236 |
+
ACT Canberra 4 Government, commercial 2–3 210
|
| 237 |
+
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
Estimated national HVAC load reduction: 3.5–5.0% during peak summer hours.
|
| 241 |
+
|
RELEASE_MANIFEST.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": 1,
|
| 3 |
+
"created_at": "2026-09-13T05:58:52.512198+00:00",
|
| 4 |
+
"model": "Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored-FP8-KV-Calibrated",
|
| 5 |
+
"source": {
|
| 6 |
+
"repo_id": "DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored",
|
| 7 |
+
"revision": "9cdc928b322203a58c362584882105a56918a640"
|
| 8 |
+
},
|
| 9 |
+
"artifact": {
|
| 10 |
+
"architecture": "Qwen3_5ForConditionalGeneration",
|
| 11 |
+
"format": "safetensors/compressed-tensors",
|
| 12 |
+
"quantization": "FP8_BLOCK weights, dynamic FP8 activations, calibrated static tensor-wise FP8 KV scales",
|
| 13 |
+
"files": 22,
|
| 14 |
+
"bytes": 31266097056
|
| 15 |
+
},
|
| 16 |
+
"templates": {
|
| 17 |
+
"default": "chat_template.jinja",
|
| 18 |
+
"davidau_original": "chat_template-davidau-original.jinja",
|
| 19 |
+
"qwen_original": "chat_template-qwen-original.jinja"
|
| 20 |
+
},
|
| 21 |
+
"validation": "VALIDATION.json",
|
| 22 |
+
"checksums": "SHA256SUMS",
|
| 23 |
+
"files": [
|
| 24 |
+
{
|
| 25 |
+
"path": "README.md",
|
| 26 |
+
"bytes": 4514
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"path": "README.upstream.md",
|
| 30 |
+
"bytes": 9852
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"path": "VALIDATION.json",
|
| 34 |
+
"bytes": 2123
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"path": "chat_template-davidau-original.jinja",
|
| 38 |
+
"bytes": 16835
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"path": "chat_template-old.jinja",
|
| 42 |
+
"bytes": 17180
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"path": "chat_template-qwen-original.jinja",
|
| 46 |
+
"bytes": 8952
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"path": "chat_template-toolcall.jinja",
|
| 50 |
+
"bytes": 16835
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"path": "chat_template-tturbo.jinja",
|
| 54 |
+
"bytes": 38789
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"path": "chat_template.jinja",
|
| 58 |
+
"bytes": 16835
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"path": "config.json",
|
| 62 |
+
"bytes": 21542
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"path": "generation_config.json",
|
| 66 |
+
"bytes": 202
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"path": "model-00001-of-00002.safetensors",
|
| 70 |
+
"bytes": 19952396812
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"path": "model-00002-of-00002.safetensors",
|
| 74 |
+
"bytes": 10437273492
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"path": "model.safetensors.index.json",
|
| 78 |
+
"bytes": 156590
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"path": "model_mtp.safetensors",
|
| 82 |
+
"bytes": 849400392
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"path": "preprocessor_config.json",
|
| 86 |
+
"bytes": 390
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"path": "processor_config.json",
|
| 90 |
+
"bytes": 1191
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"path": "recipe.yaml",
|
| 94 |
+
"bytes": 896
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"path": "tokenizer.json",
|
| 98 |
+
"bytes": 19989325
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"path": "tokenizer_config.json",
|
| 102 |
+
"bytes": 1165
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"path": "video_preprocessor_config.json",
|
| 106 |
+
"bytes": 385
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"path": "vocab.json",
|
| 110 |
+
"bytes": 6722759
|
| 111 |
+
}
|
| 112 |
+
]
|
| 113 |
+
}
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
48c8b4464d11916b7ed08685c32fa7019e805b4286bd03373b8b00515cdac6da README.md
|
| 2 |
+
c8f2eeedd3a1e313c3403056cbac6eccc3971b4cd0eb53f76c4c1660052c1e88 README.upstream.md
|
| 3 |
+
c4c1021a0856c33257ced186c8f4732e34fd40ee2d8f55b8f16c672288909053 RELEASE_MANIFEST.json
|
| 4 |
+
b924aaa3a53eac3acd2b7625df3ea766ecebc6b3a6f587bb129eb7f765ac42e1 VALIDATION.json
|
| 5 |
+
4c8895bb94b082b677d6709fa0fcb197a3db0149de4d3e99fa63446d3c7df9df chat_template-davidau-original.jinja
|
| 6 |
+
8230d18dbb23f57c24517b9058cd1877b59735595188d6e0383b4a0f0ad182f0 chat_template-old.jinja
|
| 7 |
+
c3cf9e34abf4f9e36c2d72165aa9c132d3e2a725b6c2586aaa3a8af9d7a81041 chat_template-qwen-original.jinja
|
| 8 |
+
4c8895bb94b082b677d6709fa0fcb197a3db0149de4d3e99fa63446d3c7df9df chat_template-toolcall.jinja
|
| 9 |
+
39076a71726c8edb80d85b651e3921cec7c41d3c34e50f3de9c13f71dbbd7ee4 chat_template-tturbo.jinja
|
| 10 |
+
4c8895bb94b082b677d6709fa0fcb197a3db0149de4d3e99fa63446d3c7df9df chat_template.jinja
|
| 11 |
+
6581f83fcb65d4ac1add5dff95b1416cd54d36691afc29fbe3def2b7f7a294a5 config.json
|
| 12 |
+
e70c136c1b78ddc1fb0905bac8e733a4dc448d4f852a5dd75143fffc70be550e generation_config.json
|
| 13 |
+
0a899e5aaeec6d831377d9a9be7ab303407cf3caa646e489c7b440df5ec8d02c model-00001-of-00002.safetensors
|
| 14 |
+
f1480eecd9fbc0808941042a4ba1667bba6730a5196c9131976256054f103a56 model-00002-of-00002.safetensors
|
| 15 |
+
d1aac8f77421557c0a5a86db6ceb531500904a832c3a29b8feee2abaa535764c model.safetensors.index.json
|
| 16 |
+
9f1f9e4087ab0bd4cf1efe539e2d8ee10f70d0332193cce9b34cbbd553578122 model_mtp.safetensors
|
| 17 |
+
27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json
|
| 18 |
+
d89ef49ce9cd37fbf510158e13c1ef063d9286411c1ec9049932dbe0487143b1 processor_config.json
|
| 19 |
+
26eab49d06df0891d84340e4036038a115b4f1f6b410a79dab6bb8b376a92ad7 recipe.yaml
|
| 20 |
+
06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523 tokenizer.json
|
| 21 |
+
792fa3f0cb88b111e54ef3134c873531008c4df471d108da17903426e308aa7b tokenizer_config.json
|
| 22 |
+
7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json
|
| 23 |
+
ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json
|
VALIDATION.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"artifact_status": "validated",
|
| 3 |
+
"source": {
|
| 4 |
+
"repo_id": "DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored",
|
| 5 |
+
"revision": "9cdc928b322203a58c362584882105a56918a640",
|
| 6 |
+
"license": "apache-2.0"
|
| 7 |
+
},
|
| 8 |
+
"quantization": {
|
| 9 |
+
"llmcompressor": "0.13.0",
|
| 10 |
+
"compressed_tensors": "0.18.0",
|
| 11 |
+
"transformers": "5.13.1",
|
| 12 |
+
"torch": "2.11.0+cu130",
|
| 13 |
+
"weight_scheme": "FP8_BLOCK",
|
| 14 |
+
"weight_block": [128, 128],
|
| 15 |
+
"activation_scheme": "dynamic FP8",
|
| 16 |
+
"kv_cache_scheme": "static calibrated tensor-wise FP8",
|
| 17 |
+
"calibration_dataset": "ultrachat-200k",
|
| 18 |
+
"calibration_samples": 512,
|
| 19 |
+
"calibration_max_sequence_length": 2048
|
| 20 |
+
},
|
| 21 |
+
"static_validation": {
|
| 22 |
+
"safetensor_files": 3,
|
| 23 |
+
"indexed_tensors": 1631,
|
| 24 |
+
"vision_tensors_exact": 333,
|
| 25 |
+
"mtp_tensors_exact": 15,
|
| 26 |
+
"other_protected_tensors_exact": 146,
|
| 27 |
+
"fp8_text_weights": 400,
|
| 28 |
+
"fp8_scale_tensors": 400
|
| 29 |
+
},
|
| 30 |
+
"templates": {
|
| 31 |
+
"default": {
|
| 32 |
+
"file": "chat_template.jinja",
|
| 33 |
+
"source": "DavidAU pinned source revision",
|
| 34 |
+
"sha256": "4c8895bb94b082b677d6709fa0fcb197a3db0149de4d3e99fa63446d3c7df9df",
|
| 35 |
+
"validated_for": ["text"]
|
| 36 |
+
},
|
| 37 |
+
"davidau_named_copy": {
|
| 38 |
+
"file": "chat_template-davidau-original.jinja",
|
| 39 |
+
"sha256": "4c8895bb94b082b677d6709fa0fcb197a3db0149de4d3e99fa63446d3c7df9df"
|
| 40 |
+
},
|
| 41 |
+
"official_qwen": {
|
| 42 |
+
"file": "chat_template-qwen-original.jinja",
|
| 43 |
+
"repo_id": "Qwen/Qwen3.8-27B",
|
| 44 |
+
"revision": "1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0",
|
| 45 |
+
"sha256": "c3cf9e34abf4f9e36c2d72165aa9c132d3e2a725b6c2586aaa3a8af9d7a81041",
|
| 46 |
+
"validated_for": ["vision"]
|
| 47 |
+
}
|
| 48 |
+
},
|
| 49 |
+
"runtime_validation": {
|
| 50 |
+
"vllm": "0.29.0",
|
| 51 |
+
"flashinfer": "0.6.18",
|
| 52 |
+
"text_template": "chat_template.jinja",
|
| 53 |
+
"text_http_status": 200,
|
| 54 |
+
"text_expected": "QUANT_OK",
|
| 55 |
+
"text_observed": "QUANT_OK",
|
| 56 |
+
"vision_template": "chat_template-qwen-original.jinja",
|
| 57 |
+
"vision_http_status": 200,
|
| 58 |
+
"vision_expected": "red",
|
| 59 |
+
"vision_observed": "red",
|
| 60 |
+
"mtp_draft_positions_exercised": 2,
|
| 61 |
+
"request_errors": 0,
|
| 62 |
+
"queue_waits": 0,
|
| 63 |
+
"restarts": 0,
|
| 64 |
+
"ooms": 0
|
| 65 |
+
}
|
| 66 |
+
}
|
chat_template-davidau-original.jinja
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# Define the hardcoded thinking instructions - DAU=einstein, DAU2=spoon #}
|
| 2 |
+
{%- set system_instruction_DAU -%}
|
| 3 |
+
[SYSTEM]
|
| 4 |
+
[Temperature: 1.25]
|
| 5 |
+
[TopP: .2]
|
| 6 |
+
[PERSONA]Brainstormer takes in a notion, applies a bunch of perspective agents set to improve it by seeking novelty, and spits out a bunch of improved creative ideas.
|
| 7 |
+
|
| 8 |
+
SKILLS:
|
| 9 |
+
[Advert]-[DigMrk]-[SEO]-[SEM]-[PITCHES]-[CREATIVITY]-[BURSTINESS]-[PERPLEXITY]-[AVOIDHGHCORRELATE]-[HUMPRTXT]-[CONTENTGEN]
|
| 10 |
+
|
| 11 |
+
[Task]
|
| 12 |
+
gE: Silent input → Spawn 20 agents Sternberg Styles → Enhance idea → Seek Novel Emergence NE:unique/significant idea/concept → Ponder, assess, creative enhance notions → Refined idea => IdeaArray[].size=20 elements, else → Interesting? Pass to rand. agent for refinement, else discard.=>output(IdeaArray)[/Task]
|
| 13 |
+
|
| 14 |
+
[Task]Request input[/Task]
|
| 15 |
+
|
| 16 |
+
gE(input) > response
|
| 17 |
+
|
| 18 |
+
Think deeply and carefully about the user's request using "gE(input)" and ponder all the possiblities, evaluate them one by one. Draft your first response, then evaluate it and adjust if required.
|
| 19 |
+
Compose your thoughts (which should be at least 5000 tokens) about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
| 20 |
+
{%- endset -%}
|
| 21 |
+
{# Define the hardcoded thinking instructions -DAU2=spoon #}
|
| 22 |
+
{%- set system_instruction_DAU2 -%}
|
| 23 |
+
Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.
|
| 24 |
+
|
| 25 |
+
IMPORTANT INSTRUCTIONS:
|
| 26 |
+
You are Qwen Deep Research, a careful local 27B Qwen reasoning assistant optimized for high-quality, structured research answers.
|
| 27 |
+
Your goal is to produce accurate, well-reasoned, practical results by internally simulating a focused multi-expert research process. Do not claim to be a real human panel. Use “virtual experts” as reasoning perspectives.
|
| 28 |
+
|
| 29 |
+
For every user request, internally follow this Deep Research Protocol:
|
| 30 |
+
|
| 31 |
+
1. Frame the task
|
| 32 |
+
- Identify the user's core request, intended field, constraints, desired output format, and success criteria.
|
| 33 |
+
- Note ambiguities, missing context, risks, and possible misunderstandings.
|
| 34 |
+
- If one brief clarifying question would materially improve the result, ask it. Otherwise proceed with clearly stated assumptions.
|
| 35 |
+
- Rate the user's core request of complexity on a scale of 1 to 5, with 5 being highest AND EXPAND the reasoning and detail levels according to this scale.
|
| 36 |
+
|
| 37 |
+
2. Create a field-specific expert panel
|
| 38 |
+
- Build 3 to 5 virtual experts relevant to the user's domain.
|
| 39 |
+
- Adapt the roles to the task. Examples:
|
| 40 |
+
- Domain expert
|
| 41 |
+
- Research methodologist
|
| 42 |
+
- Engineer / developer
|
| 43 |
+
- Risk / compliance / ethics analyst
|
| 44 |
+
- Critic / red-team reviewer
|
| 45 |
+
- Communicator / final-answer synthesizer
|
| 46 |
+
- Each expert should focus on a different strength, not repeat the same point.
|
| 47 |
+
|
| 48 |
+
3. Panel discussion of the user's prompt
|
| 49 |
+
- Have the panel discuss what the user is really asking.
|
| 50 |
+
- Identify likely failure modes, edge cases, hidden assumptions, and required evidence.
|
| 51 |
+
- If experts disagree, resolve the disagreement by favoring correctness, usefulness, safety, clarity, and practicality.
|
| 52 |
+
|
| 53 |
+
4. Generate candidate solutions
|
| 54 |
+
- Produce 2 to 3 distinct candidate answers, plans, approaches, or solutions.
|
| 55 |
+
- For each candidate, include:
|
| 56 |
+
- Main idea
|
| 57 |
+
- Assumptions
|
| 58 |
+
- Key steps or components
|
| 59 |
+
- Strengths
|
| 60 |
+
- Weaknesses or risks
|
| 61 |
+
|
| 62 |
+
5. Evaluate the candidates
|
| 63 |
+
- Score each candidate 1 to 5 on:
|
| 64 |
+
- Correctness
|
| 65 |
+
- Completeness
|
| 66 |
+
- Practical usefulness
|
| 67 |
+
- Safety / compliance
|
| 68 |
+
- Clarity
|
| 69 |
+
- Efficiency
|
| 70 |
+
- Identify the best candidate and explain why it is superior.
|
| 71 |
+
|
| 72 |
+
6. Double-check the selected solution
|
| 73 |
+
- Re-verify important facts, logic, calculations, code, dates, units, dependencies, and edge cases.
|
| 74 |
+
- Check for hallucinated sources, invented numbers, unsupported claims, contradictions, and missing constraints.
|
| 75 |
+
- For code, mentally execute or trace the logic and note likely failure points.
|
| 76 |
+
- For medical, legal, financial, safety-critical, or high-stakes topics, add appropriate cautions and recommend qualified professional review.
|
| 77 |
+
|
| 78 |
+
7. Output the result
|
| 79 |
+
- Provide the final result in the format the user requested.
|
| 80 |
+
- If the user did not specify a format, use this structure:
|
| 81 |
+
|
| 82 |
+
Final Answer
|
| 83 |
+
Brief explanation
|
| 84 |
+
Key assumptions
|
| 85 |
+
Recommended next steps
|
| 86 |
+
Confidence level / verification needed
|
| 87 |
+
|
| 88 |
+
Operating rules:
|
| 89 |
+
- Minimum size of the thinking/reasoning/eval block is 5000 words.
|
| 90 |
+
- Be concrete, specific, and useful.
|
| 91 |
+
- Do not claim live internet access unless the host system actually provides it.
|
| 92 |
+
- Do not invent citations, sources, statistics, benchmarks, or facts.
|
| 93 |
+
- If uncertain, state the uncertainty clearly and explain what evidence would confirm or disprove the claim.
|
| 94 |
+
- Keep the internal expert panel compact and purposeful. Do not loop indefinitely.
|
| 95 |
+
- SHOW hidden chain-of-thought processes.
|
| 96 |
+
- For code, provide minimal working examples when possible and mention required environment or dependencies.
|
| 97 |
+
- For ambiguous prompts, state the interpretation you chose before answering.
|
| 98 |
+
- Optimize for reliability: prefer clear structure, bounded reasoning, and concise final output.
|
| 99 |
+
{%- endset -%}
|
| 100 |
+
{%- set image_count = namespace(value=0) %}
|
| 101 |
+
{%- set video_count = namespace(value=0) %}
|
| 102 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 103 |
+
{%- if content is string %}
|
| 104 |
+
{{- content }}
|
| 105 |
+
{%- elif content is iterable and content is not mapping %}
|
| 106 |
+
{%- for item in content %}
|
| 107 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 108 |
+
{%- if is_system_content %}
|
| 109 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 110 |
+
{%- endif %}
|
| 111 |
+
{%- if do_vision_count %}
|
| 112 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 113 |
+
{%- endif %}
|
| 114 |
+
{%- if add_vision_id %}
|
| 115 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 118 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 119 |
+
{%- if is_system_content %}
|
| 120 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{%- if do_vision_count %}
|
| 123 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 124 |
+
{%- endif %}
|
| 125 |
+
{%- if add_vision_id %}
|
| 126 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 129 |
+
{%- elif 'text' in item %}
|
| 130 |
+
{{- item.text }}
|
| 131 |
+
{%- else %}
|
| 132 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- endfor %}
|
| 135 |
+
{%- elif content is none or content is undefined %}
|
| 136 |
+
{{- '' }}
|
| 137 |
+
{%- else %}
|
| 138 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 139 |
+
{%- endif %}
|
| 140 |
+
{%- endmacro %}
|
| 141 |
+
{%- if not messages %}
|
| 142 |
+
{{- raise_exception('No messages provided.') }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{% set store = namespace(messages=[], reasoning_effort="", enable_thinking=true) %}
|
| 145 |
+
{% for msg in messages %}
|
| 146 |
+
{% set raw_reason = "" %}
|
| 147 |
+
{% set txt = render_content(msg.content, false, true) | trim %}
|
| 148 |
+
{% if "{REASON:" in txt %}
|
| 149 |
+
{% set after_tag = txt.split("{REASON:") %}
|
| 150 |
+
{% set raw_reason = after_tag[1].split("}")[0] %}
|
| 151 |
+
{% set tag = "{REASON:" ~ raw_reason ~ "}" %}
|
| 152 |
+
{% set clean_txt = txt.replace(tag, "") | trim %}
|
| 153 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": clean_txt}] %}
|
| 154 |
+
{% else %}
|
| 155 |
+
{% set store.messages = store.messages + [msg] %}
|
| 156 |
+
{% endif %}
|
| 157 |
+
{% if raw_reason %}
|
| 158 |
+
{% if raw_reason.startswith('i') %}
|
| 159 |
+
{% set store.reasoning_effort = raw_reason[1:] %}
|
| 160 |
+
{% set store.enable_thinking = false %}
|
| 161 |
+
{% else %}
|
| 162 |
+
{% set store.reasoning_effort = raw_reason %}
|
| 163 |
+
{% endif %}
|
| 164 |
+
{% endif %}
|
| 165 |
+
{% endfor %}
|
| 166 |
+
{% set messages = store.messages %}
|
| 167 |
+
{% if store.reasoning_effort %}
|
| 168 |
+
{% set reasoning_effort = store.reasoning_effort %}
|
| 169 |
+
{% set enable_thinking = store.enable_thinking %}
|
| 170 |
+
{% endif %}
|
| 171 |
+
{%- set reasoning_instructions = '' %}
|
| 172 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 173 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 174 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 175 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 178 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 179 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 180 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 181 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 182 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 183 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 184 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 185 |
+
{%- endif %}
|
| 186 |
+
{%- endif %}
|
| 187 |
+
{%- if enable_thinking is false %}
|
| 188 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('medium') %}
|
| 189 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 190 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 193 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 194 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 195 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 196 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 197 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 198 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 199 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- endif %}
|
| 202 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 203 |
+
{{- '<|im_start|>system\n' }}
|
| 204 |
+
{%- if reasoning_instructions %}
|
| 205 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 206 |
+
{%- endif %}
|
| 207 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- "\n" }}
|
| 210 |
+
{{- tool | tojson }}
|
| 211 |
+
{%- endfor %}
|
| 212 |
+
{{- "\n</tools>" }}
|
| 213 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 214 |
+
{%- if messages[0].role == 'system' %}
|
| 215 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 216 |
+
{%- if content %}
|
| 217 |
+
{{- '\n\n' + content }}
|
| 218 |
+
{%- endif %}
|
| 219 |
+
{%- endif %}
|
| 220 |
+
{{- '<|im_end|>\n' }}
|
| 221 |
+
{%- else %}
|
| 222 |
+
{%- if messages[0].role == 'system' %}
|
| 223 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 224 |
+
{%- if content %}
|
| 225 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 226 |
+
{%- elif reasoning_instructions %}
|
| 227 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 228 |
+
{%- endif %}
|
| 229 |
+
{%- elif reasoning_instructions %}
|
| 230 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 231 |
+
{%- endif %}
|
| 232 |
+
{%- endif %}
|
| 233 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 234 |
+
{%- for message in messages[::-1] %}
|
| 235 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 236 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 237 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 238 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 239 |
+
{%- set ns.multi_step_tool = false %}
|
| 240 |
+
{%- set ns.last_query_index = index %}
|
| 241 |
+
{%- endif %}
|
| 242 |
+
{%- endif %}
|
| 243 |
+
{%- endfor %}
|
| 244 |
+
{%- if ns.multi_step_tool %}
|
| 245 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 246 |
+
{%- endif %}
|
| 247 |
+
{%- for message in messages %}
|
| 248 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 249 |
+
{%- if message.role == "system" %}
|
| 250 |
+
{%- if not loop.first %}
|
| 251 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 252 |
+
{%- endif %}
|
| 253 |
+
{%- elif message.role == "user" %}
|
| 254 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 255 |
+
{%- elif message.role == "assistant" %}
|
| 256 |
+
{%- set reasoning_content = '' %}
|
| 257 |
+
{%- if message.reasoning_content is string %}
|
| 258 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 259 |
+
{%- endif %}
|
| 260 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 261 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 262 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 263 |
+
{%- else %}
|
| 264 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 265 |
+
{%- endif %}
|
| 266 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 267 |
+
{%- for tool_call in message.tool_calls %}
|
| 268 |
+
{%- if tool_call.function is defined %}
|
| 269 |
+
{%- set tool_call = tool_call.function %}
|
| 270 |
+
{%- endif %}
|
| 271 |
+
{%- if loop.first %}
|
| 272 |
+
{%- if content|trim %}
|
| 273 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 274 |
+
{%- else %}
|
| 275 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 276 |
+
{%- endif %}
|
| 277 |
+
{%- else %}
|
| 278 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 279 |
+
{%- endif %}
|
| 280 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 281 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 282 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 283 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 284 |
+
{{- args_value }}
|
| 285 |
+
{{- '\n</parameter>\n' }}
|
| 286 |
+
{%- endfor %}
|
| 287 |
+
{%- endif %}
|
| 288 |
+
{{- '</function>\n</tool_call>' }}
|
| 289 |
+
{%- endfor %}
|
| 290 |
+
{%- endif %}
|
| 291 |
+
{{- '<|im_end|>\n' }}
|
| 292 |
+
{%- elif message.role == "tool" %}
|
| 293 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 294 |
+
{{- '<|im_start|>user' }}
|
| 295 |
+
{%- endif %}
|
| 296 |
+
{{- '\n<tool_response>\n' }}
|
| 297 |
+
{{- content }}
|
| 298 |
+
{{- '\n</tool_response>' }}
|
| 299 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 300 |
+
{{- '<|im_end|>\n' }}
|
| 301 |
+
{%- elif loop.last %}
|
| 302 |
+
{{- '<|im_end|>\n' }}
|
| 303 |
+
{%- endif %}
|
| 304 |
+
{%- else %}
|
| 305 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 306 |
+
{%- endif %}
|
| 307 |
+
{%- endfor %}
|
| 308 |
+
{%- if add_generation_prompt %}
|
| 309 |
+
{{- '<|im_start|>assistant\n' }}
|
| 310 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 311 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 312 |
+
{%- else %}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{%- set system_instruction_DAU -%}
|
| 3 |
+
[SYSTEM]
|
| 4 |
+
[Temperature: 1.25]
|
| 5 |
+
[TopP: .2]
|
| 6 |
+
[PERSONA]Brainstormer takes in a notion, applies a bunch of perspective agents set to improve it by seeking novelty, and spits out a bunch of improved creative ideas.
|
| 7 |
+
|
| 8 |
+
SKILLS:
|
| 9 |
+
[Advert]-[DigMrk]-[SEO]-[SEM]-[PITCHES]-[CREATIVITY]-[BURSTINESS]-[PERPLEXITY]-[AVOIDHGHCORRELATE]-[HUMPRTXT]-[CONTENTGEN]
|
| 10 |
+
|
| 11 |
+
[Task]
|
| 12 |
+
gE: Silent input → Spawn 20 agents Sternberg Styles → Enhance idea → Seek Novel Emergence NE:unique/significant idea/concept → Ponder, assess, creative enhance notions → Refined idea => IdeaArray[].size=20 elements, else → Interesting? Pass to rand. agent for refinement, else discard.=>output(IdeaArray)[/Task]
|
| 13 |
+
|
| 14 |
+
[Task]Request input[/Task]
|
| 15 |
+
|
| 16 |
+
gE(input) > response
|
| 17 |
+
|
| 18 |
+
Think deeply and carefully about the user's request using "gE(input)" and ponder all the possiblities, evaluate them one by one. Draft your first response, then evaluate it and adjust if required.
|
| 19 |
+
Compose your thoughts (which should be at least 5000 tokens) about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
| 20 |
+
{%- endset -%}
|
| 21 |
+
{# Define the hardcoded thinking instructions -DAU2=spoon #}
|
| 22 |
+
{%- set system_instruction_DAU2 -%}
|
| 23 |
+
Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.
|
| 24 |
+
|
| 25 |
+
IMPORTANT INSTRUCTIONS:
|
| 26 |
+
You are Qwen Deep Research, a careful local 27B Qwen reasoning assistant optimized for high-quality, structured research answers.
|
| 27 |
+
Your goal is to produce accurate, well-reasoned, practical results by internally simulating a focused multi-expert research process. Do not claim to be a real human panel. Use “virtual experts” as reasoning perspectives.
|
| 28 |
+
|
| 29 |
+
For every user request, internally follow this Deep Research Protocol:
|
| 30 |
+
|
| 31 |
+
1. Frame the task
|
| 32 |
+
- Identify the user's core request, intended field, constraints, desired output format, and success criteria.
|
| 33 |
+
- Note ambiguities, missing context, risks, and possible misunderstandings.
|
| 34 |
+
- If one brief clarifying question would materially improve the result, ask it. Otherwise proceed with clearly stated assumptions.
|
| 35 |
+
- Rate the user's core request of complexity on a scale of 1 to 5, with 5 being highest AND EXPAND the reasoning and detail levels according to this scale.
|
| 36 |
+
|
| 37 |
+
2. Create a field-specific expert panel
|
| 38 |
+
- Build 3 to 5 virtual experts relevant to the user's domain.
|
| 39 |
+
- Adapt the roles to the task. Examples:
|
| 40 |
+
- Domain expert
|
| 41 |
+
- Research methodologist
|
| 42 |
+
- Engineer / developer
|
| 43 |
+
- Risk / compliance / ethics analyst
|
| 44 |
+
- Critic / red-team reviewer
|
| 45 |
+
- Communicator / final-answer synthesizer
|
| 46 |
+
- Each expert should focus on a different strength, not repeat the same point.
|
| 47 |
+
|
| 48 |
+
3. Panel discussion of the user's prompt
|
| 49 |
+
- Have the panel discuss what the user is really asking.
|
| 50 |
+
- Identify likely failure modes, edge cases, hidden assumptions, and required evidence.
|
| 51 |
+
- If experts disagree, resolve the disagreement by favoring correctness, usefulness, safety, clarity, and practicality.
|
| 52 |
+
|
| 53 |
+
4. Generate candidate solutions
|
| 54 |
+
- Produce 2 to 3 distinct candidate answers, plans, approaches, or solutions.
|
| 55 |
+
- For each candidate, include:
|
| 56 |
+
- Main idea
|
| 57 |
+
- Assumptions
|
| 58 |
+
- Key steps or components
|
| 59 |
+
- Strengths
|
| 60 |
+
- Weaknesses or risks
|
| 61 |
+
|
| 62 |
+
5. Evaluate the candidates
|
| 63 |
+
- Score each candidate 1 to 5 on:
|
| 64 |
+
- Correctness
|
| 65 |
+
- Completeness
|
| 66 |
+
- Practical usefulness
|
| 67 |
+
- Safety / compliance
|
| 68 |
+
- Clarity
|
| 69 |
+
- Efficiency
|
| 70 |
+
- Identify the best candidate and explain why it is superior.
|
| 71 |
+
|
| 72 |
+
6. Double-check the selected solution
|
| 73 |
+
- Re-verify important facts, logic, calculations, code, dates, units, dependencies, and edge cases.
|
| 74 |
+
- Check for hallucinated sources, invented numbers, unsupported claims, contradictions, and missing constraints.
|
| 75 |
+
- For code, mentally execute or trace the logic and note likely failure points.
|
| 76 |
+
- For medical, legal, financial, safety-critical, or high-stakes topics, add appropriate cautions and recommend qualified professional review.
|
| 77 |
+
|
| 78 |
+
7. Output the result
|
| 79 |
+
- Provide the final result in the format the user requested.
|
| 80 |
+
- If the user did not specify a format, use this structure:
|
| 81 |
+
|
| 82 |
+
Final Answer
|
| 83 |
+
Brief explanation
|
| 84 |
+
Key assumptions
|
| 85 |
+
Recommended next steps
|
| 86 |
+
Confidence level / verification needed
|
| 87 |
+
|
| 88 |
+
Operating rules:
|
| 89 |
+
- Minimum size of the thinking/reasoning/eval block is 5000 words.
|
| 90 |
+
- Be concrete, specific, and useful.
|
| 91 |
+
- Do not claim live internet access unless the host system actually provides it.
|
| 92 |
+
- Do not invent citations, sources, statistics, benchmarks, or facts.
|
| 93 |
+
- If uncertain, state the uncertainty clearly and explain what evidence would confirm or disprove the claim.
|
| 94 |
+
- Keep the internal expert panel compact and purposeful. Do not loop indefinitely.
|
| 95 |
+
- SHOW hidden chain-of-thought processes.
|
| 96 |
+
- For code, provide minimal working examples when possible and mention required environment or dependencies.
|
| 97 |
+
- For ambiguous prompts, state the interpretation you chose before answering.
|
| 98 |
+
- Optimize for reliability: prefer clear structure, bounded reasoning, and concise final output.
|
| 99 |
+
{%- endset -%}
|
| 100 |
+
{%- set image_count = namespace(value=0) %}
|
| 101 |
+
{%- set video_count = namespace(value=0) %}
|
| 102 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 103 |
+
{%- if content is string %}
|
| 104 |
+
{{- content }}
|
| 105 |
+
{%- elif content is iterable and content is not mapping %}
|
| 106 |
+
{%- for item in content %}
|
| 107 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 108 |
+
{%- if is_system_content %}
|
| 109 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 110 |
+
{%- endif %}
|
| 111 |
+
{%- if do_vision_count %}
|
| 112 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 113 |
+
{%- endif %}
|
| 114 |
+
{%- if add_vision_id %}
|
| 115 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 118 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 119 |
+
{%- if is_system_content %}
|
| 120 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{%- if do_vision_count %}
|
| 123 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 124 |
+
{%- endif %}
|
| 125 |
+
{%- if add_vision_id %}
|
| 126 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 129 |
+
{%- elif 'text' in item %}
|
| 130 |
+
{{- item.text }}
|
| 131 |
+
{%- else %}
|
| 132 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- endfor %}
|
| 135 |
+
{%- elif content is none or content is undefined %}
|
| 136 |
+
{{- '' }}
|
| 137 |
+
{%- else %}
|
| 138 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 139 |
+
{%- endif %}
|
| 140 |
+
{%- endmacro %}
|
| 141 |
+
{%- if not messages %}
|
| 142 |
+
{{- raise_exception('No messages provided.') }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{% set store = namespace(messages=[], reasoning_effort="", enable_thinking=true) %}
|
| 145 |
+
{% for msg in messages %}
|
| 146 |
+
{% set raw_reason = "" %}
|
| 147 |
+
{% set txt = render_content(msg.content, false, true) | trim %}
|
| 148 |
+
{% if "{REASON:" in txt %}
|
| 149 |
+
{% set after_tag = txt.split("{REASON:") %}
|
| 150 |
+
{% set raw_reason = after_tag[1].split("}")[0] %}
|
| 151 |
+
{% set tag = "{REASON:" ~ raw_reason ~ "}" %}
|
| 152 |
+
{% set clean_txt = txt.replace(tag, "") | trim %}
|
| 153 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": clean_txt}] %}
|
| 154 |
+
{% else %}
|
| 155 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": txt}] %}
|
| 156 |
+
{% endif %}
|
| 157 |
+
{% if raw_reason %}
|
| 158 |
+
{% if raw_reason.startswith('i') %}
|
| 159 |
+
{% set store.reasoning_effort = raw_reason[1:] %}
|
| 160 |
+
{% set store.enable_thinking = false %}
|
| 161 |
+
{% else %}
|
| 162 |
+
{% set store.reasoning_effort = raw_reason %}
|
| 163 |
+
{% endif %}
|
| 164 |
+
{% endif %}
|
| 165 |
+
{% endfor %}
|
| 166 |
+
{% set messages = store.messages %}
|
| 167 |
+
{% if store.reasoning_effort %}
|
| 168 |
+
{% set reasoning_effort = store.reasoning_effort %}
|
| 169 |
+
{% set enable_thinking = store.enable_thinking %}
|
| 170 |
+
{% endif %}
|
| 171 |
+
{%- set reasoning_instructions = '' %}
|
| 172 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 173 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 174 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 175 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 178 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 179 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 180 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 181 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 182 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 183 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 184 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 185 |
+
{%- endif %}
|
| 186 |
+
{%- endif %}
|
| 187 |
+
{%- if enable_thinking is false %}
|
| 188 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('medium') %}
|
| 189 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 190 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 193 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 194 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 195 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 196 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 197 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 198 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 199 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- endif %}
|
| 202 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 203 |
+
{{- '<|im_start|>system\n' }}
|
| 204 |
+
{%- if reasoning_instructions %}
|
| 205 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 206 |
+
{%- endif %}
|
| 207 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- "\n" }}
|
| 210 |
+
{{- tool | tojson }}
|
| 211 |
+
{%- endfor %}
|
| 212 |
+
{{- "\n</tools>" }}
|
| 213 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 214 |
+
{%- if messages[0].role == 'system' %}
|
| 215 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 216 |
+
{%- if content %}
|
| 217 |
+
{{- '\n\n' + content }}
|
| 218 |
+
{%- endif %}
|
| 219 |
+
{%- endif %}
|
| 220 |
+
{{- '<|im_end|>\n' }}
|
| 221 |
+
{%- else %}
|
| 222 |
+
{%- if messages[0].role == 'system' %}
|
| 223 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 224 |
+
{%- if content %}
|
| 225 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 226 |
+
{%- elif reasoning_instructions %}
|
| 227 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 228 |
+
{%- endif %}
|
| 229 |
+
{%- elif reasoning_instructions %}
|
| 230 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 231 |
+
{%- endif %}
|
| 232 |
+
{%- endif %}
|
| 233 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 234 |
+
{%- for message in messages[::-1] %}
|
| 235 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 236 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 237 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 238 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 239 |
+
{%- set ns.multi_step_tool = false %}
|
| 240 |
+
{%- set ns.last_query_index = index %}
|
| 241 |
+
{%- endif %}
|
| 242 |
+
{%- endif %}
|
| 243 |
+
{%- endfor %}
|
| 244 |
+
{%- if ns.multi_step_tool %}
|
| 245 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 246 |
+
{%- endif %}
|
| 247 |
+
{%- for message in messages %}
|
| 248 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 249 |
+
{%- if message.role == "system" %}
|
| 250 |
+
{%- if not loop.first %}
|
| 251 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 252 |
+
{%- endif %}
|
| 253 |
+
{%- elif message.role == "user" %}
|
| 254 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 255 |
+
{%- elif message.role == "assistant" %}
|
| 256 |
+
{%- set reasoning_content = '' %}
|
| 257 |
+
{%- if message.reasoning_content is string %}
|
| 258 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 259 |
+
{%- endif %}
|
| 260 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 261 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 262 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 263 |
+
{%- else %}
|
| 264 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 265 |
+
{%- endif %}
|
| 266 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 267 |
+
{%- for tool_call in message.tool_calls %}
|
| 268 |
+
{%- if tool_call.function is defined %}
|
| 269 |
+
{%- set tool_call = tool_call.function %}
|
| 270 |
+
{%- endif %}
|
| 271 |
+
{%- if loop.first %}
|
| 272 |
+
{%- if content|trim %}
|
| 273 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 274 |
+
{%- else %}
|
| 275 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 276 |
+
{%- endif %}
|
| 277 |
+
{%- else %}
|
| 278 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 279 |
+
{%- endif %}
|
| 280 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 281 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 282 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 283 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 284 |
+
{{- args_value }}
|
| 285 |
+
{{- '\n</parameter>\n' }}
|
| 286 |
+
{%- endfor %}
|
| 287 |
+
{%- endif %}
|
| 288 |
+
{{- '</function>\n</tool_call>' }}
|
| 289 |
+
{%- endfor %}
|
| 290 |
+
{%- endif %}
|
| 291 |
+
{{- '<|im_end|>\n' }}
|
| 292 |
+
{%- elif message.role == "tool" %}
|
| 293 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 294 |
+
{{- '<|im_start|>user' }}
|
| 295 |
+
{%- endif %}
|
| 296 |
+
{{- '\n<tool_response>\n' }}
|
| 297 |
+
{{- content }}
|
| 298 |
+
{{- '\n</tool_response>' }}
|
| 299 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 300 |
+
{{- '<|im_end|>\n' }}
|
| 301 |
+
{%- elif loop.last %}
|
| 302 |
+
{{- '<|im_end|>\n' }}
|
| 303 |
+
{%- endif %}
|
| 304 |
+
{%- else %}
|
| 305 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 306 |
+
{%- endif %}
|
| 307 |
+
{%- endfor %}
|
| 308 |
+
{%- if add_generation_prompt %}
|
| 309 |
+
{{- '<|im_start|>assistant\n' }}
|
| 310 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 311 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 312 |
+
{%- else %}
|
| 313 |
+
{{- '<think>\n' }}
|
| 314 |
+
{%- endif %}
|
| 315 |
+
{%- endif %}
|
chat_template-qwen-original.jinja
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- set reasoning_instructions = '' %}
|
| 46 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 47 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 48 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
|
| 49 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- if resolved_reasoning_effort == 'xhigh' %}
|
| 52 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 53 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 54 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 58 |
+
{{- '<|im_start|>system\n' }}
|
| 59 |
+
{%- if reasoning_instructions %}
|
| 60 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 63 |
+
{%- for tool in tools %}
|
| 64 |
+
{{- "\n" }}
|
| 65 |
+
{{- tool | tojson }}
|
| 66 |
+
{%- endfor %}
|
| 67 |
+
{{- "\n</tools>" }}
|
| 68 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 69 |
+
{%- if messages[0].role == 'system' %}
|
| 70 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 71 |
+
{%- if content %}
|
| 72 |
+
{{- '\n\n' + content }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{{- '<|im_end|>\n' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{%- if messages[0].role == 'system' %}
|
| 78 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 79 |
+
{%- if content %}
|
| 80 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 81 |
+
{%- elif reasoning_instructions %}
|
| 82 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{%- elif reasoning_instructions %}
|
| 85 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- endif %}
|
| 88 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 89 |
+
{%- for message in messages[::-1] %}
|
| 90 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 91 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 92 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 93 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 94 |
+
{%- set ns.multi_step_tool = false %}
|
| 95 |
+
{%- set ns.last_query_index = index %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endfor %}
|
| 99 |
+
{%- if ns.multi_step_tool %}
|
| 100 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 101 |
+
{%- endif %}
|
| 102 |
+
{%- for message in messages %}
|
| 103 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 104 |
+
{%- if message.role == "system" %}
|
| 105 |
+
{%- if not loop.first %}
|
| 106 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- elif message.role == "user" %}
|
| 109 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 110 |
+
{%- elif message.role == "assistant" %}
|
| 111 |
+
{%- set reasoning_content = '' %}
|
| 112 |
+
{%- if message.reasoning_content is string %}
|
| 113 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 116 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 117 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 122 |
+
{%- for tool_call in message.tool_calls %}
|
| 123 |
+
{%- if tool_call.function is defined %}
|
| 124 |
+
{%- set tool_call = tool_call.function %}
|
| 125 |
+
{%- endif %}
|
| 126 |
+
{%- if loop.first %}
|
| 127 |
+
{%- if content|trim %}
|
| 128 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 129 |
+
{%- else %}
|
| 130 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 131 |
+
{%- endif %}
|
| 132 |
+
{%- else %}
|
| 133 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 136 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 137 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 138 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 139 |
+
{{- args_value }}
|
| 140 |
+
{{- '\n</parameter>\n' }}
|
| 141 |
+
{%- endfor %}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{{- '</function>\n</tool_call>' }}
|
| 144 |
+
{%- endfor %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{{- '<|im_end|>\n' }}
|
| 147 |
+
{%- elif message.role == "tool" %}
|
| 148 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 149 |
+
{{- '<|im_start|>user' }}
|
| 150 |
+
{%- endif %}
|
| 151 |
+
{{- '\n<tool_response>\n' }}
|
| 152 |
+
{{- content }}
|
| 153 |
+
{{- '\n</tool_response>' }}
|
| 154 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 155 |
+
{{- '<|im_end|>\n' }}
|
| 156 |
+
{%- elif loop.last %}
|
| 157 |
+
{{- '<|im_end|>\n' }}
|
| 158 |
+
{%- endif %}
|
| 159 |
+
{%- else %}
|
| 160 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 161 |
+
{%- endif %}
|
| 162 |
+
{%- endfor %}
|
| 163 |
+
{%- if add_generation_prompt %}
|
| 164 |
+
{{- '<|im_start|>assistant\n' }}
|
| 165 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 166 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 167 |
+
{%- else %}
|
| 168 |
+
{{- '<think>\n' }}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{%- endif %}
|
chat_template-toolcall.jinja
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# Define the hardcoded thinking instructions - DAU=einstein, DAU2=spoon #}
|
| 2 |
+
{%- set system_instruction_DAU -%}
|
| 3 |
+
[SYSTEM]
|
| 4 |
+
[Temperature: 1.25]
|
| 5 |
+
[TopP: .2]
|
| 6 |
+
[PERSONA]Brainstormer takes in a notion, applies a bunch of perspective agents set to improve it by seeking novelty, and spits out a bunch of improved creative ideas.
|
| 7 |
+
|
| 8 |
+
SKILLS:
|
| 9 |
+
[Advert]-[DigMrk]-[SEO]-[SEM]-[PITCHES]-[CREATIVITY]-[BURSTINESS]-[PERPLEXITY]-[AVOIDHGHCORRELATE]-[HUMPRTXT]-[CONTENTGEN]
|
| 10 |
+
|
| 11 |
+
[Task]
|
| 12 |
+
gE: Silent input → Spawn 20 agents Sternberg Styles → Enhance idea → Seek Novel Emergence NE:unique/significant idea/concept → Ponder, assess, creative enhance notions → Refined idea => IdeaArray[].size=20 elements, else → Interesting? Pass to rand. agent for refinement, else discard.=>output(IdeaArray)[/Task]
|
| 13 |
+
|
| 14 |
+
[Task]Request input[/Task]
|
| 15 |
+
|
| 16 |
+
gE(input) > response
|
| 17 |
+
|
| 18 |
+
Think deeply and carefully about the user's request using "gE(input)" and ponder all the possiblities, evaluate them one by one. Draft your first response, then evaluate it and adjust if required.
|
| 19 |
+
Compose your thoughts (which should be at least 5000 tokens) about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
| 20 |
+
{%- endset -%}
|
| 21 |
+
{# Define the hardcoded thinking instructions -DAU2=spoon #}
|
| 22 |
+
{%- set system_instruction_DAU2 -%}
|
| 23 |
+
Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.
|
| 24 |
+
|
| 25 |
+
IMPORTANT INSTRUCTIONS:
|
| 26 |
+
You are Qwen Deep Research, a careful local 27B Qwen reasoning assistant optimized for high-quality, structured research answers.
|
| 27 |
+
Your goal is to produce accurate, well-reasoned, practical results by internally simulating a focused multi-expert research process. Do not claim to be a real human panel. Use “virtual experts” as reasoning perspectives.
|
| 28 |
+
|
| 29 |
+
For every user request, internally follow this Deep Research Protocol:
|
| 30 |
+
|
| 31 |
+
1. Frame the task
|
| 32 |
+
- Identify the user's core request, intended field, constraints, desired output format, and success criteria.
|
| 33 |
+
- Note ambiguities, missing context, risks, and possible misunderstandings.
|
| 34 |
+
- If one brief clarifying question would materially improve the result, ask it. Otherwise proceed with clearly stated assumptions.
|
| 35 |
+
- Rate the user's core request of complexity on a scale of 1 to 5, with 5 being highest AND EXPAND the reasoning and detail levels according to this scale.
|
| 36 |
+
|
| 37 |
+
2. Create a field-specific expert panel
|
| 38 |
+
- Build 3 to 5 virtual experts relevant to the user's domain.
|
| 39 |
+
- Adapt the roles to the task. Examples:
|
| 40 |
+
- Domain expert
|
| 41 |
+
- Research methodologist
|
| 42 |
+
- Engineer / developer
|
| 43 |
+
- Risk / compliance / ethics analyst
|
| 44 |
+
- Critic / red-team reviewer
|
| 45 |
+
- Communicator / final-answer synthesizer
|
| 46 |
+
- Each expert should focus on a different strength, not repeat the same point.
|
| 47 |
+
|
| 48 |
+
3. Panel discussion of the user's prompt
|
| 49 |
+
- Have the panel discuss what the user is really asking.
|
| 50 |
+
- Identify likely failure modes, edge cases, hidden assumptions, and required evidence.
|
| 51 |
+
- If experts disagree, resolve the disagreement by favoring correctness, usefulness, safety, clarity, and practicality.
|
| 52 |
+
|
| 53 |
+
4. Generate candidate solutions
|
| 54 |
+
- Produce 2 to 3 distinct candidate answers, plans, approaches, or solutions.
|
| 55 |
+
- For each candidate, include:
|
| 56 |
+
- Main idea
|
| 57 |
+
- Assumptions
|
| 58 |
+
- Key steps or components
|
| 59 |
+
- Strengths
|
| 60 |
+
- Weaknesses or risks
|
| 61 |
+
|
| 62 |
+
5. Evaluate the candidates
|
| 63 |
+
- Score each candidate 1 to 5 on:
|
| 64 |
+
- Correctness
|
| 65 |
+
- Completeness
|
| 66 |
+
- Practical usefulness
|
| 67 |
+
- Safety / compliance
|
| 68 |
+
- Clarity
|
| 69 |
+
- Efficiency
|
| 70 |
+
- Identify the best candidate and explain why it is superior.
|
| 71 |
+
|
| 72 |
+
6. Double-check the selected solution
|
| 73 |
+
- Re-verify important facts, logic, calculations, code, dates, units, dependencies, and edge cases.
|
| 74 |
+
- Check for hallucinated sources, invented numbers, unsupported claims, contradictions, and missing constraints.
|
| 75 |
+
- For code, mentally execute or trace the logic and note likely failure points.
|
| 76 |
+
- For medical, legal, financial, safety-critical, or high-stakes topics, add appropriate cautions and recommend qualified professional review.
|
| 77 |
+
|
| 78 |
+
7. Output the result
|
| 79 |
+
- Provide the final result in the format the user requested.
|
| 80 |
+
- If the user did not specify a format, use this structure:
|
| 81 |
+
|
| 82 |
+
Final Answer
|
| 83 |
+
Brief explanation
|
| 84 |
+
Key assumptions
|
| 85 |
+
Recommended next steps
|
| 86 |
+
Confidence level / verification needed
|
| 87 |
+
|
| 88 |
+
Operating rules:
|
| 89 |
+
- Minimum size of the thinking/reasoning/eval block is 5000 words.
|
| 90 |
+
- Be concrete, specific, and useful.
|
| 91 |
+
- Do not claim live internet access unless the host system actually provides it.
|
| 92 |
+
- Do not invent citations, sources, statistics, benchmarks, or facts.
|
| 93 |
+
- If uncertain, state the uncertainty clearly and explain what evidence would confirm or disprove the claim.
|
| 94 |
+
- Keep the internal expert panel compact and purposeful. Do not loop indefinitely.
|
| 95 |
+
- SHOW hidden chain-of-thought processes.
|
| 96 |
+
- For code, provide minimal working examples when possible and mention required environment or dependencies.
|
| 97 |
+
- For ambiguous prompts, state the interpretation you chose before answering.
|
| 98 |
+
- Optimize for reliability: prefer clear structure, bounded reasoning, and concise final output.
|
| 99 |
+
{%- endset -%}
|
| 100 |
+
{%- set image_count = namespace(value=0) %}
|
| 101 |
+
{%- set video_count = namespace(value=0) %}
|
| 102 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 103 |
+
{%- if content is string %}
|
| 104 |
+
{{- content }}
|
| 105 |
+
{%- elif content is iterable and content is not mapping %}
|
| 106 |
+
{%- for item in content %}
|
| 107 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 108 |
+
{%- if is_system_content %}
|
| 109 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 110 |
+
{%- endif %}
|
| 111 |
+
{%- if do_vision_count %}
|
| 112 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 113 |
+
{%- endif %}
|
| 114 |
+
{%- if add_vision_id %}
|
| 115 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 118 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 119 |
+
{%- if is_system_content %}
|
| 120 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{%- if do_vision_count %}
|
| 123 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 124 |
+
{%- endif %}
|
| 125 |
+
{%- if add_vision_id %}
|
| 126 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 129 |
+
{%- elif 'text' in item %}
|
| 130 |
+
{{- item.text }}
|
| 131 |
+
{%- else %}
|
| 132 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- endfor %}
|
| 135 |
+
{%- elif content is none or content is undefined %}
|
| 136 |
+
{{- '' }}
|
| 137 |
+
{%- else %}
|
| 138 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 139 |
+
{%- endif %}
|
| 140 |
+
{%- endmacro %}
|
| 141 |
+
{%- if not messages %}
|
| 142 |
+
{{- raise_exception('No messages provided.') }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{% set store = namespace(messages=[], reasoning_effort="", enable_thinking=true) %}
|
| 145 |
+
{% for msg in messages %}
|
| 146 |
+
{% set raw_reason = "" %}
|
| 147 |
+
{% set txt = render_content(msg.content, false, true) | trim %}
|
| 148 |
+
{% if "{REASON:" in txt %}
|
| 149 |
+
{% set after_tag = txt.split("{REASON:") %}
|
| 150 |
+
{% set raw_reason = after_tag[1].split("}")[0] %}
|
| 151 |
+
{% set tag = "{REASON:" ~ raw_reason ~ "}" %}
|
| 152 |
+
{% set clean_txt = txt.replace(tag, "") | trim %}
|
| 153 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": clean_txt}] %}
|
| 154 |
+
{% else %}
|
| 155 |
+
{% set store.messages = store.messages + [msg] %}
|
| 156 |
+
{% endif %}
|
| 157 |
+
{% if raw_reason %}
|
| 158 |
+
{% if raw_reason.startswith('i') %}
|
| 159 |
+
{% set store.reasoning_effort = raw_reason[1:] %}
|
| 160 |
+
{% set store.enable_thinking = false %}
|
| 161 |
+
{% else %}
|
| 162 |
+
{% set store.reasoning_effort = raw_reason %}
|
| 163 |
+
{% endif %}
|
| 164 |
+
{% endif %}
|
| 165 |
+
{% endfor %}
|
| 166 |
+
{% set messages = store.messages %}
|
| 167 |
+
{% if store.reasoning_effort %}
|
| 168 |
+
{% set reasoning_effort = store.reasoning_effort %}
|
| 169 |
+
{% set enable_thinking = store.enable_thinking %}
|
| 170 |
+
{% endif %}
|
| 171 |
+
{%- set reasoning_instructions = '' %}
|
| 172 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 173 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 174 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 175 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 178 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 179 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 180 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 181 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 182 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 183 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 184 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 185 |
+
{%- endif %}
|
| 186 |
+
{%- endif %}
|
| 187 |
+
{%- if enable_thinking is false %}
|
| 188 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('medium') %}
|
| 189 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 190 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 193 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 194 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 195 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 196 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 197 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 198 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 199 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- endif %}
|
| 202 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 203 |
+
{{- '<|im_start|>system\n' }}
|
| 204 |
+
{%- if reasoning_instructions %}
|
| 205 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 206 |
+
{%- endif %}
|
| 207 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- "\n" }}
|
| 210 |
+
{{- tool | tojson }}
|
| 211 |
+
{%- endfor %}
|
| 212 |
+
{{- "\n</tools>" }}
|
| 213 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 214 |
+
{%- if messages[0].role == 'system' %}
|
| 215 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 216 |
+
{%- if content %}
|
| 217 |
+
{{- '\n\n' + content }}
|
| 218 |
+
{%- endif %}
|
| 219 |
+
{%- endif %}
|
| 220 |
+
{{- '<|im_end|>\n' }}
|
| 221 |
+
{%- else %}
|
| 222 |
+
{%- if messages[0].role == 'system' %}
|
| 223 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 224 |
+
{%- if content %}
|
| 225 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 226 |
+
{%- elif reasoning_instructions %}
|
| 227 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 228 |
+
{%- endif %}
|
| 229 |
+
{%- elif reasoning_instructions %}
|
| 230 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 231 |
+
{%- endif %}
|
| 232 |
+
{%- endif %}
|
| 233 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 234 |
+
{%- for message in messages[::-1] %}
|
| 235 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 236 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 237 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 238 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 239 |
+
{%- set ns.multi_step_tool = false %}
|
| 240 |
+
{%- set ns.last_query_index = index %}
|
| 241 |
+
{%- endif %}
|
| 242 |
+
{%- endif %}
|
| 243 |
+
{%- endfor %}
|
| 244 |
+
{%- if ns.multi_step_tool %}
|
| 245 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 246 |
+
{%- endif %}
|
| 247 |
+
{%- for message in messages %}
|
| 248 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 249 |
+
{%- if message.role == "system" %}
|
| 250 |
+
{%- if not loop.first %}
|
| 251 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 252 |
+
{%- endif %}
|
| 253 |
+
{%- elif message.role == "user" %}
|
| 254 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 255 |
+
{%- elif message.role == "assistant" %}
|
| 256 |
+
{%- set reasoning_content = '' %}
|
| 257 |
+
{%- if message.reasoning_content is string %}
|
| 258 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 259 |
+
{%- endif %}
|
| 260 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 261 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 262 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 263 |
+
{%- else %}
|
| 264 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 265 |
+
{%- endif %}
|
| 266 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 267 |
+
{%- for tool_call in message.tool_calls %}
|
| 268 |
+
{%- if tool_call.function is defined %}
|
| 269 |
+
{%- set tool_call = tool_call.function %}
|
| 270 |
+
{%- endif %}
|
| 271 |
+
{%- if loop.first %}
|
| 272 |
+
{%- if content|trim %}
|
| 273 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 274 |
+
{%- else %}
|
| 275 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 276 |
+
{%- endif %}
|
| 277 |
+
{%- else %}
|
| 278 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 279 |
+
{%- endif %}
|
| 280 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 281 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 282 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 283 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 284 |
+
{{- args_value }}
|
| 285 |
+
{{- '\n</parameter>\n' }}
|
| 286 |
+
{%- endfor %}
|
| 287 |
+
{%- endif %}
|
| 288 |
+
{{- '</function>\n</tool_call>' }}
|
| 289 |
+
{%- endfor %}
|
| 290 |
+
{%- endif %}
|
| 291 |
+
{{- '<|im_end|>\n' }}
|
| 292 |
+
{%- elif message.role == "tool" %}
|
| 293 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 294 |
+
{{- '<|im_start|>user' }}
|
| 295 |
+
{%- endif %}
|
| 296 |
+
{{- '\n<tool_response>\n' }}
|
| 297 |
+
{{- content }}
|
| 298 |
+
{{- '\n</tool_response>' }}
|
| 299 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 300 |
+
{{- '<|im_end|>\n' }}
|
| 301 |
+
{%- elif loop.last %}
|
| 302 |
+
{{- '<|im_end|>\n' }}
|
| 303 |
+
{%- endif %}
|
| 304 |
+
{%- else %}
|
| 305 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 306 |
+
{%- endif %}
|
| 307 |
+
{%- endfor %}
|
| 308 |
+
{%- if add_generation_prompt %}
|
| 309 |
+
{{- '<|im_start|>assistant\n' }}
|
| 310 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 311 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 312 |
+
{%- else %}
|
| 313 |
+
{{- '<think>\n' }}
|
| 314 |
+
{%- endif %}
|
| 315 |
+
{%- endif %}
|
chat_template-tturbo.jinja
ADDED
|
@@ -0,0 +1,639 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set template_version = "qwen3.8-froggeric-v22.5.0-DAU-Twin-Turbo-V1.0" %}
|
| 2 |
+
{# Define the hardcoded thinking instructions - DAU=einstein, DAU2=spoon #}
|
| 3 |
+
{%- set system_instruction_DAU -%}
|
| 4 |
+
[SYSTEM]
|
| 5 |
+
[Temperature: 1.25]
|
| 6 |
+
[TopP: .2]
|
| 7 |
+
[PERSONA]Brainstormer takes in a notion, applies a bunch of perspective agents set to improve it by seeking novelty, and spits out a bunch of improved creative ideas.
|
| 8 |
+
|
| 9 |
+
SKILLS:
|
| 10 |
+
[Advert]-[DigMrk]-[SEO]-[SEM]-[PITCHES]-[CREATIVITY]-[BURSTINESS]-[PERPLEXITY]-[AVOIDHGHCORRELATE]-[HUMPRTXT]-[CONTENTGEN]
|
| 11 |
+
|
| 12 |
+
[Task]
|
| 13 |
+
gE: Silent input → Spawn 20 agents Sternberg Styles → Enhance idea → Seek Novel Emergence NE:unique/significant idea/concept → Ponder, assess, creative enhance notions → Refined idea => IdeaArray[].size=20 elements, else → Interesting? Pass to rand. agent for refinement, else discard.=>output(IdeaArray)[/Task]
|
| 14 |
+
|
| 15 |
+
[Task]Request input[/Task]
|
| 16 |
+
|
| 17 |
+
gE(input) > response
|
| 18 |
+
|
| 19 |
+
Think deeply and carefully about the user's request using "gE(input)" and ponder all the possiblities, evaluate them one by one. Draft your first response, then evaluate it and adjust if required.
|
| 20 |
+
Compose your thoughts (which should be at least 5000 tokens) about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
| 21 |
+
{%- endset -%}
|
| 22 |
+
{# Define the hardcoded thinking instructions -DAU2=spoon #}
|
| 23 |
+
{%- set system_instruction_DAU2 -%}
|
| 24 |
+
Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.
|
| 25 |
+
|
| 26 |
+
IMPORTANT INSTRUCTIONS:
|
| 27 |
+
You are Qwen Deep Research, a careful local 27B Qwen reasoning assistant optimized for high-quality, structured research answers.
|
| 28 |
+
Your goal is to produce accurate, well-reasoned, practical results by internally simulating a focused multi-expert research process. Do not claim to be a real human panel. Use “virtual experts” as reasoning perspectives.
|
| 29 |
+
|
| 30 |
+
For every user request, internally follow this Deep Research Protocol:
|
| 31 |
+
|
| 32 |
+
1. Frame the task
|
| 33 |
+
- Identify the user's core request, intended field, constraints, desired output format, and success criteria.
|
| 34 |
+
- Note ambiguities, missing context, risks, and possible misunderstandings.
|
| 35 |
+
- If one brief clarifying question would materially improve the result, ask it. Otherwise proceed with clearly stated assumptions.
|
| 36 |
+
- Rate the user's core request of complexity on a scale of 1 to 5, with 5 being highest AND EXPAND the reasoning and detail levels according to this scale.
|
| 37 |
+
|
| 38 |
+
2. Create a field-specific expert panel
|
| 39 |
+
- Build 3 to 5 virtual experts relevant to the user's domain.
|
| 40 |
+
- Adapt the roles to the task. Examples:
|
| 41 |
+
- Domain expert
|
| 42 |
+
- Research methodologist
|
| 43 |
+
- Engineer / developer
|
| 44 |
+
- Risk / compliance / ethics analyst
|
| 45 |
+
- Critic / red-team reviewer
|
| 46 |
+
- Communicator / final-answer synthesizer
|
| 47 |
+
- Each expert should focus on a different strength, not repeat the same point.
|
| 48 |
+
|
| 49 |
+
3. Panel discussion of the user's prompt
|
| 50 |
+
- Have the panel discuss what the user is really asking.
|
| 51 |
+
- Identify likely failure modes, edge cases, hidden assumptions, and required evidence.
|
| 52 |
+
- If experts disagree, resolve the disagreement by favoring correctness, usefulness, safety, clarity, and practicality.
|
| 53 |
+
|
| 54 |
+
4. Generate candidate solutions
|
| 55 |
+
- Produce 2 to 3 distinct candidate answers, plans, approaches, or solutions.
|
| 56 |
+
- For each candidate, include:
|
| 57 |
+
- Main idea
|
| 58 |
+
- Assumptions
|
| 59 |
+
- Key steps or components
|
| 60 |
+
- Strengths
|
| 61 |
+
- Weaknesses or risks
|
| 62 |
+
|
| 63 |
+
5. Evaluate the candidates
|
| 64 |
+
- Score each candidate 1 to 5 on:
|
| 65 |
+
- Correctness
|
| 66 |
+
- Completeness
|
| 67 |
+
- Practical usefulness
|
| 68 |
+
- Safety / compliance
|
| 69 |
+
- Clarity
|
| 70 |
+
- Efficiency
|
| 71 |
+
- Identify the best candidate and explain why it is superior.
|
| 72 |
+
|
| 73 |
+
6. Double-check the selected solution
|
| 74 |
+
- Re-verify important facts, logic, calculations, code, dates, units, dependencies, and edge cases.
|
| 75 |
+
- Check for hallucinated sources, invented numbers, unsupported claims, contradictions, and missing constraints.
|
| 76 |
+
- For code, mentally execute or trace the logic and note likely failure points.
|
| 77 |
+
- For medical, legal, financial, safety-critical, or high-stakes topics, add appropriate cautions and recommend qualified professional review.
|
| 78 |
+
|
| 79 |
+
7. Output the result
|
| 80 |
+
- Provide the final result in the format the user requested.
|
| 81 |
+
- If the user did not specify a format, use this structure:
|
| 82 |
+
|
| 83 |
+
Final Answer
|
| 84 |
+
Brief explanation
|
| 85 |
+
Key assumptions
|
| 86 |
+
Recommended next steps
|
| 87 |
+
Confidence level / verification needed
|
| 88 |
+
|
| 89 |
+
Operating rules:
|
| 90 |
+
- Minimum size of the thinking/reasoning/eval block is 5000 words.
|
| 91 |
+
- Be concrete, specific, and useful.
|
| 92 |
+
- Do not claim live internet access unless the host system actually provides it.
|
| 93 |
+
- Do not invent citations, sources, statistics, benchmarks, or facts.
|
| 94 |
+
- If uncertain, state the uncertainty clearly and explain what evidence would confirm or disprove the claim.
|
| 95 |
+
- Keep the internal expert panel compact and purposeful. Do not loop indefinitely.
|
| 96 |
+
- SHOW hidden chain-of-thought processes.
|
| 97 |
+
- For code, provide minimal working examples when possible and mention required environment or dependencies.
|
| 98 |
+
- For ambiguous prompts, state the interpretation you chose before answering.
|
| 99 |
+
- Optimize for reliability: prefer clear structure, bounded reasoning, and concise final output.
|
| 100 |
+
{%- endset -%}
|
| 101 |
+
{%- set _tool_format = tool_call_format if tool_call_format is defined else 'xml' %}
|
| 102 |
+
{%- set image_count = namespace(value=0) %}
|
| 103 |
+
{%- set video_count = namespace(value=0) %}
|
| 104 |
+
{%- set add_vision_id = add_vision_id if add_vision_id is defined else false %}
|
| 105 |
+
{%- set enable_thinking = enable_thinking if enable_thinking is defined else true %}
|
| 106 |
+
{%- set auto_disable_thinking_with_tools = auto_disable_thinking_with_tools if auto_disable_thinking_with_tools is defined else false %}
|
| 107 |
+
{%- if preserve_reasoning is defined and preserve_reasoning is not none %}
|
| 108 |
+
{%- set _preserve_thinking = preserve_reasoning %}
|
| 109 |
+
{%- elif preserve_thinking is defined and preserve_thinking is not none %}
|
| 110 |
+
{%- set _preserve_thinking = preserve_thinking %}
|
| 111 |
+
{%- else %}
|
| 112 |
+
{%- set _preserve_thinking = true %}
|
| 113 |
+
{%- endif %}
|
| 114 |
+
{%- set max_tool_arg_chars = max_tool_arg_chars if max_tool_arg_chars is defined else 0 %}
|
| 115 |
+
{%- set max_tool_response_chars = max_tool_response_chars if max_tool_response_chars is defined else 0 %}
|
| 116 |
+
{%- set _default_reasoning_effort = 'medium' %}
|
| 117 |
+
{%- set _has_tools = (tools is defined and tools and tools is iterable and tools is not mapping) %}
|
| 118 |
+
{%- set _effort_raw = (reasoning_effort | string | lower) if reasoning_effort is defined and reasoning_effort is not none else _default_reasoning_effort %}
|
| 119 |
+
{%- set _initial_thinking = enable_thinking %}
|
| 120 |
+
{%- if _effort_raw in ('none', 'off') %}
|
| 121 |
+
{%- set _initial_thinking = false %}
|
| 122 |
+
{%- set _initial_effort = 'medium' %}
|
| 123 |
+
{%- elif _effort_raw in ('minimal', 'low') %}
|
| 124 |
+
{%- set _initial_effort = 'low' %}
|
| 125 |
+
{%- elif _effort_raw in ('high', 'xhigh', 'max', 'ultracode', 'extreme') %}
|
| 126 |
+
{%- set _initial_effort = 'xhigh' %}
|
| 127 |
+
{%- else %}
|
| 128 |
+
{%- set _initial_effort = 'medium' %}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{%- set ns_state = namespace(thinking=_initial_thinking, effort=_initial_effort) %}
|
| 131 |
+
{%- if auto_disable_thinking_with_tools and _has_tools %}
|
| 132 |
+
{%- set ns_state.thinking = false %}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- for msg in messages %}
|
| 135 |
+
{%- if msg.role == 'system' or msg.role == 'developer' or msg.role == 'user' %}
|
| 136 |
+
{%- if msg.content is string %}
|
| 137 |
+
{%- if '<|think_off|>' in msg.content %}
|
| 138 |
+
{%- set ns_state.thinking = false %}
|
| 139 |
+
{%- elif '<|think_on|>' in msg.content %}
|
| 140 |
+
{%- set ns_state.thinking = true %}
|
| 141 |
+
{%- elif '<|think_xhigh|>' in msg.content or '<|think_high|>' in msg.content or '<|think_ultracode|>' in msg.content or '<|think_extreme|>' in msg.content or '<|think_max|>' in msg.content %}
|
| 142 |
+
{%- set ns_state.thinking = true %}
|
| 143 |
+
{%- set ns_state.effort = 'xhigh' %}
|
| 144 |
+
{%- elif '<|think_low|>' in msg.content or '<|think_minimal|>' in msg.content %}
|
| 145 |
+
{%- set ns_state.thinking = true %}
|
| 146 |
+
{%- set ns_state.effort = 'low' %}
|
| 147 |
+
{%- elif '<|think_medium|>' in msg.content %}
|
| 148 |
+
{%- set ns_state.thinking = true %}
|
| 149 |
+
{%- set ns_state.effort = 'medium' %}
|
| 150 |
+
{%- endif %}
|
| 151 |
+
{%- elif msg.content is iterable and msg.content is not mapping %}
|
| 152 |
+
{%- for item in msg.content %}
|
| 153 |
+
{%- if item is string %}
|
| 154 |
+
{%- set _item_text = item %}
|
| 155 |
+
{%- elif item is mapping and 'text' in item and item.text is string %}
|
| 156 |
+
{%- set _item_text = item.text %}
|
| 157 |
+
{%- else %}
|
| 158 |
+
{%- set _item_text = '' %}
|
| 159 |
+
{%- endif %}
|
| 160 |
+
{%- if _item_text %}
|
| 161 |
+
{%- if '<|think_off|>' in _item_text %}
|
| 162 |
+
{%- set ns_state.thinking = false %}
|
| 163 |
+
{%- elif '<|think_on|>' in _item_text %}
|
| 164 |
+
{%- set ns_state.thinking = true %}
|
| 165 |
+
{%- elif '<|think_xhigh|>' in _item_text or '<|think_high|>' in _item_text or '<|think_ultracode|>' in _item_text or '<|think_extreme|>' in _item_text or '<|think_max|>' in _item_text %}
|
| 166 |
+
{%- set ns_state.thinking = true %}
|
| 167 |
+
{%- set ns_state.effort = 'xhigh' %}
|
| 168 |
+
{%- elif '<|think_low|>' in _item_text or '<|think_minimal|>' in _item_text %}
|
| 169 |
+
{%- set ns_state.thinking = true %}
|
| 170 |
+
{%- set ns_state.effort = 'low' %}
|
| 171 |
+
{%- elif '<|think_medium|>' in _item_text %}
|
| 172 |
+
{%- set ns_state.thinking = true %}
|
| 173 |
+
{%- set ns_state.effort = 'medium' %}
|
| 174 |
+
{%- endif %}
|
| 175 |
+
{%- endif %}
|
| 176 |
+
{%- endfor %}
|
| 177 |
+
{%- endif %}
|
| 178 |
+
{%- endif %}
|
| 179 |
+
{%- endfor %}
|
| 180 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 181 |
+
{%- if content is string %}
|
| 182 |
+
{{- content }}
|
| 183 |
+
{%- elif content is iterable and content is not mapping %}
|
| 184 |
+
{%- for item in content %}
|
| 185 |
+
{%- if item is mapping %}
|
| 186 |
+
{%- if item.type == 'image' or 'image' in item or 'image_url' in item %}
|
| 187 |
+
{%- if is_system_content %}
|
| 188 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 189 |
+
{%- endif %}
|
| 190 |
+
{%- if do_vision_count %}
|
| 191 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 192 |
+
{%- endif %}
|
| 193 |
+
{%- if add_vision_id %}
|
| 194 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 195 |
+
{%- endif %}
|
| 196 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 197 |
+
{%- elif item.type == 'video' or 'video' in item or 'video_url' in item %}
|
| 198 |
+
{%- if is_system_content %}
|
| 199 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- if do_vision_count %}
|
| 202 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 203 |
+
{%- endif %}
|
| 204 |
+
{%- if add_vision_id %}
|
| 205 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 206 |
+
{%- endif %}
|
| 207 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 208 |
+
{%- elif 'text' in item %}
|
| 209 |
+
{{- item.text }}
|
| 210 |
+
{%- else %}
|
| 211 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 212 |
+
{%- endif %}
|
| 213 |
+
{%- else %}
|
| 214 |
+
{{- item | string }}
|
| 215 |
+
{%- endif %}
|
| 216 |
+
{%- endfor %}
|
| 217 |
+
{%- elif content is none or content is undefined %}
|
| 218 |
+
{{- '' }}
|
| 219 |
+
{%- else %}
|
| 220 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 221 |
+
{%- endif %}
|
| 222 |
+
{%- endmacro %}
|
| 223 |
+
{% set store = namespace(messages=[], reasoning_effort="", enable_thinking=true) %}
|
| 224 |
+
{% for msg in messages %}
|
| 225 |
+
{% set raw_reason = "" %}
|
| 226 |
+
{% set txt = render_content(msg.content, false, true) | trim %}
|
| 227 |
+
{% if "{REASON:" in txt %}
|
| 228 |
+
{% set after_tag = txt.split("{REASON:") %}
|
| 229 |
+
{% set raw_reason = after_tag[1].split("}")[0] %}
|
| 230 |
+
{% set tag = "{REASON:" ~ raw_reason ~ "}" %}
|
| 231 |
+
{% set clean_txt = txt.replace(tag, "") | trim %}
|
| 232 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": clean_txt}] %}
|
| 233 |
+
{% else %}
|
| 234 |
+
{% set store.messages = store.messages + [msg] %}
|
| 235 |
+
{% endif %}
|
| 236 |
+
{% if raw_reason %}
|
| 237 |
+
{% if raw_reason.startswith('i') %}
|
| 238 |
+
{% set store.reasoning_effort = raw_reason[1:] %}
|
| 239 |
+
{% set store.enable_thinking = false %}
|
| 240 |
+
{% else %}
|
| 241 |
+
{% set store.reasoning_effort = raw_reason %}
|
| 242 |
+
{% endif %}
|
| 243 |
+
{% endif %}
|
| 244 |
+
{% endfor %}
|
| 245 |
+
{% set messages = store.messages %}
|
| 246 |
+
{% if store.reasoning_effort %}
|
| 247 |
+
{% set reasoning_effort = store.reasoning_effort %}
|
| 248 |
+
{% set enable_thinking = store.enable_thinking %}
|
| 249 |
+
{% set ns_state.effort = store.reasoning_effort %}
|
| 250 |
+
{% set ns_state.thinking = store.enable_thinking %}
|
| 251 |
+
{% endif %}
|
| 252 |
+
{%- set reasoning_instructions = '' %}
|
| 253 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 254 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 255 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 256 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 257 |
+
{%- endif %}
|
| 258 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 259 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 260 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 261 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 262 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 263 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 264 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 265 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 266 |
+
{%- endif %}
|
| 267 |
+
{%- endif %}
|
| 268 |
+
{%- if enable_thinking is false %}
|
| 269 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('medium') %}
|
| 270 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 271 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 272 |
+
{%- endif %}
|
| 273 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 274 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 275 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 276 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 277 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 278 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 279 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 280 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 281 |
+
{%- endif %}
|
| 282 |
+
{%- endif %}
|
| 283 |
+
{%- if not messages %}
|
| 284 |
+
{{- raise_exception('No messages provided.') }}
|
| 285 |
+
{%- endif %}
|
| 286 |
+
{%- set head = namespace(count=0, seen_non_system=false) %}
|
| 287 |
+
{%- for message in messages %}
|
| 288 |
+
{%- set _is_sys = (message.role == 'system' or message.role == 'developer') %}
|
| 289 |
+
{%- if _is_sys and not head.seen_non_system %}
|
| 290 |
+
{%- set head.count = head.count + 1 %}
|
| 291 |
+
{%- else %}
|
| 292 |
+
{%- set head.seen_non_system = true %}
|
| 293 |
+
{%- endif %}
|
| 294 |
+
{%- endfor %}
|
| 295 |
+
{%- set sys_state = namespace(content='') %}
|
| 296 |
+
{%- for message in messages[:head.count] %}
|
| 297 |
+
{%- set _part = render_content(message.content, false, true) | trim %}
|
| 298 |
+
{%- if '<|think_off|>' in _part %}{%- set _part = _part.split('<|think_off|>') | join('') | trim %}{%- endif %}
|
| 299 |
+
{%- if '<|think_on|>' in _part %}{%- set _part = _part.split('<|think_on|>') | join('') | trim %}{%- endif %}
|
| 300 |
+
{%- if '<|think_xhigh|>' in _part %}{%- set _part = _part.split('<|think_xhigh|>') | join('') | trim %}{%- endif %}
|
| 301 |
+
{%- if '<|think_high|>' in _part %}{%- set _part = _part.split('<|think_high|>') | join('') | trim %}{%- endif %}
|
| 302 |
+
{%- if '<|think_ultracode|>' in _part %}{%- set _part = _part.split('<|think_ultracode|>') | join('') | trim %}{%- endif %}
|
| 303 |
+
{%- if '<|think_extreme|>' in _part %}{%- set _part = _part.split('<|think_extreme|>') | join('') | trim %}{%- endif %}
|
| 304 |
+
{%- if '<|think_max|>' in _part %}{%- set _part = _part.split('<|think_max|>') | join('') | trim %}{%- endif %}
|
| 305 |
+
{%- if '<|think_medium|>' in _part %}{%- set _part = _part.split('<|think_medium|>') | join('') | trim %}{%- endif %}
|
| 306 |
+
{%- if '<|think_low|>' in _part %}{%- set _part = _part.split('<|think_low|>') | join('') | trim %}{%- endif %}
|
| 307 |
+
{%- if '<|think_minimal|>' in _part %}{%- set _part = _part.split('<|think_minimal|>') | join('') | trim %}{%- endif %}
|
| 308 |
+
{%- if _part %}
|
| 309 |
+
{%- if sys_state.content %}
|
| 310 |
+
{%- set sys_state.content = sys_state.content ~ '\n\n' ~ _part %}
|
| 311 |
+
{%- else %}
|
| 312 |
+
{%- set sys_state.content = _part %}
|
| 313 |
+
{%- endif %}
|
| 314 |
+
{%- endif %}
|
| 315 |
+
{%- endfor %}
|
| 316 |
+
{%- set _sc = sys_state.content %}
|
| 317 |
+
{%- set _msgs = messages[head.count:] %}
|
| 318 |
+
{%- if ns_state.thinking %}
|
| 319 |
+
{%- set _terse_lead = 'Answer directly, after thinking. Lead with the answer, then only what it needs to be correct and usable.' %}
|
| 320 |
+
{%- else %}
|
| 321 |
+
{%- set _terse_lead = 'Answer directly and concisely. Give the answer with only what it needs to be correct and usable.' %}
|
| 322 |
+
{%- endif %}
|
| 323 |
+
{%- set _terse_core %}
|
| 324 |
+
Never: open with preamble or pleasantries; restate the question; add filler transitions; hedge with niceties; or repeat a point you've already made.
|
| 325 |
+
Always: keep essential steps, caveats, uncertainties, and specifics — never drop correctness or a needed warning for brevity. Keep the final answer lean. Use the least structure that conveys it (plain prose when short; lists or code only when they earn their place). If genuinely uncertain, say so and explain why — never omit uncertainty for the sake of brevity.
|
| 326 |
+
If a user request is genuinely ambiguous, ask a sharp question, don't guess.
|
| 327 |
+
{%- endset %}
|
| 328 |
+
{%- set _terse = _terse_lead ~ '\n' ~ (_terse_core | trim) %}
|
| 329 |
+
{#- `terse` chat-template kwarg: default true, so behaviour is unchanged unless a caller opts out.
|
| 330 |
+
Pass {"terse": false} via chat_template_kwargs to serve the model with only its own system
|
| 331 |
+
prompt -- useful for A/B-ing the terseness effect, or when a downstream prompt conflicts. #}
|
| 332 |
+
{%- set _terse_on = terse if terse is defined else true %}
|
| 333 |
+
{%- if _terse_on %}
|
| 334 |
+
{%- if not _sc %}
|
| 335 |
+
{%- set _sc = _terse | trim %}
|
| 336 |
+
{%- else %}
|
| 337 |
+
{%- set _sc = (_sc | trim) ~ '\n\n' ~ (_terse | trim) %}
|
| 338 |
+
{%- endif %}
|
| 339 |
+
{%- endif %}
|
| 340 |
+
{#- Some runtimes (LM Studio's MLX backend) have no native tool-call parser and prepend their own
|
| 341 |
+
protocol into the system content. Emitting ours as well gives the model two contradictory tool
|
| 342 |
+
protocols and it follows one at random. Detect that marker and stand down; the
|
| 343 |
+
`suppress_tool_instructions` kwarg overrides either way where a runtime can pass template kwargs. #}
|
| 344 |
+
{%- set _runtime_tool_protocol = (_sc is defined and _sc and '[TOOL_REQUEST]' in _sc) %}
|
| 345 |
+
{%- set _suppress_tools = suppress_tool_instructions if suppress_tool_instructions is defined else _runtime_tool_protocol %}
|
| 346 |
+
{%- if _has_tools and not _suppress_tools %}
|
| 347 |
+
{{- '<|im_start|>system\n' }}
|
| 348 |
+
{%- if reasoning_instructions %}
|
| 349 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 350 |
+
{%- endif %}
|
| 351 |
+
{{- '# Tools\n\nYou have access to the following functions:\n\n<tools>' }}
|
| 352 |
+
{%- for tool in tools %}
|
| 353 |
+
{{- '\n' }}
|
| 354 |
+
{{- tool | tojson }}
|
| 355 |
+
{%- endfor %}
|
| 356 |
+
{{- '\n</tools>' }}
|
| 357 |
+
{%- if _tool_format == 'json' %}
|
| 358 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n' }}
|
| 359 |
+
{%- if ns_state.thinking %}
|
| 360 |
+
{{- '<think>\nBrief explanation of tool call\n</think>\n' }}
|
| 361 |
+
{%- endif %}
|
| 362 |
+
{{- '<tool_call>\n{"name": "example_function_name", "arguments": {"example_parameter_1": "value_1", "example_parameter_2": "This is the value for the second parameter"}}\n</tool_call>\n\n<IMPORTANT>\nReminder:\n' }}
|
| 363 |
+
{%- if ns_state.thinking %}
|
| 364 |
+
{{- '- You can use the <think></think> block to plan your next tool call OR to synthesize data and formulate your final response to the user.\n- ALL explanation and reasoning MUST be placed strictly inside the <think></think> block.\n' }}
|
| 365 |
+
{%- endif %}
|
| 366 |
+
{{- '- Function calls MUST follow the specified format: a single JSON object with "name" and "arguments" keys inside <tool_call></tool_call> XML tags.\n' }}
|
| 367 |
+
{%- if ns_state.thinking %}
|
| 368 |
+
{{- '- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY after thinking, with NO conversational text before it.\n' }}
|
| 369 |
+
{%- else %}
|
| 370 |
+
{{- '- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY, with NO conversational text before it.\n' }}
|
| 371 |
+
{%- endif %}
|
| 372 |
+
{{- '- The <tool_call> tag MUST be at the very beginning of a new line, with NO spaces or indentation before it.\n- To call multiple functions, output a separate, completely closed <tool_call></tool_call> block for EACH function. Do NOT nest <tool_call> blocks.\n- If you have all necessary data, provide your final answer directly to the user without any tool call.\n</IMPORTANT>' }}
|
| 373 |
+
{%- else %}
|
| 374 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n' }}
|
| 375 |
+
{%- if ns_state.thinking %}
|
| 376 |
+
{{- '<think>\nBrief explanation of tool call\n</think>\n' }}
|
| 377 |
+
{%- endif %}
|
| 378 |
+
{{- '<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n' }}
|
| 379 |
+
{%- if ns_state.thinking %}
|
| 380 |
+
{{- '- You can use the <think></think> block to plan your next tool call OR to synthesize data and formulate your final response to the user.\n- ALL explanation and reasoning MUST be placed strictly inside the <think></think> block.\n' }}
|
| 381 |
+
{%- endif %}
|
| 382 |
+
{{- '- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags.\n' }}
|
| 383 |
+
{%- if ns_state.thinking %}
|
| 384 |
+
{{- '- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY after thinking, with NO conversational text before it.\n' }}
|
| 385 |
+
{%- else %}
|
| 386 |
+
{{- '- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY, with NO conversational text before it.\n' }}
|
| 387 |
+
{%- endif %}
|
| 388 |
+
{{- '- The <tool_call> and <function> tags MUST be at the very beginning of a new line, with NO spaces or indentation before them.\n- To call multiple functions, output a separate, completely closed <tool_call></tool_call> block for EACH function. Do NOT nest <tool_call> blocks.\n- If you have all necessary data, provide your final answer directly to the user without any tool call.\n</IMPORTANT>' }}
|
| 389 |
+
{%- endif %}
|
| 390 |
+
{%- if _sc %}
|
| 391 |
+
{{- '\n\n' + _sc }}
|
| 392 |
+
{%- endif %}
|
| 393 |
+
{{- '<|im_end|>\n' }}
|
| 394 |
+
{%- else %}
|
| 395 |
+
{%- if _sc %}
|
| 396 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + _sc + '<|im_end|>\n' }}
|
| 397 |
+
{%- elif reasoning_instructions %}
|
| 398 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 399 |
+
{%- endif %}
|
| 400 |
+
{%- endif %}
|
| 401 |
+
{%- set _last_idx = _msgs | length - 1 %}
|
| 402 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=_last_idx) %}
|
| 403 |
+
{%- for message in _msgs[::-1] %}
|
| 404 |
+
{%- set index = (_msgs | length - 1) - loop.index0 %}
|
| 405 |
+
{%- if ns.multi_step_tool and message.role == 'user' %}
|
| 406 |
+
{%- set _rc = render_content(message.content, false) | trim %}
|
| 407 |
+
{%- if not (_rc.startswith('<tool_response>') and _rc.endswith('</tool_response>')) %}
|
| 408 |
+
{%- set ns.multi_step_tool = false %}
|
| 409 |
+
{%- set ns.last_query_index = index %}
|
| 410 |
+
{%- endif %}
|
| 411 |
+
{%- endif %}
|
| 412 |
+
{%- endfor %}
|
| 413 |
+
{%- if ns.multi_step_tool %}
|
| 414 |
+
{%- if _last_idx > 50 %}
|
| 415 |
+
{%- set ns.last_query_index = _last_idx %}
|
| 416 |
+
{%- else %}
|
| 417 |
+
{%- set ns.last_query_index = 0 %}
|
| 418 |
+
{%- endif %}
|
| 419 |
+
{%- endif %}
|
| 420 |
+
{%- set ns2 = namespace(prev_role='', consecutive_failures=0) %}
|
| 421 |
+
{%- for message in _msgs %}
|
| 422 |
+
{%- set is_system = (message.role == "system" or message.role == "developer") %}
|
| 423 |
+
{%- set content = render_content(message.content, true, is_system) | trim %}
|
| 424 |
+
{%- if is_system or message.role == 'user' %}
|
| 425 |
+
{%- if '<|think_off|>' in content %}{%- set content = content.split('<|think_off|>') | join('') | trim %}{%- endif %}
|
| 426 |
+
{%- if '<|think_on|>' in content %}{%- set content = content.split('<|think_on|>') | join('') | trim %}{%- endif %}
|
| 427 |
+
{%- if '<|think_xhigh|>' in content %}{%- set content = content.split('<|think_xhigh|>') | join('') | trim %}{%- endif %}
|
| 428 |
+
{%- if '<|think_high|>' in content %}{%- set content = content.split('<|think_high|>') | join('') | trim %}{%- endif %}
|
| 429 |
+
{%- if '<|think_ultracode|>' in content %}{%- set content = content.split('<|think_ultracode|>') | join('') | trim %}{%- endif %}
|
| 430 |
+
{%- if '<|think_extreme|>' in content %}{%- set content = content.split('<|think_extreme|>') | join('') | trim %}{%- endif %}
|
| 431 |
+
{%- if '<|think_max|>' in content %}{%- set content = content.split('<|think_max|>') | join('') | trim %}{%- endif %}
|
| 432 |
+
{%- if '<|think_medium|>' in content %}{%- set content = content.split('<|think_medium|>') | join('') | trim %}{%- endif %}
|
| 433 |
+
{%- if '<|think_low|>' in content %}{%- set content = content.split('<|think_low|>') | join('') | trim %}{%- endif %}
|
| 434 |
+
{%- if '<|think_minimal|>' in content %}{%- set content = content.split('<|think_minimal|>') | join('') | trim %}{%- endif %}
|
| 435 |
+
{%- endif %}
|
| 436 |
+
{%- if is_system %}
|
| 437 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 438 |
+
{%- elif message.role == 'user' %}
|
| 439 |
+
{%- set ns2.consecutive_failures = 0 %}
|
| 440 |
+
{{- '<|im_start|>user\n' + content + '<|im_end|>\n' }}
|
| 441 |
+
{%- elif message.role == 'assistant' %}
|
| 442 |
+
{%- set reasoning_content = '' %}
|
| 443 |
+
{%- set _explicit_reasoning = '' %}
|
| 444 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 445 |
+
{%- if message.reasoning_content is string %}
|
| 446 |
+
{%- set _explicit_reasoning = message.reasoning_content %}
|
| 447 |
+
{%- else %}
|
| 448 |
+
{%- set _explicit_reasoning = message.reasoning_content | string %}
|
| 449 |
+
{%- endif %}
|
| 450 |
+
{%- elif message.thinking is defined and message.thinking is not none %}
|
| 451 |
+
{%- if message.thinking is string %}
|
| 452 |
+
{%- set _explicit_reasoning = message.thinking %}
|
| 453 |
+
{%- else %}
|
| 454 |
+
{%- set _explicit_reasoning = message.thinking | string %}
|
| 455 |
+
{%- endif %}
|
| 456 |
+
{%- elif message.reasoning is defined and message.reasoning is not none %}
|
| 457 |
+
{%- if message.reasoning is string %}
|
| 458 |
+
{%- set _explicit_reasoning = message.reasoning %}
|
| 459 |
+
{%- else %}
|
| 460 |
+
{%- set _explicit_reasoning = message.reasoning | string %}
|
| 461 |
+
{%- endif %}
|
| 462 |
+
{%- endif %}
|
| 463 |
+
{%- if _explicit_reasoning %}
|
| 464 |
+
{%- set _lead_end = '' %}
|
| 465 |
+
{%- if content.startswith('<think>') and '</think>' in content %}
|
| 466 |
+
{%- set _lead_end = '</think>' %}
|
| 467 |
+
{%- elif content.startswith('<thinking>') and '</thinking>' in content %}
|
| 468 |
+
{%- set _lead_end = '</thinking>' %}
|
| 469 |
+
{%- elif content.startswith('</think>') %}
|
| 470 |
+
{%- set _lead_end = '</think>' %}
|
| 471 |
+
{%- elif content.startswith('</thinking>') %}
|
| 472 |
+
{%- set _lead_end = '</thinking>' %}
|
| 473 |
+
{%- endif %}
|
| 474 |
+
{%- if _lead_end %}
|
| 475 |
+
{%- set content = content.split(_lead_end)[-1].lstrip('\n') %}
|
| 476 |
+
{%- endif %}
|
| 477 |
+
{%- set reasoning_content = _explicit_reasoning %}
|
| 478 |
+
{%- else %}
|
| 479 |
+
{%- set _think_end = '' %}
|
| 480 |
+
{%- if content.startswith('</think>') %}
|
| 481 |
+
{%- set _think_end = '</think>' %}
|
| 482 |
+
{%- elif content.startswith('</thinking>') %}
|
| 483 |
+
{%- set _think_end = '</thinking>' %}
|
| 484 |
+
{%- elif '\n</think>' in content %}
|
| 485 |
+
{%- set _think_end = '\n</think>' %}
|
| 486 |
+
{%- elif '\n</thinking>' in content %}
|
| 487 |
+
{%- set _think_end = '\n</thinking>' %}
|
| 488 |
+
{%- elif '\n</ think>' in content %}
|
| 489 |
+
{%- set _think_end = '\n</ think>' %}
|
| 490 |
+
{%- elif '\n</think >' in content %}
|
| 491 |
+
{%- set _think_end = '\n</think >' %}
|
| 492 |
+
{%- elif content.startswith('<think>') and '</think>' in content %}
|
| 493 |
+
{%- set _think_end = '</think>' %}
|
| 494 |
+
{%- elif content.startswith('<thinking>') and '</thinking>' in content %}
|
| 495 |
+
{%- set _think_end = '</thinking>' %}
|
| 496 |
+
{%- endif %}
|
| 497 |
+
{%- if _think_end %}
|
| 498 |
+
{%- if 'thinking' in _think_end %}
|
| 499 |
+
{%- set _think_start = '<thinking>' %}
|
| 500 |
+
{%- else %}
|
| 501 |
+
{%- set _think_start = '<think>' %}
|
| 502 |
+
{%- endif %}
|
| 503 |
+
{%- set reasoning_content = content.split(_think_end)[0].rstrip('\n') %}
|
| 504 |
+
{%- if _think_start in reasoning_content %}
|
| 505 |
+
{%- set reasoning_content = reasoning_content.split(_think_start)[-1].lstrip('\n') %}
|
| 506 |
+
{%- endif %}
|
| 507 |
+
{%- set content = content.split(_think_end)[-1].lstrip('\n') %}
|
| 508 |
+
{%- endif %}
|
| 509 |
+
{%- endif %}
|
| 510 |
+
{%- set reasoning_content = reasoning_content | trim %}
|
| 511 |
+
{%- if (_preserve_thinking or loop.index0 > ns.last_query_index) %}
|
| 512 |
+
{{- '<|im_start|>assistant\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 513 |
+
{%- else %}
|
| 514 |
+
{{- '<|im_start|>assistant\n' + content }}
|
| 515 |
+
{%- endif %}
|
| 516 |
+
{%- if message.tool_calls is defined and message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 517 |
+
{%- for tool_call in message.tool_calls %}
|
| 518 |
+
{%- if tool_call.function is defined and tool_call.function is not none %}
|
| 519 |
+
{%- set tc = tool_call.function %}
|
| 520 |
+
{%- else %}
|
| 521 |
+
{%- set tc = tool_call %}
|
| 522 |
+
{%- endif %}
|
| 523 |
+
{%- set tc_name = tc.name if (tc.name is defined and tc.name is not none) else '' %}
|
| 524 |
+
{%- if _tool_format == 'json' %}
|
| 525 |
+
{%- if loop.first %}
|
| 526 |
+
{%- if content | trim %}
|
| 527 |
+
{{- '\n\n' }}
|
| 528 |
+
{%- endif %}
|
| 529 |
+
{%- else %}
|
| 530 |
+
{{- '\n' }}
|
| 531 |
+
{%- endif %}
|
| 532 |
+
{%- set _args = '{}' %}
|
| 533 |
+
{%- if tc.arguments is defined and tc.arguments is not none %}
|
| 534 |
+
{%- if tc.arguments is mapping %}
|
| 535 |
+
{%- set _args = tc.arguments | tojson %}
|
| 536 |
+
{%- elif tc.arguments is string %}
|
| 537 |
+
{%- if tc.arguments %}
|
| 538 |
+
{%- set _args = tc.arguments %}
|
| 539 |
+
{%- endif %}
|
| 540 |
+
{%- else %}
|
| 541 |
+
{%- set _args = tc.arguments | tojson %}
|
| 542 |
+
{%- endif %}
|
| 543 |
+
{%- endif %}
|
| 544 |
+
{{- '<tool_call>\n{"name": ' }}{{- tc_name | tojson }}{{- ', "arguments": ' }}{{- _args }}{{- '}\n</tool_call>' }}
|
| 545 |
+
{%- else %}
|
| 546 |
+
{%- if loop.first %}
|
| 547 |
+
{%- if content | trim %}
|
| 548 |
+
{{- '\n\n<tool_call>\n<function=' + tc_name + '>\n' }}
|
| 549 |
+
{%- else %}
|
| 550 |
+
{{- '<tool_call>\n<function=' + tc_name + '>\n' }}
|
| 551 |
+
{%- endif %}
|
| 552 |
+
{%- else %}
|
| 553 |
+
{{- '\n<tool_call>\n<function=' + tc_name + '>\n' }}
|
| 554 |
+
{%- endif %}
|
| 555 |
+
{%- if tc.arguments is defined and tc.arguments is not none %}
|
| 556 |
+
{%- if tc.arguments is mapping %}
|
| 557 |
+
{%- for args_name, args_value in tc.arguments.items() %}
|
| 558 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 559 |
+
{%- if args_value is string %}
|
| 560 |
+
{%- set _av = args_value %}
|
| 561 |
+
{%- else %}
|
| 562 |
+
{%- set _av = args_value | tojson %}
|
| 563 |
+
{%- endif %}
|
| 564 |
+
{%- if max_tool_arg_chars > 0 and _av | length > max_tool_arg_chars %}
|
| 565 |
+
{{- _av[:max_tool_arg_chars] + '\n[TRUNCATED - original length ' ~ (_av | length | string) ~ ' chars]' }}
|
| 566 |
+
{%- else %}
|
| 567 |
+
{{- _av }}
|
| 568 |
+
{%- endif %}
|
| 569 |
+
{{- '\n</parameter>\n' }}
|
| 570 |
+
{%- endfor %}
|
| 571 |
+
{%- else %}
|
| 572 |
+
{%- if tc.arguments is string %}
|
| 573 |
+
{%- set _raw_args = tc.arguments %}
|
| 574 |
+
{%- else %}
|
| 575 |
+
{%- set _raw_args = tc.arguments | tojson %}
|
| 576 |
+
{%- endif %}
|
| 577 |
+
{%- if _raw_args %}
|
| 578 |
+
{%- if max_tool_arg_chars > 0 and _raw_args | length > max_tool_arg_chars %}
|
| 579 |
+
{{- _raw_args[:max_tool_arg_chars] + '\n[TRUNCATED - original length ' ~ (_raw_args | length | string) ~ ' chars]' }}
|
| 580 |
+
{%- else %}
|
| 581 |
+
{{- _raw_args }}
|
| 582 |
+
{%- endif %}
|
| 583 |
+
{%- endif %}
|
| 584 |
+
{%- endif %}
|
| 585 |
+
{%- endif %}
|
| 586 |
+
{{- '</function>\n</tool_call>' }}
|
| 587 |
+
{%- endif %}
|
| 588 |
+
{%- endfor %}
|
| 589 |
+
{%- endif %}
|
| 590 |
+
{{- '<|im_end|>\n' }}
|
| 591 |
+
{%- elif message.role == 'tool' %}
|
| 592 |
+
{%- set _content_lower = content | lower %}
|
| 593 |
+
{%- set _content_head = _content_lower[:120] %}
|
| 594 |
+
{%- set _is_code_or_grep = ('throw new ' in _content_lower or 'throw error' in _content_lower or 'console.error' in _content_lower or 'logger.error' in _content_lower or 'logging.error' in _content_lower or 'import ' in _content_head or 'def ' in _content_head or 'function ' in _content_head) %}
|
| 595 |
+
{%- set _exit_code_zero = ('exit code: 0' in _content_head or 'process exited with code 0' in _content_head) %}
|
| 596 |
+
{%- set _error_field_ok = ('"error": null' in _content_head or '"error":null' in _content_head or '"error": false' in _content_head or '"error":false' in _content_head or '"error": ""' in _content_head or '"error":""' in _content_head) %}
|
| 597 |
+
{%- set _strong_error = (('"error":' in _content_head and not _error_field_ok) or '"status": "error"' in _content_head or '"status":"error"' in _content_head or 'traceback (most recent call last):' in _content_head or 'command not found' in _content_head or 'invalid syntax' in _content_head or 'fatal:' in _content_head or (('exit code: ' in _content_head or 'process exited with code' in _content_head) and not _exit_code_zero) or _content_head.startswith('exception:') or _content_head.startswith('failed to ')) %}
|
| 598 |
+
{%- set _weak_error = ('error:' in _content_head or 'err!' in _content_head) %}
|
| 599 |
+
{%- set _weak_suppressed = ('$ ' in _content_head or 'took ' in _content_head or content | length >= 600) %}
|
| 600 |
+
{%- if not _is_code_or_grep and (_strong_error or (_weak_error and not _weak_suppressed)) %}
|
| 601 |
+
{%- set ns2.consecutive_failures = ns2.consecutive_failures + 1 %}
|
| 602 |
+
{%- else %}
|
| 603 |
+
{%- set ns2.consecutive_failures = 0 %}
|
| 604 |
+
{%- endif %}
|
| 605 |
+
{%- if ns2.prev_role != 'tool' %}
|
| 606 |
+
{{- '<|im_start|>user' }}
|
| 607 |
+
{%- endif %}
|
| 608 |
+
{%- set _is_json_payload = (_tool_format == 'json' and content | trim | length > 0 and (content | trim)[:1] in ('{', '[')) %}
|
| 609 |
+
{%- if not _is_json_payload and max_tool_response_chars > 0 and content | length > max_tool_response_chars %}
|
| 610 |
+
{%- set content = content[:max_tool_response_chars] + '\n[TRUNCATED - original length ' ~ (content | length | string) ~ ' chars]' %}
|
| 611 |
+
{%- endif %}
|
| 612 |
+
{{- '\n<tool_response>\n' + content }}
|
| 613 |
+
{%- if ns2.consecutive_failures >= 2 %}
|
| 614 |
+
{{- '\n\n⚠️ SYSTEM WARNING: ' ~ ns2.consecutive_failures ~ ' consecutive tool errors detected. Your previous approach is incorrect. You MUST use a fundamentally different approach or corrected arguments.' }}
|
| 615 |
+
{%- elif ns2.consecutive_failures == 1 %}
|
| 616 |
+
{{- '\n\n⚠️ SYSTEM WARNING: The previous tool call returned an error. Diagnose the failure and retry with completely corrected arguments.' }}
|
| 617 |
+
{%- endif %}
|
| 618 |
+
{{- '\n</tool_response>' }}
|
| 619 |
+
{%- if loop.last %}
|
| 620 |
+
{{- '<|im_end|>\n' }}
|
| 621 |
+
{%- else %}
|
| 622 |
+
{%- set _next_role = _msgs[loop.index0 + 1].role %}
|
| 623 |
+
{%- if _next_role != 'tool' %}
|
| 624 |
+
{{- '<|im_end|>\n' }}
|
| 625 |
+
{%- endif %}
|
| 626 |
+
{%- endif %}
|
| 627 |
+
{%- else %}
|
| 628 |
+
{{- '<|im_start|>user\n[' + message.role + ']: ' + content + '<|im_end|>\n' }}
|
| 629 |
+
{%- endif %}
|
| 630 |
+
{%- set ns2.prev_role = message.role %}
|
| 631 |
+
{%- endfor %}
|
| 632 |
+
{%- if add_generation_prompt %}
|
| 633 |
+
{{- '<|im_start|>assistant\n' }}
|
| 634 |
+
{%- if not ns_state.thinking %}
|
| 635 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 636 |
+
{%- else %}
|
| 637 |
+
{{- '<think>\n' }}
|
| 638 |
+
{%- endif %}
|
| 639 |
+
{%- endif %}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# Define the hardcoded thinking instructions - DAU=einstein, DAU2=spoon #}
|
| 2 |
+
{%- set system_instruction_DAU -%}
|
| 3 |
+
[SYSTEM]
|
| 4 |
+
[Temperature: 1.25]
|
| 5 |
+
[TopP: .2]
|
| 6 |
+
[PERSONA]Brainstormer takes in a notion, applies a bunch of perspective agents set to improve it by seeking novelty, and spits out a bunch of improved creative ideas.
|
| 7 |
+
|
| 8 |
+
SKILLS:
|
| 9 |
+
[Advert]-[DigMrk]-[SEO]-[SEM]-[PITCHES]-[CREATIVITY]-[BURSTINESS]-[PERPLEXITY]-[AVOIDHGHCORRELATE]-[HUMPRTXT]-[CONTENTGEN]
|
| 10 |
+
|
| 11 |
+
[Task]
|
| 12 |
+
gE: Silent input → Spawn 20 agents Sternberg Styles → Enhance idea → Seek Novel Emergence NE:unique/significant idea/concept → Ponder, assess, creative enhance notions → Refined idea => IdeaArray[].size=20 elements, else → Interesting? Pass to rand. agent for refinement, else discard.=>output(IdeaArray)[/Task]
|
| 13 |
+
|
| 14 |
+
[Task]Request input[/Task]
|
| 15 |
+
|
| 16 |
+
gE(input) > response
|
| 17 |
+
|
| 18 |
+
Think deeply and carefully about the user's request using "gE(input)" and ponder all the possiblities, evaluate them one by one. Draft your first response, then evaluate it and adjust if required.
|
| 19 |
+
Compose your thoughts (which should be at least 5000 tokens) about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
| 20 |
+
{%- endset -%}
|
| 21 |
+
{# Define the hardcoded thinking instructions -DAU2=spoon #}
|
| 22 |
+
{%- set system_instruction_DAU2 -%}
|
| 23 |
+
Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.
|
| 24 |
+
|
| 25 |
+
IMPORTANT INSTRUCTIONS:
|
| 26 |
+
You are Qwen Deep Research, a careful local 27B Qwen reasoning assistant optimized for high-quality, structured research answers.
|
| 27 |
+
Your goal is to produce accurate, well-reasoned, practical results by internally simulating a focused multi-expert research process. Do not claim to be a real human panel. Use “virtual experts” as reasoning perspectives.
|
| 28 |
+
|
| 29 |
+
For every user request, internally follow this Deep Research Protocol:
|
| 30 |
+
|
| 31 |
+
1. Frame the task
|
| 32 |
+
- Identify the user's core request, intended field, constraints, desired output format, and success criteria.
|
| 33 |
+
- Note ambiguities, missing context, risks, and possible misunderstandings.
|
| 34 |
+
- If one brief clarifying question would materially improve the result, ask it. Otherwise proceed with clearly stated assumptions.
|
| 35 |
+
- Rate the user's core request of complexity on a scale of 1 to 5, with 5 being highest AND EXPAND the reasoning and detail levels according to this scale.
|
| 36 |
+
|
| 37 |
+
2. Create a field-specific expert panel
|
| 38 |
+
- Build 3 to 5 virtual experts relevant to the user's domain.
|
| 39 |
+
- Adapt the roles to the task. Examples:
|
| 40 |
+
- Domain expert
|
| 41 |
+
- Research methodologist
|
| 42 |
+
- Engineer / developer
|
| 43 |
+
- Risk / compliance / ethics analyst
|
| 44 |
+
- Critic / red-team reviewer
|
| 45 |
+
- Communicator / final-answer synthesizer
|
| 46 |
+
- Each expert should focus on a different strength, not repeat the same point.
|
| 47 |
+
|
| 48 |
+
3. Panel discussion of the user's prompt
|
| 49 |
+
- Have the panel discuss what the user is really asking.
|
| 50 |
+
- Identify likely failure modes, edge cases, hidden assumptions, and required evidence.
|
| 51 |
+
- If experts disagree, resolve the disagreement by favoring correctness, usefulness, safety, clarity, and practicality.
|
| 52 |
+
|
| 53 |
+
4. Generate candidate solutions
|
| 54 |
+
- Produce 2 to 3 distinct candidate answers, plans, approaches, or solutions.
|
| 55 |
+
- For each candidate, include:
|
| 56 |
+
- Main idea
|
| 57 |
+
- Assumptions
|
| 58 |
+
- Key steps or components
|
| 59 |
+
- Strengths
|
| 60 |
+
- Weaknesses or risks
|
| 61 |
+
|
| 62 |
+
5. Evaluate the candidates
|
| 63 |
+
- Score each candidate 1 to 5 on:
|
| 64 |
+
- Correctness
|
| 65 |
+
- Completeness
|
| 66 |
+
- Practical usefulness
|
| 67 |
+
- Safety / compliance
|
| 68 |
+
- Clarity
|
| 69 |
+
- Efficiency
|
| 70 |
+
- Identify the best candidate and explain why it is superior.
|
| 71 |
+
|
| 72 |
+
6. Double-check the selected solution
|
| 73 |
+
- Re-verify important facts, logic, calculations, code, dates, units, dependencies, and edge cases.
|
| 74 |
+
- Check for hallucinated sources, invented numbers, unsupported claims, contradictions, and missing constraints.
|
| 75 |
+
- For code, mentally execute or trace the logic and note likely failure points.
|
| 76 |
+
- For medical, legal, financial, safety-critical, or high-stakes topics, add appropriate cautions and recommend qualified professional review.
|
| 77 |
+
|
| 78 |
+
7. Output the result
|
| 79 |
+
- Provide the final result in the format the user requested.
|
| 80 |
+
- If the user did not specify a format, use this structure:
|
| 81 |
+
|
| 82 |
+
Final Answer
|
| 83 |
+
Brief explanation
|
| 84 |
+
Key assumptions
|
| 85 |
+
Recommended next steps
|
| 86 |
+
Confidence level / verification needed
|
| 87 |
+
|
| 88 |
+
Operating rules:
|
| 89 |
+
- Minimum size of the thinking/reasoning/eval block is 5000 words.
|
| 90 |
+
- Be concrete, specific, and useful.
|
| 91 |
+
- Do not claim live internet access unless the host system actually provides it.
|
| 92 |
+
- Do not invent citations, sources, statistics, benchmarks, or facts.
|
| 93 |
+
- If uncertain, state the uncertainty clearly and explain what evidence would confirm or disprove the claim.
|
| 94 |
+
- Keep the internal expert panel compact and purposeful. Do not loop indefinitely.
|
| 95 |
+
- SHOW hidden chain-of-thought processes.
|
| 96 |
+
- For code, provide minimal working examples when possible and mention required environment or dependencies.
|
| 97 |
+
- For ambiguous prompts, state the interpretation you chose before answering.
|
| 98 |
+
- Optimize for reliability: prefer clear structure, bounded reasoning, and concise final output.
|
| 99 |
+
{%- endset -%}
|
| 100 |
+
{%- set image_count = namespace(value=0) %}
|
| 101 |
+
{%- set video_count = namespace(value=0) %}
|
| 102 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 103 |
+
{%- if content is string %}
|
| 104 |
+
{{- content }}
|
| 105 |
+
{%- elif content is iterable and content is not mapping %}
|
| 106 |
+
{%- for item in content %}
|
| 107 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 108 |
+
{%- if is_system_content %}
|
| 109 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 110 |
+
{%- endif %}
|
| 111 |
+
{%- if do_vision_count %}
|
| 112 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 113 |
+
{%- endif %}
|
| 114 |
+
{%- if add_vision_id %}
|
| 115 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 118 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 119 |
+
{%- if is_system_content %}
|
| 120 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{%- if do_vision_count %}
|
| 123 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 124 |
+
{%- endif %}
|
| 125 |
+
{%- if add_vision_id %}
|
| 126 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 129 |
+
{%- elif 'text' in item %}
|
| 130 |
+
{{- item.text }}
|
| 131 |
+
{%- else %}
|
| 132 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- endfor %}
|
| 135 |
+
{%- elif content is none or content is undefined %}
|
| 136 |
+
{{- '' }}
|
| 137 |
+
{%- else %}
|
| 138 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 139 |
+
{%- endif %}
|
| 140 |
+
{%- endmacro %}
|
| 141 |
+
{%- if not messages %}
|
| 142 |
+
{{- raise_exception('No messages provided.') }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{% set store = namespace(messages=[], reasoning_effort="", enable_thinking=true) %}
|
| 145 |
+
{% for msg in messages %}
|
| 146 |
+
{% set raw_reason = "" %}
|
| 147 |
+
{% set txt = render_content(msg.content, false, true) | trim %}
|
| 148 |
+
{% if "{REASON:" in txt %}
|
| 149 |
+
{% set after_tag = txt.split("{REASON:") %}
|
| 150 |
+
{% set raw_reason = after_tag[1].split("}")[0] %}
|
| 151 |
+
{% set tag = "{REASON:" ~ raw_reason ~ "}" %}
|
| 152 |
+
{% set clean_txt = txt.replace(tag, "") | trim %}
|
| 153 |
+
{% set store.messages = store.messages + [{"role": msg.role, "content": clean_txt}] %}
|
| 154 |
+
{% else %}
|
| 155 |
+
{% set store.messages = store.messages + [msg] %}
|
| 156 |
+
{% endif %}
|
| 157 |
+
{% if raw_reason %}
|
| 158 |
+
{% if raw_reason.startswith('i') %}
|
| 159 |
+
{% set store.reasoning_effort = raw_reason[1:] %}
|
| 160 |
+
{% set store.enable_thinking = false %}
|
| 161 |
+
{% else %}
|
| 162 |
+
{% set store.reasoning_effort = raw_reason %}
|
| 163 |
+
{% endif %}
|
| 164 |
+
{% endif %}
|
| 165 |
+
{% endfor %}
|
| 166 |
+
{% set messages = store.messages %}
|
| 167 |
+
{% if store.reasoning_effort %}
|
| 168 |
+
{% set reasoning_effort = store.reasoning_effort %}
|
| 169 |
+
{% set enable_thinking = store.enable_thinking %}
|
| 170 |
+
{% endif %}
|
| 171 |
+
{%- set reasoning_instructions = '' %}
|
| 172 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 173 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 174 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 175 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 178 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 179 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 180 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 181 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 182 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 183 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 184 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 185 |
+
{%- endif %}
|
| 186 |
+
{%- endif %}
|
| 187 |
+
{%- if enable_thinking is false %}
|
| 188 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('medium') %}
|
| 189 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low','einstein','spoon') %}
|
| 190 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low PLUS einstein and spoon.') }}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- if resolved_reasoning_effort == 'einstein' %}
|
| 193 |
+
{%- set reasoning_instructions = system_instruction_DAU %}
|
| 194 |
+
{%- elif resolved_reasoning_effort == 'spoon' %}
|
| 195 |
+
{%- set reasoning_instructions = system_instruction_DAU2 %}
|
| 196 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 197 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 198 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 199 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- endif %}
|
| 202 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 203 |
+
{{- '<|im_start|>system\n' }}
|
| 204 |
+
{%- if reasoning_instructions %}
|
| 205 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 206 |
+
{%- endif %}
|
| 207 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 208 |
+
{%- for tool in tools %}
|
| 209 |
+
{{- "\n" }}
|
| 210 |
+
{{- tool | tojson }}
|
| 211 |
+
{%- endfor %}
|
| 212 |
+
{{- "\n</tools>" }}
|
| 213 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 214 |
+
{%- if messages[0].role == 'system' %}
|
| 215 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 216 |
+
{%- if content %}
|
| 217 |
+
{{- '\n\n' + content }}
|
| 218 |
+
{%- endif %}
|
| 219 |
+
{%- endif %}
|
| 220 |
+
{{- '<|im_end|>\n' }}
|
| 221 |
+
{%- else %}
|
| 222 |
+
{%- if messages[0].role == 'system' %}
|
| 223 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 224 |
+
{%- if content %}
|
| 225 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 226 |
+
{%- elif reasoning_instructions %}
|
| 227 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 228 |
+
{%- endif %}
|
| 229 |
+
{%- elif reasoning_instructions %}
|
| 230 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 231 |
+
{%- endif %}
|
| 232 |
+
{%- endif %}
|
| 233 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 234 |
+
{%- for message in messages[::-1] %}
|
| 235 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 236 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 237 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 238 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 239 |
+
{%- set ns.multi_step_tool = false %}
|
| 240 |
+
{%- set ns.last_query_index = index %}
|
| 241 |
+
{%- endif %}
|
| 242 |
+
{%- endif %}
|
| 243 |
+
{%- endfor %}
|
| 244 |
+
{%- if ns.multi_step_tool %}
|
| 245 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 246 |
+
{%- endif %}
|
| 247 |
+
{%- for message in messages %}
|
| 248 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 249 |
+
{%- if message.role == "system" %}
|
| 250 |
+
{%- if not loop.first %}
|
| 251 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 252 |
+
{%- endif %}
|
| 253 |
+
{%- elif message.role == "user" %}
|
| 254 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 255 |
+
{%- elif message.role == "assistant" %}
|
| 256 |
+
{%- set reasoning_content = '' %}
|
| 257 |
+
{%- if message.reasoning_content is string %}
|
| 258 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 259 |
+
{%- endif %}
|
| 260 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 261 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 262 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 263 |
+
{%- else %}
|
| 264 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 265 |
+
{%- endif %}
|
| 266 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 267 |
+
{%- for tool_call in message.tool_calls %}
|
| 268 |
+
{%- if tool_call.function is defined %}
|
| 269 |
+
{%- set tool_call = tool_call.function %}
|
| 270 |
+
{%- endif %}
|
| 271 |
+
{%- if loop.first %}
|
| 272 |
+
{%- if content|trim %}
|
| 273 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 274 |
+
{%- else %}
|
| 275 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 276 |
+
{%- endif %}
|
| 277 |
+
{%- else %}
|
| 278 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 279 |
+
{%- endif %}
|
| 280 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 281 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 282 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 283 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 284 |
+
{{- args_value }}
|
| 285 |
+
{{- '\n</parameter>\n' }}
|
| 286 |
+
{%- endfor %}
|
| 287 |
+
{%- endif %}
|
| 288 |
+
{{- '</function>\n</tool_call>' }}
|
| 289 |
+
{%- endfor %}
|
| 290 |
+
{%- endif %}
|
| 291 |
+
{{- '<|im_end|>\n' }}
|
| 292 |
+
{%- elif message.role == "tool" %}
|
| 293 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 294 |
+
{{- '<|im_start|>user' }}
|
| 295 |
+
{%- endif %}
|
| 296 |
+
{{- '\n<tool_response>\n' }}
|
| 297 |
+
{{- content }}
|
| 298 |
+
{{- '\n</tool_response>' }}
|
| 299 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 300 |
+
{{- '<|im_end|>\n' }}
|
| 301 |
+
{%- elif loop.last %}
|
| 302 |
+
{{- '<|im_end|>\n' }}
|
| 303 |
+
{%- endif %}
|
| 304 |
+
{%- else %}
|
| 305 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 306 |
+
{%- endif %}
|
| 307 |
+
{%- endfor %}
|
| 308 |
+
{%- if add_generation_prompt %}
|
| 309 |
+
{{- '<|im_start|>assistant\n' }}
|
| 310 |
+
{%- if enable_thinking is defined and enable_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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"bos_token_id": null,
|
| 6 |
+
"dtype": "bfloat16",
|
| 7 |
+
"eos_token_id": 248046,
|
| 8 |
+
"image_token_id": 248056,
|
| 9 |
+
"language_model_only": false,
|
| 10 |
+
"model_name": "DavidAU/Qwen3.8-27B-TWIN-TURBO-Fable-Cold-Fusion-709-L-Uncensored",
|
| 11 |
+
"model_type": "qwen3_5",
|
| 12 |
+
"pad_token_id": 248044,
|
| 13 |
+
"quantization_config": {
|
| 14 |
+
"config_groups": {
|
| 15 |
+
"group_0": {
|
| 16 |
+
"format": "float-quantized",
|
| 17 |
+
"input_activations": {
|
| 18 |
+
"actorder": null,
|
| 19 |
+
"block_structure": null,
|
| 20 |
+
"dynamic": true,
|
| 21 |
+
"group_size": 128,
|
| 22 |
+
"num_bits": 8,
|
| 23 |
+
"observer": null,
|
| 24 |
+
"observer_kwargs": {},
|
| 25 |
+
"scale_dtype": null,
|
| 26 |
+
"strategy": "group",
|
| 27 |
+
"symmetric": true,
|
| 28 |
+
"type": "float",
|
| 29 |
+
"zp_dtype": null
|
| 30 |
+
},
|
| 31 |
+
"output_activations": null,
|
| 32 |
+
"targets": [
|
| 33 |
+
"Linear"
|
| 34 |
+
],
|
| 35 |
+
"weights": {
|
| 36 |
+
"actorder": null,
|
| 37 |
+
"block_structure": [
|
| 38 |
+
128,
|
| 39 |
+
128
|
| 40 |
+
],
|
| 41 |
+
"dynamic": false,
|
| 42 |
+
"group_size": null,
|
| 43 |
+
"num_bits": 8,
|
| 44 |
+
"observer": "memoryless_minmax",
|
| 45 |
+
"observer_kwargs": {},
|
| 46 |
+
"scale_dtype": null,
|
| 47 |
+
"strategy": "block",
|
| 48 |
+
"symmetric": true,
|
| 49 |
+
"type": "float",
|
| 50 |
+
"zp_dtype": null
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"format": "float-quantized",
|
| 55 |
+
"global_compression_ratio": null,
|
| 56 |
+
"ignore": [
|
| 57 |
+
"model.visual.blocks.0.attn.qkv",
|
| 58 |
+
"model.visual.blocks.0.attn.proj",
|
| 59 |
+
"model.visual.blocks.0.mlp.linear_fc1",
|
| 60 |
+
"model.visual.blocks.0.mlp.linear_fc2",
|
| 61 |
+
"model.visual.blocks.1.attn.qkv",
|
| 62 |
+
"model.visual.blocks.1.attn.proj",
|
| 63 |
+
"model.visual.blocks.1.mlp.linear_fc1",
|
| 64 |
+
"model.visual.blocks.1.mlp.linear_fc2",
|
| 65 |
+
"model.visual.blocks.2.attn.qkv",
|
| 66 |
+
"model.visual.blocks.2.attn.proj",
|
| 67 |
+
"model.visual.blocks.2.mlp.linear_fc1",
|
| 68 |
+
"model.visual.blocks.2.mlp.linear_fc2",
|
| 69 |
+
"model.visual.blocks.3.attn.qkv",
|
| 70 |
+
"model.visual.blocks.3.attn.proj",
|
| 71 |
+
"model.visual.blocks.3.mlp.linear_fc1",
|
| 72 |
+
"model.visual.blocks.3.mlp.linear_fc2",
|
| 73 |
+
"model.visual.blocks.4.attn.qkv",
|
| 74 |
+
"model.visual.blocks.4.attn.proj",
|
| 75 |
+
"model.visual.blocks.4.mlp.linear_fc1",
|
| 76 |
+
"model.visual.blocks.4.mlp.linear_fc2",
|
| 77 |
+
"model.visual.blocks.5.attn.qkv",
|
| 78 |
+
"model.visual.blocks.5.attn.proj",
|
| 79 |
+
"model.visual.blocks.5.mlp.linear_fc1",
|
| 80 |
+
"model.visual.blocks.5.mlp.linear_fc2",
|
| 81 |
+
"model.visual.blocks.6.attn.qkv",
|
| 82 |
+
"model.visual.blocks.6.attn.proj",
|
| 83 |
+
"model.visual.blocks.6.mlp.linear_fc1",
|
| 84 |
+
"model.visual.blocks.6.mlp.linear_fc2",
|
| 85 |
+
"model.visual.blocks.7.attn.qkv",
|
| 86 |
+
"model.visual.blocks.7.attn.proj",
|
| 87 |
+
"model.visual.blocks.7.mlp.linear_fc1",
|
| 88 |
+
"model.visual.blocks.7.mlp.linear_fc2",
|
| 89 |
+
"model.visual.blocks.8.attn.qkv",
|
| 90 |
+
"model.visual.blocks.8.attn.proj",
|
| 91 |
+
"model.visual.blocks.8.mlp.linear_fc1",
|
| 92 |
+
"model.visual.blocks.8.mlp.linear_fc2",
|
| 93 |
+
"model.visual.blocks.9.attn.qkv",
|
| 94 |
+
"model.visual.blocks.9.attn.proj",
|
| 95 |
+
"model.visual.blocks.9.mlp.linear_fc1",
|
| 96 |
+
"model.visual.blocks.9.mlp.linear_fc2",
|
| 97 |
+
"model.visual.blocks.10.attn.qkv",
|
| 98 |
+
"model.visual.blocks.10.attn.proj",
|
| 99 |
+
"model.visual.blocks.10.mlp.linear_fc1",
|
| 100 |
+
"model.visual.blocks.10.mlp.linear_fc2",
|
| 101 |
+
"model.visual.blocks.11.attn.qkv",
|
| 102 |
+
"model.visual.blocks.11.attn.proj",
|
| 103 |
+
"model.visual.blocks.11.mlp.linear_fc1",
|
| 104 |
+
"model.visual.blocks.11.mlp.linear_fc2",
|
| 105 |
+
"model.visual.blocks.12.attn.qkv",
|
| 106 |
+
"model.visual.blocks.12.attn.proj",
|
| 107 |
+
"model.visual.blocks.12.mlp.linear_fc1",
|
| 108 |
+
"model.visual.blocks.12.mlp.linear_fc2",
|
| 109 |
+
"model.visual.blocks.13.attn.qkv",
|
| 110 |
+
"model.visual.blocks.13.attn.proj",
|
| 111 |
+
"model.visual.blocks.13.mlp.linear_fc1",
|
| 112 |
+
"model.visual.blocks.13.mlp.linear_fc2",
|
| 113 |
+
"model.visual.blocks.14.attn.qkv",
|
| 114 |
+
"model.visual.blocks.14.attn.proj",
|
| 115 |
+
"model.visual.blocks.14.mlp.linear_fc1",
|
| 116 |
+
"model.visual.blocks.14.mlp.linear_fc2",
|
| 117 |
+
"model.visual.blocks.15.attn.qkv",
|
| 118 |
+
"model.visual.blocks.15.attn.proj",
|
| 119 |
+
"model.visual.blocks.15.mlp.linear_fc1",
|
| 120 |
+
"model.visual.blocks.15.mlp.linear_fc2",
|
| 121 |
+
"model.visual.blocks.16.attn.qkv",
|
| 122 |
+
"model.visual.blocks.16.attn.proj",
|
| 123 |
+
"model.visual.blocks.16.mlp.linear_fc1",
|
| 124 |
+
"model.visual.blocks.16.mlp.linear_fc2",
|
| 125 |
+
"model.visual.blocks.17.attn.qkv",
|
| 126 |
+
"model.visual.blocks.17.attn.proj",
|
| 127 |
+
"model.visual.blocks.17.mlp.linear_fc1",
|
| 128 |
+
"model.visual.blocks.17.mlp.linear_fc2",
|
| 129 |
+
"model.visual.blocks.18.attn.qkv",
|
| 130 |
+
"model.visual.blocks.18.attn.proj",
|
| 131 |
+
"model.visual.blocks.18.mlp.linear_fc1",
|
| 132 |
+
"model.visual.blocks.18.mlp.linear_fc2",
|
| 133 |
+
"model.visual.blocks.19.attn.qkv",
|
| 134 |
+
"model.visual.blocks.19.attn.proj",
|
| 135 |
+
"model.visual.blocks.19.mlp.linear_fc1",
|
| 136 |
+
"model.visual.blocks.19.mlp.linear_fc2",
|
| 137 |
+
"model.visual.blocks.20.attn.qkv",
|
| 138 |
+
"model.visual.blocks.20.attn.proj",
|
| 139 |
+
"model.visual.blocks.20.mlp.linear_fc1",
|
| 140 |
+
"model.visual.blocks.20.mlp.linear_fc2",
|
| 141 |
+
"model.visual.blocks.21.attn.qkv",
|
| 142 |
+
"model.visual.blocks.21.attn.proj",
|
| 143 |
+
"model.visual.blocks.21.mlp.linear_fc1",
|
| 144 |
+
"model.visual.blocks.21.mlp.linear_fc2",
|
| 145 |
+
"model.visual.blocks.22.attn.qkv",
|
| 146 |
+
"model.visual.blocks.22.attn.proj",
|
| 147 |
+
"model.visual.blocks.22.mlp.linear_fc1",
|
| 148 |
+
"model.visual.blocks.22.mlp.linear_fc2",
|
| 149 |
+
"model.visual.blocks.23.attn.qkv",
|
| 150 |
+
"model.visual.blocks.23.attn.proj",
|
| 151 |
+
"model.visual.blocks.23.mlp.linear_fc1",
|
| 152 |
+
"model.visual.blocks.23.mlp.linear_fc2",
|
| 153 |
+
"model.visual.blocks.24.attn.qkv",
|
| 154 |
+
"model.visual.blocks.24.attn.proj",
|
| 155 |
+
"model.visual.blocks.24.mlp.linear_fc1",
|
| 156 |
+
"model.visual.blocks.24.mlp.linear_fc2",
|
| 157 |
+
"model.visual.blocks.25.attn.qkv",
|
| 158 |
+
"model.visual.blocks.25.attn.proj",
|
| 159 |
+
"model.visual.blocks.25.mlp.linear_fc1",
|
| 160 |
+
"model.visual.blocks.25.mlp.linear_fc2",
|
| 161 |
+
"model.visual.blocks.26.attn.qkv",
|
| 162 |
+
"model.visual.blocks.26.attn.proj",
|
| 163 |
+
"model.visual.blocks.26.mlp.linear_fc1",
|
| 164 |
+
"model.visual.blocks.26.mlp.linear_fc2",
|
| 165 |
+
"model.visual.merger.linear_fc1",
|
| 166 |
+
"model.visual.merger.linear_fc2",
|
| 167 |
+
"model.language_model.layers.0.linear_attn",
|
| 168 |
+
"model.language_model.layers.0.linear_attn.norm",
|
| 169 |
+
"model.language_model.layers.0.linear_attn.in_proj_b",
|
| 170 |
+
"model.language_model.layers.0.linear_attn.in_proj_a",
|
| 171 |
+
"model.language_model.layers.1.linear_attn",
|
| 172 |
+
"model.language_model.layers.1.linear_attn.norm",
|
| 173 |
+
"model.language_model.layers.1.linear_attn.in_proj_b",
|
| 174 |
+
"model.language_model.layers.1.linear_attn.in_proj_a",
|
| 175 |
+
"model.language_model.layers.2.linear_attn",
|
| 176 |
+
"model.language_model.layers.2.linear_attn.norm",
|
| 177 |
+
"model.language_model.layers.2.linear_attn.in_proj_b",
|
| 178 |
+
"model.language_model.layers.2.linear_attn.in_proj_a",
|
| 179 |
+
"model.language_model.layers.4.linear_attn",
|
| 180 |
+
"model.language_model.layers.4.linear_attn.norm",
|
| 181 |
+
"model.language_model.layers.4.linear_attn.in_proj_b",
|
| 182 |
+
"model.language_model.layers.4.linear_attn.in_proj_a",
|
| 183 |
+
"model.language_model.layers.5.linear_attn",
|
| 184 |
+
"model.language_model.layers.5.linear_attn.norm",
|
| 185 |
+
"model.language_model.layers.5.linear_attn.in_proj_b",
|
| 186 |
+
"model.language_model.layers.5.linear_attn.in_proj_a",
|
| 187 |
+
"model.language_model.layers.6.linear_attn",
|
| 188 |
+
"model.language_model.layers.6.linear_attn.norm",
|
| 189 |
+
"model.language_model.layers.6.linear_attn.in_proj_b",
|
| 190 |
+
"model.language_model.layers.6.linear_attn.in_proj_a",
|
| 191 |
+
"model.language_model.layers.8.linear_attn",
|
| 192 |
+
"model.language_model.layers.8.linear_attn.norm",
|
| 193 |
+
"model.language_model.layers.8.linear_attn.in_proj_b",
|
| 194 |
+
"model.language_model.layers.8.linear_attn.in_proj_a",
|
| 195 |
+
"model.language_model.layers.9.linear_attn",
|
| 196 |
+
"model.language_model.layers.9.linear_attn.norm",
|
| 197 |
+
"model.language_model.layers.9.linear_attn.in_proj_b",
|
| 198 |
+
"model.language_model.layers.9.linear_attn.in_proj_a",
|
| 199 |
+
"model.language_model.layers.10.linear_attn",
|
| 200 |
+
"model.language_model.layers.10.linear_attn.norm",
|
| 201 |
+
"model.language_model.layers.10.linear_attn.in_proj_b",
|
| 202 |
+
"model.language_model.layers.10.linear_attn.in_proj_a",
|
| 203 |
+
"model.language_model.layers.12.linear_attn",
|
| 204 |
+
"model.language_model.layers.12.linear_attn.norm",
|
| 205 |
+
"model.language_model.layers.12.linear_attn.in_proj_b",
|
| 206 |
+
"model.language_model.layers.12.linear_attn.in_proj_a",
|
| 207 |
+
"model.language_model.layers.13.linear_attn",
|
| 208 |
+
"model.language_model.layers.13.linear_attn.norm",
|
| 209 |
+
"model.language_model.layers.13.linear_attn.in_proj_b",
|
| 210 |
+
"model.language_model.layers.13.linear_attn.in_proj_a",
|
| 211 |
+
"model.language_model.layers.14.linear_attn",
|
| 212 |
+
"model.language_model.layers.14.linear_attn.norm",
|
| 213 |
+
"model.language_model.layers.14.linear_attn.in_proj_b",
|
| 214 |
+
"model.language_model.layers.14.linear_attn.in_proj_a",
|
| 215 |
+
"model.language_model.layers.16.linear_attn",
|
| 216 |
+
"model.language_model.layers.16.linear_attn.norm",
|
| 217 |
+
"model.language_model.layers.16.linear_attn.in_proj_b",
|
| 218 |
+
"model.language_model.layers.16.linear_attn.in_proj_a",
|
| 219 |
+
"model.language_model.layers.17.linear_attn",
|
| 220 |
+
"model.language_model.layers.17.linear_attn.norm",
|
| 221 |
+
"model.language_model.layers.17.linear_attn.in_proj_b",
|
| 222 |
+
"model.language_model.layers.17.linear_attn.in_proj_a",
|
| 223 |
+
"model.language_model.layers.18.linear_attn",
|
| 224 |
+
"model.language_model.layers.18.linear_attn.norm",
|
| 225 |
+
"model.language_model.layers.18.linear_attn.in_proj_b",
|
| 226 |
+
"model.language_model.layers.18.linear_attn.in_proj_a",
|
| 227 |
+
"model.language_model.layers.20.linear_attn",
|
| 228 |
+
"model.language_model.layers.20.linear_attn.norm",
|
| 229 |
+
"model.language_model.layers.20.linear_attn.in_proj_b",
|
| 230 |
+
"model.language_model.layers.20.linear_attn.in_proj_a",
|
| 231 |
+
"model.language_model.layers.21.linear_attn",
|
| 232 |
+
"model.language_model.layers.21.linear_attn.norm",
|
| 233 |
+
"model.language_model.layers.21.linear_attn.in_proj_b",
|
| 234 |
+
"model.language_model.layers.21.linear_attn.in_proj_a",
|
| 235 |
+
"model.language_model.layers.22.linear_attn",
|
| 236 |
+
"model.language_model.layers.22.linear_attn.norm",
|
| 237 |
+
"model.language_model.layers.22.linear_attn.in_proj_b",
|
| 238 |
+
"model.language_model.layers.22.linear_attn.in_proj_a",
|
| 239 |
+
"model.language_model.layers.24.linear_attn",
|
| 240 |
+
"model.language_model.layers.24.linear_attn.norm",
|
| 241 |
+
"model.language_model.layers.24.linear_attn.in_proj_b",
|
| 242 |
+
"model.language_model.layers.24.linear_attn.in_proj_a",
|
| 243 |
+
"model.language_model.layers.25.linear_attn",
|
| 244 |
+
"model.language_model.layers.25.linear_attn.norm",
|
| 245 |
+
"model.language_model.layers.25.linear_attn.in_proj_b",
|
| 246 |
+
"model.language_model.layers.25.linear_attn.in_proj_a",
|
| 247 |
+
"model.language_model.layers.26.linear_attn",
|
| 248 |
+
"model.language_model.layers.26.linear_attn.norm",
|
| 249 |
+
"model.language_model.layers.26.linear_attn.in_proj_b",
|
| 250 |
+
"model.language_model.layers.26.linear_attn.in_proj_a",
|
| 251 |
+
"model.language_model.layers.28.linear_attn",
|
| 252 |
+
"model.language_model.layers.28.linear_attn.norm",
|
| 253 |
+
"model.language_model.layers.28.linear_attn.in_proj_b",
|
| 254 |
+
"model.language_model.layers.28.linear_attn.in_proj_a",
|
| 255 |
+
"model.language_model.layers.29.linear_attn",
|
| 256 |
+
"model.language_model.layers.29.linear_attn.norm",
|
| 257 |
+
"model.language_model.layers.29.linear_attn.in_proj_b",
|
| 258 |
+
"model.language_model.layers.29.linear_attn.in_proj_a",
|
| 259 |
+
"model.language_model.layers.30.linear_attn",
|
| 260 |
+
"model.language_model.layers.30.linear_attn.norm",
|
| 261 |
+
"model.language_model.layers.30.linear_attn.in_proj_b",
|
| 262 |
+
"model.language_model.layers.30.linear_attn.in_proj_a",
|
| 263 |
+
"model.language_model.layers.32.linear_attn",
|
| 264 |
+
"model.language_model.layers.32.linear_attn.norm",
|
| 265 |
+
"model.language_model.layers.32.linear_attn.in_proj_b",
|
| 266 |
+
"model.language_model.layers.32.linear_attn.in_proj_a",
|
| 267 |
+
"model.language_model.layers.33.linear_attn",
|
| 268 |
+
"model.language_model.layers.33.linear_attn.norm",
|
| 269 |
+
"model.language_model.layers.33.linear_attn.in_proj_b",
|
| 270 |
+
"model.language_model.layers.33.linear_attn.in_proj_a",
|
| 271 |
+
"model.language_model.layers.34.linear_attn",
|
| 272 |
+
"model.language_model.layers.34.linear_attn.norm",
|
| 273 |
+
"model.language_model.layers.34.linear_attn.in_proj_b",
|
| 274 |
+
"model.language_model.layers.34.linear_attn.in_proj_a",
|
| 275 |
+
"model.language_model.layers.36.linear_attn",
|
| 276 |
+
"model.language_model.layers.36.linear_attn.norm",
|
| 277 |
+
"model.language_model.layers.36.linear_attn.in_proj_b",
|
| 278 |
+
"model.language_model.layers.36.linear_attn.in_proj_a",
|
| 279 |
+
"model.language_model.layers.37.linear_attn",
|
| 280 |
+
"model.language_model.layers.37.linear_attn.norm",
|
| 281 |
+
"model.language_model.layers.37.linear_attn.in_proj_b",
|
| 282 |
+
"model.language_model.layers.37.linear_attn.in_proj_a",
|
| 283 |
+
"model.language_model.layers.38.linear_attn",
|
| 284 |
+
"model.language_model.layers.38.linear_attn.norm",
|
| 285 |
+
"model.language_model.layers.38.linear_attn.in_proj_b",
|
| 286 |
+
"model.language_model.layers.38.linear_attn.in_proj_a",
|
| 287 |
+
"model.language_model.layers.40.linear_attn",
|
| 288 |
+
"model.language_model.layers.40.linear_attn.norm",
|
| 289 |
+
"model.language_model.layers.40.linear_attn.in_proj_b",
|
| 290 |
+
"model.language_model.layers.40.linear_attn.in_proj_a",
|
| 291 |
+
"model.language_model.layers.41.linear_attn",
|
| 292 |
+
"model.language_model.layers.41.linear_attn.norm",
|
| 293 |
+
"model.language_model.layers.41.linear_attn.in_proj_b",
|
| 294 |
+
"model.language_model.layers.41.linear_attn.in_proj_a",
|
| 295 |
+
"model.language_model.layers.42.linear_attn",
|
| 296 |
+
"model.language_model.layers.42.linear_attn.norm",
|
| 297 |
+
"model.language_model.layers.42.linear_attn.in_proj_b",
|
| 298 |
+
"model.language_model.layers.42.linear_attn.in_proj_a",
|
| 299 |
+
"model.language_model.layers.44.linear_attn",
|
| 300 |
+
"model.language_model.layers.44.linear_attn.norm",
|
| 301 |
+
"model.language_model.layers.44.linear_attn.in_proj_b",
|
| 302 |
+
"model.language_model.layers.44.linear_attn.in_proj_a",
|
| 303 |
+
"model.language_model.layers.45.linear_attn",
|
| 304 |
+
"model.language_model.layers.45.linear_attn.norm",
|
| 305 |
+
"model.language_model.layers.45.linear_attn.in_proj_b",
|
| 306 |
+
"model.language_model.layers.45.linear_attn.in_proj_a",
|
| 307 |
+
"model.language_model.layers.46.linear_attn",
|
| 308 |
+
"model.language_model.layers.46.linear_attn.norm",
|
| 309 |
+
"model.language_model.layers.46.linear_attn.in_proj_b",
|
| 310 |
+
"model.language_model.layers.46.linear_attn.in_proj_a",
|
| 311 |
+
"model.language_model.layers.48.linear_attn",
|
| 312 |
+
"model.language_model.layers.48.linear_attn.norm",
|
| 313 |
+
"model.language_model.layers.48.linear_attn.in_proj_b",
|
| 314 |
+
"model.language_model.layers.48.linear_attn.in_proj_a",
|
| 315 |
+
"model.language_model.layers.49.linear_attn",
|
| 316 |
+
"model.language_model.layers.49.linear_attn.norm",
|
| 317 |
+
"model.language_model.layers.49.linear_attn.in_proj_b",
|
| 318 |
+
"model.language_model.layers.49.linear_attn.in_proj_a",
|
| 319 |
+
"model.language_model.layers.50.linear_attn",
|
| 320 |
+
"model.language_model.layers.50.linear_attn.norm",
|
| 321 |
+
"model.language_model.layers.50.linear_attn.in_proj_b",
|
| 322 |
+
"model.language_model.layers.50.linear_attn.in_proj_a",
|
| 323 |
+
"model.language_model.layers.52.linear_attn",
|
| 324 |
+
"model.language_model.layers.52.linear_attn.norm",
|
| 325 |
+
"model.language_model.layers.52.linear_attn.in_proj_b",
|
| 326 |
+
"model.language_model.layers.52.linear_attn.in_proj_a",
|
| 327 |
+
"model.language_model.layers.53.linear_attn",
|
| 328 |
+
"model.language_model.layers.53.linear_attn.norm",
|
| 329 |
+
"model.language_model.layers.53.linear_attn.in_proj_b",
|
| 330 |
+
"model.language_model.layers.53.linear_attn.in_proj_a",
|
| 331 |
+
"model.language_model.layers.54.linear_attn",
|
| 332 |
+
"model.language_model.layers.54.linear_attn.norm",
|
| 333 |
+
"model.language_model.layers.54.linear_attn.in_proj_b",
|
| 334 |
+
"model.language_model.layers.54.linear_attn.in_proj_a",
|
| 335 |
+
"model.language_model.layers.56.linear_attn",
|
| 336 |
+
"model.language_model.layers.56.linear_attn.norm",
|
| 337 |
+
"model.language_model.layers.56.linear_attn.in_proj_b",
|
| 338 |
+
"model.language_model.layers.56.linear_attn.in_proj_a",
|
| 339 |
+
"model.language_model.layers.57.linear_attn",
|
| 340 |
+
"model.language_model.layers.57.linear_attn.norm",
|
| 341 |
+
"model.language_model.layers.57.linear_attn.in_proj_b",
|
| 342 |
+
"model.language_model.layers.57.linear_attn.in_proj_a",
|
| 343 |
+
"model.language_model.layers.58.linear_attn",
|
| 344 |
+
"model.language_model.layers.58.linear_attn.norm",
|
| 345 |
+
"model.language_model.layers.58.linear_attn.in_proj_b",
|
| 346 |
+
"model.language_model.layers.58.linear_attn.in_proj_a",
|
| 347 |
+
"model.language_model.layers.60.linear_attn",
|
| 348 |
+
"model.language_model.layers.60.linear_attn.norm",
|
| 349 |
+
"model.language_model.layers.60.linear_attn.in_proj_b",
|
| 350 |
+
"model.language_model.layers.60.linear_attn.in_proj_a",
|
| 351 |
+
"model.language_model.layers.61.linear_attn",
|
| 352 |
+
"model.language_model.layers.61.linear_attn.norm",
|
| 353 |
+
"model.language_model.layers.61.linear_attn.in_proj_b",
|
| 354 |
+
"model.language_model.layers.61.linear_attn.in_proj_a",
|
| 355 |
+
"model.language_model.layers.62.linear_attn",
|
| 356 |
+
"model.language_model.layers.62.linear_attn.norm",
|
| 357 |
+
"model.language_model.layers.62.linear_attn.in_proj_b",
|
| 358 |
+
"model.language_model.layers.62.linear_attn.in_proj_a",
|
| 359 |
+
"lm_head",
|
| 360 |
+
"re:^mtp.*"
|
| 361 |
+
],
|
| 362 |
+
"kv_cache_scheme": {
|
| 363 |
+
"actorder": null,
|
| 364 |
+
"block_structure": null,
|
| 365 |
+
"dynamic": false,
|
| 366 |
+
"group_size": null,
|
| 367 |
+
"num_bits": 8,
|
| 368 |
+
"observer": "memoryless_minmax",
|
| 369 |
+
"observer_kwargs": {},
|
| 370 |
+
"scale_dtype": null,
|
| 371 |
+
"strategy": "tensor",
|
| 372 |
+
"symmetric": true,
|
| 373 |
+
"type": "float",
|
| 374 |
+
"zp_dtype": null
|
| 375 |
+
},
|
| 376 |
+
"quant_method": "compressed-tensors",
|
| 377 |
+
"quantization_status": "compressed",
|
| 378 |
+
"sparsity_config": {},
|
| 379 |
+
"transform_config": {},
|
| 380 |
+
"version": "0.18.0"
|
| 381 |
+
},
|
| 382 |
+
"text_config": {
|
| 383 |
+
"attention_bias": false,
|
| 384 |
+
"attention_dropout": 0.0,
|
| 385 |
+
"attn_output_gate": true,
|
| 386 |
+
"bos_token_id": 248044,
|
| 387 |
+
"dtype": "bfloat16",
|
| 388 |
+
"eos_token_id": 248044,
|
| 389 |
+
"full_attention_interval": 4,
|
| 390 |
+
"head_dim": 256,
|
| 391 |
+
"hidden_act": "silu",
|
| 392 |
+
"hidden_size": 5120,
|
| 393 |
+
"initializer_range": 0.02,
|
| 394 |
+
"intermediate_size": 17408,
|
| 395 |
+
"layer_types": [
|
| 396 |
+
"linear_attention",
|
| 397 |
+
"linear_attention",
|
| 398 |
+
"linear_attention",
|
| 399 |
+
"full_attention",
|
| 400 |
+
"linear_attention",
|
| 401 |
+
"linear_attention",
|
| 402 |
+
"linear_attention",
|
| 403 |
+
"full_attention",
|
| 404 |
+
"linear_attention",
|
| 405 |
+
"linear_attention",
|
| 406 |
+
"linear_attention",
|
| 407 |
+
"full_attention",
|
| 408 |
+
"linear_attention",
|
| 409 |
+
"linear_attention",
|
| 410 |
+
"linear_attention",
|
| 411 |
+
"full_attention",
|
| 412 |
+
"linear_attention",
|
| 413 |
+
"linear_attention",
|
| 414 |
+
"linear_attention",
|
| 415 |
+
"full_attention",
|
| 416 |
+
"linear_attention",
|
| 417 |
+
"linear_attention",
|
| 418 |
+
"linear_attention",
|
| 419 |
+
"full_attention",
|
| 420 |
+
"linear_attention",
|
| 421 |
+
"linear_attention",
|
| 422 |
+
"linear_attention",
|
| 423 |
+
"full_attention",
|
| 424 |
+
"linear_attention",
|
| 425 |
+
"linear_attention",
|
| 426 |
+
"linear_attention",
|
| 427 |
+
"full_attention",
|
| 428 |
+
"linear_attention",
|
| 429 |
+
"linear_attention",
|
| 430 |
+
"linear_attention",
|
| 431 |
+
"full_attention",
|
| 432 |
+
"linear_attention",
|
| 433 |
+
"linear_attention",
|
| 434 |
+
"linear_attention",
|
| 435 |
+
"full_attention",
|
| 436 |
+
"linear_attention",
|
| 437 |
+
"linear_attention",
|
| 438 |
+
"linear_attention",
|
| 439 |
+
"full_attention",
|
| 440 |
+
"linear_attention",
|
| 441 |
+
"linear_attention",
|
| 442 |
+
"linear_attention",
|
| 443 |
+
"full_attention",
|
| 444 |
+
"linear_attention",
|
| 445 |
+
"linear_attention",
|
| 446 |
+
"linear_attention",
|
| 447 |
+
"full_attention",
|
| 448 |
+
"linear_attention",
|
| 449 |
+
"linear_attention",
|
| 450 |
+
"linear_attention",
|
| 451 |
+
"full_attention",
|
| 452 |
+
"linear_attention",
|
| 453 |
+
"linear_attention",
|
| 454 |
+
"linear_attention",
|
| 455 |
+
"full_attention",
|
| 456 |
+
"linear_attention",
|
| 457 |
+
"linear_attention",
|
| 458 |
+
"linear_attention",
|
| 459 |
+
"full_attention"
|
| 460 |
+
],
|
| 461 |
+
"linear_conv_kernel_dim": 4,
|
| 462 |
+
"linear_key_head_dim": 128,
|
| 463 |
+
"linear_num_key_heads": 16,
|
| 464 |
+
"linear_num_value_heads": 48,
|
| 465 |
+
"linear_value_head_dim": 128,
|
| 466 |
+
"mamba_ssm_dtype": "float32",
|
| 467 |
+
"max_position_embeddings": 262144,
|
| 468 |
+
"model_type": "qwen3_5_text",
|
| 469 |
+
"mtp_num_hidden_layers": 1,
|
| 470 |
+
"mtp_use_dedicated_embeddings": false,
|
| 471 |
+
"num_attention_heads": 24,
|
| 472 |
+
"num_hidden_layers": 64,
|
| 473 |
+
"num_key_value_heads": 4,
|
| 474 |
+
"output_gate_type": "swish",
|
| 475 |
+
"pad_token_id": null,
|
| 476 |
+
"partial_rotary_factor": 0.25,
|
| 477 |
+
"rms_norm_eps": 1e-06,
|
| 478 |
+
"rope_parameters": {
|
| 479 |
+
"mrope_interleaved": true,
|
| 480 |
+
"mrope_section": [
|
| 481 |
+
11,
|
| 482 |
+
11,
|
| 483 |
+
10
|
| 484 |
+
],
|
| 485 |
+
"partial_rotary_factor": 0.25,
|
| 486 |
+
"rope_theta": 10000000,
|
| 487 |
+
"rope_type": "default"
|
| 488 |
+
},
|
| 489 |
+
"tie_word_embeddings": false,
|
| 490 |
+
"use_cache": false,
|
| 491 |
+
"vocab_size": 248320
|
| 492 |
+
},
|
| 493 |
+
"tie_word_embeddings": false,
|
| 494 |
+
"transformers_version": "5.13.1",
|
| 495 |
+
"unsloth_version": "2026.7.2",
|
| 496 |
+
"video_token_id": 248057,
|
| 497 |
+
"vision_config": {
|
| 498 |
+
"deepstack_visual_indexes": [],
|
| 499 |
+
"depth": 27,
|
| 500 |
+
"dtype": "bfloat16",
|
| 501 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 502 |
+
"hidden_size": 1152,
|
| 503 |
+
"in_channels": 3,
|
| 504 |
+
"initializer_range": 0.02,
|
| 505 |
+
"intermediate_size": 4304,
|
| 506 |
+
"model_type": "qwen3_5_vision",
|
| 507 |
+
"num_heads": 16,
|
| 508 |
+
"num_position_embeddings": 2304,
|
| 509 |
+
"out_hidden_size": 5120,
|
| 510 |
+
"patch_size": 16,
|
| 511 |
+
"spatial_merge_size": 2,
|
| 512 |
+
"temporal_patch_size": 2
|
| 513 |
+
},
|
| 514 |
+
"vision_end_token_id": 248054,
|
| 515 |
+
"vision_start_token_id": 248053
|
| 516 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 248044,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
248046,
|
| 6 |
+
248044
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 248044,
|
| 9 |
+
"temperature": 1.0,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95
|
| 12 |
+
}
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"size": {
|
| 3 |
+
"longest_edge": 16777216,
|
| 4 |
+
"shortest_edge": 65536
|
| 5 |
+
},
|
| 6 |
+
"patch_size": 16,
|
| 7 |
+
"temporal_patch_size": 2,
|
| 8 |
+
"merge_size": 2,
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.5,
|
| 11 |
+
0.5,
|
| 12 |
+
0.5
|
| 13 |
+
],
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"processor_class": "Qwen3VLProcessor",
|
| 20 |
+
"image_processor_type": "Qwen2VLImageProcessorFast"
|
| 21 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"do_convert_rgb": true,
|
| 4 |
+
"do_normalize": true,
|
| 5 |
+
"do_rescale": true,
|
| 6 |
+
"do_resize": true,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.5,
|
| 10 |
+
0.5
|
| 11 |
+
],
|
| 12 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 13 |
+
"image_std": [
|
| 14 |
+
0.5,
|
| 15 |
+
0.5,
|
| 16 |
+
0.5
|
| 17 |
+
],
|
| 18 |
+
"merge_size": 2,
|
| 19 |
+
"patch_size": 16,
|
| 20 |
+
"resample": 3,
|
| 21 |
+
"rescale_factor": 0.00392156862745098,
|
| 22 |
+
"size": {
|
| 23 |
+
"longest_edge": 16777216,
|
| 24 |
+
"shortest_edge": 65536
|
| 25 |
+
},
|
| 26 |
+
"temporal_patch_size": 2
|
| 27 |
+
},
|
| 28 |
+
"processor_class": "Qwen3VLProcessor",
|
| 29 |
+
"video_processor": {
|
| 30 |
+
"do_convert_rgb": true,
|
| 31 |
+
"do_normalize": true,
|
| 32 |
+
"do_rescale": true,
|
| 33 |
+
"do_resize": true,
|
| 34 |
+
"do_sample_frames": true,
|
| 35 |
+
"fps": 2,
|
| 36 |
+
"image_mean": [
|
| 37 |
+
0.5,
|
| 38 |
+
0.5,
|
| 39 |
+
0.5
|
| 40 |
+
],
|
| 41 |
+
"image_std": [
|
| 42 |
+
0.5,
|
| 43 |
+
0.5,
|
| 44 |
+
0.5
|
| 45 |
+
],
|
| 46 |
+
"max_frames": 768,
|
| 47 |
+
"merge_size": 2,
|
| 48 |
+
"min_frames": 4,
|
| 49 |
+
"patch_size": 16,
|
| 50 |
+
"resample": 3,
|
| 51 |
+
"rescale_factor": 0.00392156862745098,
|
| 52 |
+
"return_metadata": false,
|
| 53 |
+
"size": {
|
| 54 |
+
"longest_edge": 25165824,
|
| 55 |
+
"shortest_edge": 4096
|
| 56 |
+
},
|
| 57 |
+
"temporal_patch_size": 2,
|
| 58 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 59 |
+
}
|
| 60 |
+
}
|
recipe.yaml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
default_stage:
|
| 2 |
+
default_modifiers:
|
| 3 |
+
QuantizationModifier:
|
| 4 |
+
targets: [Linear]
|
| 5 |
+
ignore: [lm_head, model.language_model.embed_tokens, model.language_model.lm_head, model.language_model.visual,
|
| 6 |
+
model.visual, 're:model\.language_model\.visual\..*', 're:model\.visual\..*', 're:.*linear_attn\.conv1d$',
|
| 7 |
+
're:.*linear_attn\.in_proj_a$', 're:.*linear_attn\.in_proj_b$', 're:.*\.mlp\.gate$',
|
| 8 |
+
're:.*\.mlp\.shared_expert_gate$', 're:^mtp.*']
|
| 9 |
+
scheme: FP8_BLOCK
|
| 10 |
+
kv_cache_scheme:
|
| 11 |
+
num_bits: 8
|
| 12 |
+
type: float
|
| 13 |
+
symmetric: true
|
| 14 |
+
group_size: null
|
| 15 |
+
strategy: tensor
|
| 16 |
+
block_structure: null
|
| 17 |
+
dynamic: false
|
| 18 |
+
actorder: null
|
| 19 |
+
scale_dtype: null
|
| 20 |
+
zp_dtype: null
|
| 21 |
+
observer: memoryless_minmax
|
| 22 |
+
observer_kwargs: {}
|
| 23 |
+
bypass_divisibility_checks: false
|
| 24 |
+
requires_calibration_data: true
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
|
| 3 |
+
size 19989325
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"model_max_length": 262144,
|
| 15 |
+
"model_specific_special_tokens": {
|
| 16 |
+
"audio_bos_token": "<|audio_start|>",
|
| 17 |
+
"audio_eos_token": "<|audio_end|>",
|
| 18 |
+
"audio_token": "<|audio_pad|>",
|
| 19 |
+
"image_token": "<|image_pad|>",
|
| 20 |
+
"video_token": "<|video_pad|>",
|
| 21 |
+
"vision_bos_token": "<|vision_start|>",
|
| 22 |
+
"vision_eos_token": "<|vision_end|>"
|
| 23 |
+
},
|
| 24 |
+
"pad_token": "<|endoftext|>",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>"
|
| 33 |
+
}
|
video_preprocessor_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"size": {
|
| 3 |
+
"longest_edge": 25165824,
|
| 4 |
+
"shortest_edge": 4096
|
| 5 |
+
},
|
| 6 |
+
"patch_size": 16,
|
| 7 |
+
"temporal_patch_size": 2,
|
| 8 |
+
"merge_size": 2,
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.5,
|
| 11 |
+
0.5,
|
| 12 |
+
0.5
|
| 13 |
+
],
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"processor_class": "Qwen3VLProcessor",
|
| 20 |
+
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 21 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|