# Init DeepSeek-R1 using Offline Batched Inference

**URL:** <https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634>\
**Category:** General\
**Created:** [May 18, 2025, 9:33am UTC](https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634 "2025-05-18T09:33:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoangtnm](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@hoangtnm](https://discuss.vllm.ai/u/hoangtnm)\
**Post date:** [May 18, 2025, 9:33am UTC](https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634/1 "2025-05-18T09:33:30Z")

</div>

Hi all, I am following this [guide](https://docs.vllm.ai/en/stable/getting_started/quickstart.html#offline-batched-inference) to run vllm using python. However, as I understand for deepseek models, we also need “–enable-reasoning --reasoning-parser deepseek\_r1” as this [guide](https://docs.vllm.ai/en/v0.8.5.post1/features/reasoning_outputs.html#quickstart). I am just wondering how to enable reasoning with the python API?

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [May 18, 2025, 9:33am UTC](https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634/2 "2025-05-18T09:33:50Z")

</div>

To enable reasoning for DeepSeek models using the vLLM Python API, you must start the vLLM server with the `--reasoning-parser deepseek_r1` flag (the `--enable-reasoning` flag is now deprecated and not required). The Python client itself does not control reasoning; it simply connects to the server, which must be started with the appropriate reasoning parser enabled. There is no Python API parameter to enable reasoning—this is a server-side configuration only.

For example, launch the server with:

```bash
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B --reasoning-parser deepseek_r1

```

Then, use the OpenAI-compatible Python client as usual. The server will return outputs with the `reasoning_content` field for supported models. See [Reasoning Outputs documentation](https://docs.vllm.ai/en/latest/features/reasoning_outputs.html) and [example code](https://github.com/vllm-project/vllm/blob/main/examples/online_serving/openai_chat_completion_with_reasoning.py) for details.

Would you like more detail or a full code example?

Sources:

- [Reasoning Outputs documentation](https://docs.vllm.ai/en/latest/features/reasoning_outputs.html)
- [openai\_chat\_completion\_with\_reasoning.py example](https://github.com/vllm-project/vllm/blob/main/examples/online_serving/openai_chat_completion_with_reasoning.py)
- [Deprecation of --enable-reasoning](https://github.com/vllm-project/vllm/pull/17452)

---

<div class="post-metadata">

**Author:** ![hoangtnm](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@hoangtnm](https://discuss.vllm.ai/u/hoangtnm)\
**Post date:** [May 18, 2025, 9:39am UTC](https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634/3 "2025-05-18T09:39:56Z")

</div>

how to do this with native python API of vllm, not OpenAI API?

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [May 18, 2025, 9:40am UTC](https://discuss.vllm.ai/t/init-deepseek-r1-using-offline-batched-inference/634/4 "2025-05-18T09:40:18Z")

</div>

There is no documented way to enable reasoning outputs using the native vLLM Python API (`LLM` class or similar); reasoning support is only available via the OpenAI-compatible server interface, not the direct Python API. The native API does not expose parameters for reasoning or reasoning parsers, and all official examples and documentation use the OpenAI API interface for this feature ([see docs](https://docs.vllm.ai/en/latest/features/reasoning_outputs.html), [see example](https://github.com/vllm-project/vllm/blob/main/examples/online_serving/openai_chat_completion_with_reasoning.py)).

If you need reasoning outputs, you must use the OpenAI-compatible HTTP server and client. The native Python API does not support this as of the latest documentation.

Would you like more detail or a workaround suggestion?

Sources:

- [Reasoning Outputs documentation](https://docs.vllm.ai/en/latest/features/reasoning_outputs.html)
- [see example](https://github.com/vllm-project/vllm/blob/main/examples/online_serving/openai_chat_completion_with_reasoning.py)
