Instructions to use internlm/Intern-S2-Mobius with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/Intern-S2-Mobius with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="internlm/Intern-S2-Mobius", trust_remote_code=True) 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("internlm/Intern-S2-Mobius", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use internlm/Intern-S2-Mobius with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/Intern-S2-Mobius" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/Intern-S2-Mobius", "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/internlm/Intern-S2-Mobius
- SGLang
How to use internlm/Intern-S2-Mobius 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 "internlm/Intern-S2-Mobius" \ --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": "internlm/Intern-S2-Mobius", "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 "internlm/Intern-S2-Mobius" \ --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": "internlm/Intern-S2-Mobius", "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 internlm/Intern-S2-Mobius with Docker Model Runner:
docker model run hf.co/internlm/Intern-S2-Mobius
Update README, deployment guide, and figures
Browse files- .gitattributes +2 -0
- README.md +17 -7
- deployment_guide.md +7 -37
- figs/chain-of-thought.png +0 -0
- figs/efficiency.png +0 -0
- figs/performance.png +0 -0
.gitattributes
CHANGED
|
@@ -38,3 +38,5 @@ figs/efficiency.jpg filter=lfs diff=lfs merge=lfs -text
|
|
| 38 |
figs/title.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
figs/performance.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
figs/case-study.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 38 |
figs/title.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
figs/performance.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
figs/case-study.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
figs/chain-of-thought.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
figs/efficiency.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -12,7 +12,7 @@ pipeline_tag: image-text-to-text
|
|
| 12 |
|
| 13 |
<div> </div>
|
| 14 |
|
| 15 |
-
[💻Github Repo](https://github.com/InternLM/Intern-S2-Mobius) • [🤗Model Collections](https://huggingface.co/collections/internlm/intern-s2) • [
|
| 16 |
|
| 17 |
</div>
|
| 18 |
|
|
@@ -40,16 +40,27 @@ This knowledge-reasoning separation gives Intern-S2-Mobius two native capabiliti
|
|
| 40 |
<figcaption>Fig1: Inference efficiency on reasoning benchmarks. Intern-S2-Mobius improves request throughput over the Transformer baseline while maintaining strong reasoning performance, with gains largely coming from shorter, more compact reasoning traces.</figcaption>
|
| 41 |
</figure>
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
We use the [OpenCompass](https://github.com/open-compass/OpenCompass/) and [VLMEvalKit](https://github.com/open-compass/vlmevalkit) to evaluate all models. For text benchmarks, Intern-S2-Mobius is evaluated with a maximum inference length of 64K tokens on MMLU Pro, SimpleQA, and HLE, and 128K tokens on the remaining text benchmarks. For multimodal benchmarks, Intern-S2-Mobius is evaluated with a maximum inference length of 64K tokens.
|
| 53 |
|
| 54 |
|
| 55 |
## Quick Start
|
|
@@ -72,7 +83,6 @@ Intern-S2-Mobius can be deployed using any of the following LLM inference framew
|
|
| 72 |
- LMDeploy
|
| 73 |
- Transformer
|
| 74 |
- vLLM
|
| 75 |
-
- SGLang
|
| 76 |
|
| 77 |
Detailed deployment examples for these frameworks are available in the [Model Deployment Guide](./deployment_guide.md).
|
| 78 |
|
|
|
|
| 12 |
|
| 13 |
<div> </div>
|
| 14 |
|
| 15 |
+
[💻Github Repo](https://github.com/InternLM/Intern-S2-Mobius) • [🤗Model Collections](https://huggingface.co/collections/internlm/intern-s2) • [🌳Arch Space](https://github.com/InternLM/archspace)
|
| 16 |
|
| 17 |
</div>
|
| 18 |
|
|
|
|
| 40 |
<figcaption>Fig1: Inference efficiency on reasoning benchmarks. Intern-S2-Mobius improves request throughput over the Transformer baseline while maintaining strong reasoning performance, with gains largely coming from shorter, more compact reasoning traces.</figcaption>
|
| 41 |
</figure>
|
| 42 |
|
| 43 |
+
<figure>
|
| 44 |
+
<img src="./figs/chain-of-thought.png" alt="chain of thought">
|
| 45 |
+
<figcaption>Fig2: The average output length of Mobius continual pre-trained from Qwen3.5.</figcaption>
|
| 46 |
+
</figure>
|
| 47 |
|
| 48 |
+
### Performance
|
| 49 |
|
| 50 |
+
We evaluate the Intern-S2-Mobius on various benchmarks, including general datasets and scientific datasets. We report the performance comparison with Qwen3.5-35B below. We use the [OpenCompass](https://github.com/open-compass/OpenCompass/) to evaluate all models. For text benchmarks, Intern-S2-Mobius is evaluated with a maximum inference length of 64K tokens on MMLU Pro, SimpleQA, and HLE, and 128K tokens on the remaining text benchmarks.
|
| 51 |
|
| 52 |
+
<figure>
|
| 53 |
+
<img src="./figs/performance.png" alt="performance">
|
| 54 |
+
<figcaption>Fig3: Performance comparison across general, scientific, and multimodal benchmarks. The higher score in each row is highlighted in <strong>bold</strong>.</figcaption>
|
| 55 |
+
</figure>
|
| 56 |
|
| 57 |
+
<figure>
|
| 58 |
+
<img src="./figs/case-study.png" alt="case study">
|
| 59 |
+
<figcaption>Fig4: Step-aligned comparison between Intern-S2-Mobius-35B and Qwen3.5-35B
|
| 60 |
+
on a linear-algebra multiple-choice question. Both models select the correct
|
| 61 |
+
answer (Option C). Token counts are computed using the Qwen3.5-35B tokenizer. Mobius completes the same reasoning steps with fewer tokens, which mainly benefits from the model's elimination of repeated derivation and checks.</figcaption>
|
| 62 |
+
</figure>
|
| 63 |
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
## Quick Start
|
|
|
|
| 83 |
- LMDeploy
|
| 84 |
- Transformer
|
| 85 |
- vLLM
|
|
|
|
| 86 |
|
| 87 |
Detailed deployment examples for these frameworks are available in the [Model Deployment Guide](./deployment_guide.md).
|
| 88 |
|
deployment_guide.md
CHANGED
|
@@ -97,56 +97,26 @@ For example, you can use the vLLM nightly Docker image `docker pull vllm/vllm-op
|
|
| 97 |
- Serving With MTP (Recommended)
|
| 98 |
|
| 99 |
```bash
|
| 100 |
-
vllm serve
|
|
|
|
| 101 |
--trust-remote-code \
|
| 102 |
--tensor-parallel-size 2 \
|
| 103 |
--reasoning-parser qwen3 \
|
| 104 |
--enable-auto-tool-choice \
|
| 105 |
--tool-call-parser qwen3_coder \
|
| 106 |
-
--
|
|
|
|
| 107 |
```
|
| 108 |
|
| 109 |
- Basic Serving Without MTP
|
| 110 |
|
| 111 |
```bash
|
| 112 |
-
vllm serve
|
|
|
|
| 113 |
--trust-remote-code \
|
| 114 |
--tensor-parallel-size 2 \
|
| 115 |
--reasoning-parser qwen3 \
|
| 116 |
--enable-auto-tool-choice \
|
| 117 |
-
--tool-call-parser qwen3_coder
|
| 118 |
-
```
|
| 119 |
-
|
| 120 |
-
## SGLang
|
| 121 |
-
|
| 122 |
-
Use the latest SGLang Docker image or source build with Intern-S2-Preview support.
|
| 123 |
-
|
| 124 |
-
For example, you can use the SGLang nightly Docker image `docker pull lmsysorg/sglang:nightly-dev-cu12-20260520-425dffbd`
|
| 125 |
-
|
| 126 |
-
- Serving With MTP (Recommended)
|
| 127 |
-
|
| 128 |
-
```bash
|
| 129 |
-
SGLANG_ENABLE_SPEC_V2=1 \
|
| 130 |
-
python3 -m sglang.launch_server \
|
| 131 |
-
--model-path internLM/Intern-S2-Preview \
|
| 132 |
-
--trust-remote-code \
|
| 133 |
-
--tp-size 2 \
|
| 134 |
-
--reasoning-parser qwen3 \
|
| 135 |
-
--tool-call-parser qwen3_coder \
|
| 136 |
-
--mamba-scheduler-strategy extra_buffer \
|
| 137 |
-
--speculative-algo 'NEXTN' \
|
| 138 |
-
--speculative-eagle-topk 1 \
|
| 139 |
-
--speculative-num-steps 3 \
|
| 140 |
-
--speculative-num-draft-tokens 4
|
| 141 |
```
|
| 142 |
|
| 143 |
-
- Basic Serving Without MTP
|
| 144 |
-
|
| 145 |
-
```bash
|
| 146 |
-
python3 -m sglang.launch_server \
|
| 147 |
-
--model-path internlm/Intern-S2-Preview \
|
| 148 |
-
--trust-remote-code \
|
| 149 |
-
--tp-size 2 \
|
| 150 |
-
--reasoning-parser qwen3 \
|
| 151 |
-
--tool-call-parser qwen3_coder
|
| 152 |
-
```
|
|
|
|
| 97 |
- Serving With MTP (Recommended)
|
| 98 |
|
| 99 |
```bash
|
| 100 |
+
vllm serve \
|
| 101 |
+
internlm/Intern-S2-Mobius \
|
| 102 |
--trust-remote-code \
|
| 103 |
--tensor-parallel-size 2 \
|
| 104 |
--reasoning-parser qwen3 \
|
| 105 |
--enable-auto-tool-choice \
|
| 106 |
--tool-call-parser qwen3_coder \
|
| 107 |
+
--spec-method mtp \
|
| 108 |
+
--spec-tokens 4
|
| 109 |
```
|
| 110 |
|
| 111 |
- Basic Serving Without MTP
|
| 112 |
|
| 113 |
```bash
|
| 114 |
+
vllm serve \
|
| 115 |
+
internlm/Intern-S2-Mobius \
|
| 116 |
--trust-remote-code \
|
| 117 |
--tensor-parallel-size 2 \
|
| 118 |
--reasoning-parser qwen3 \
|
| 119 |
--enable-auto-tool-choice \
|
| 120 |
+
--tool-call-parser qwen3_coder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
```
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
figs/chain-of-thought.png
CHANGED
|
|
Git LFS Details
|
figs/efficiency.png
CHANGED
|
|
Git LFS Details
|
figs/performance.png
CHANGED
|
|
Git LFS Details
|