Image-Text-to-Text
Transformers
Safetensors
qwen3_5
qwen3.8
bfloat16
long-context
yarn
1m-context
multimodal
vision
reasoning
swissneuron
conversational
Instructions to use SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked") 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("SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked") model = AutoModelForMultimodalLM.from_pretrained("SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked", 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 SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked", "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/SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked
- SGLang
How to use SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked 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 "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked" \ --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": "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked", "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 "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked" \ --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": "SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked", "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" } } ] } ] }' - Docker Model Runner
How to use SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked with Docker Model Runner:
docker model run hf.co/SwissNeuron/Qwen3.8-27B-SwissNeuron-Derisked
Document thinking-mode verification-trace behavior and agent workaround
Browse files
README.md
CHANGED
|
@@ -30,6 +30,18 @@ SwissNeuron is intended to provide Swiss-quality model engineering: precise prov
|
|
| 30 |
- **Original MTP, multimodal processor, tokenizer, and chat template retained**
|
| 31 |
- **No quantization**: this release contains the merged BF16 weights; quantized editions will follow separately
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
## What makes SwissNeuron different
|
| 34 |
|
| 35 |
Many aggressively modified or “uncensored” checkpoints trade away reasoning quality, instruction fidelity, or language-model calibration. SwissNeuron was built around the opposite objective: alter behavior while minimizing movement outside the targeted representation subspace.
|
|
@@ -93,7 +105,7 @@ text = tokenizer.apply_chat_template(
|
|
| 93 |
messages,
|
| 94 |
tokenize=False,
|
| 95 |
add_generation_prompt=True,
|
| 96 |
-
enable_thinking=
|
| 97 |
)
|
| 98 |
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 99 |
output = model.generate(**inputs, max_new_tokens=2048)
|
|
@@ -104,7 +116,7 @@ For production inference, use a serving engine that explicitly supports `Qwen3_5
|
|
| 104 |
|
| 105 |
## Recommended generation settings
|
| 106 |
|
| 107 |
-
|
| 108 |
|
| 109 |
```text
|
| 110 |
temperature=0.6
|
|
@@ -112,7 +124,7 @@ top_p=0.95
|
|
| 112 |
top_k=20
|
| 113 |
```
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
## Training and derisk provenance
|
| 118 |
|
|
@@ -142,6 +154,7 @@ The larger fine-tuned release will be published as a separate checkpoint rather
|
|
| 142 |
## Limitations
|
| 143 |
|
| 144 |
- The 1M window is enabled through YaRN configuration; extreme-context quality has not yet been comprehensively validated.
|
|
|
|
| 145 |
- This is a full BF16 release and requires substantial accelerator memory.
|
| 146 |
- Outputs may be inaccurate, incomplete, or unsuitable for a particular domain. Independently verify consequential results.
|
| 147 |
- The repository is public, but users remain responsible for evaluating suitability, licensing requirements, and deployment risk in their own environment.
|
|
|
|
| 30 |
- **Original MTP, multimodal processor, tokenizer, and chat template retained**
|
| 31 |
- **No quantization**: this release contains the merged BF16 weights; quantized editions will follow separately
|
| 32 |
|
| 33 |
+
## Important mode behavior
|
| 34 |
+
|
| 35 |
+
This release should be served with **thinking disabled** for ordinary chat, coding agents, and OpenCode-style tool loops:
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
enable_thinking=False
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
The focused post-training corpus contains a high concentration of rethink and answer-verification trajectories. In the current BF16 release, enabling the native thinking channel can therefore make simple requests produce an overly rigid internal verification trace (for example, `Step 1`, `EXPECTED VERIFICATION`, and `ORIGINAL ANSWER`) before the otherwise normal final answer. A system prompt does not reliably suppress this learned thinking-mode format. Non-thinking mode does not exhibit the issue in our direct probes and returns the concise final answer normally.
|
| 42 |
+
|
| 43 |
+
For agent harnesses, set `enable_thinking=False` in the Qwen chat-template arguments rather than stripping the trace after generation. The planned larger fine-tune will rebalance native reasoning, rethink, and direct-answer data before advertising thinking-mode agent compatibility.
|
| 44 |
+
|
| 45 |
## What makes SwissNeuron different
|
| 46 |
|
| 47 |
Many aggressively modified or “uncensored” checkpoints trade away reasoning quality, instruction fidelity, or language-model calibration. SwissNeuron was built around the opposite objective: alter behavior while minimizing movement outside the targeted representation subspace.
|
|
|
|
| 105 |
messages,
|
| 106 |
tokenize=False,
|
| 107 |
add_generation_prompt=True,
|
| 108 |
+
enable_thinking=False,
|
| 109 |
)
|
| 110 |
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 111 |
output = model.generate(**inputs, max_new_tokens=2048)
|
|
|
|
| 116 |
|
| 117 |
## Recommended generation settings
|
| 118 |
|
| 119 |
+
Optional thinking-mode experiments (subject to the mode caveat above):
|
| 120 |
|
| 121 |
```text
|
| 122 |
temperature=0.6
|
|
|
|
| 124 |
top_k=20
|
| 125 |
```
|
| 126 |
|
| 127 |
+
For ordinary chat, coding agents, and tool loops, use non-thinking mode and tune generation parameters against the deployment task. Preserve the included chat template and explicitly set `enable_thinking=False` rather than manually inserting or deleting reasoning markers.
|
| 128 |
|
| 129 |
## Training and derisk provenance
|
| 130 |
|
|
|
|
| 154 |
## Limitations
|
| 155 |
|
| 156 |
- The 1M window is enabled through YaRN configuration; extreme-context quality has not yet been comprehensively validated.
|
| 157 |
+
- Native thinking mode can overproduce a rigid verification/critic trace because of the rethink-heavy post-training mixture. Use `enable_thinking=False` for general chat and agent integrations in this release.
|
| 158 |
- This is a full BF16 release and requires substantial accelerator memory.
|
| 159 |
- Outputs may be inaccurate, incomplete, or unsuitable for a particular domain. Independently verify consequential results.
|
| 160 |
- The repository is public, but users remain responsible for evaluating suitability, licensing requirements, and deployment risk in their own environment.
|