kswanand1 JustinTong commited on
Commit
70fc514
·
1 Parent(s): a0057a7

Update Serving with SGLang section (#1)

Browse files

- Update Serving with SGLang section (ee753aa1cf9818b8f1a3ff9a40b0c43d0a7b5816)
- Use auto parser resolution and v0.5.18+ in the SGLang section (b5cbf0c68763a412bf52ede7fd39a9c6ff6ab993)


Co-authored-by: Xinyuan Tong <JustinTong@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +10 -11
README.md CHANGED
@@ -434,15 +434,12 @@ response = client.chat.completions.create(
434
  print(response.choices[0].message.tool_calls)
435
  ```
436
 
437
- <!--
438
  ## Serving with SGLang
439
 
440
- > **Note:** SGLang does not currently support the custom `granite_thinking_parser` natively. This section is commented out until native support is available. In the meantime, use vLLM for serving with the custom reasoning parser.
441
-
442
- Granite-4.2-30B can also be served with [SGLang](https://github.com/sgl-project/sglang) (v0.5.17+) for high-throughput inference.
443
 
444
- > **Reasoning parser:** Use `nemotron_3`.
445
- > **Tool calling parser:** Use `qwen3_coder`.
446
 
447
  ### Starting the Server
448
 
@@ -451,8 +448,8 @@ python3 -m sglang.launch_server \
451
  --model-path ibm-granite/granite-4.2-30b \
452
  --dtype bfloat16 \
453
  --context-length 131072 \
454
- --reasoning-parser nemotron_3 \
455
- --tool-call-parser qwen3_coder
456
  ```
457
 
458
  ### OpenAI-Compatible API Usage
@@ -463,13 +460,14 @@ from openai import OpenAI
463
  client = OpenAI(base_url="http://localhost:30000/v1", api_key="unused")
464
 
465
  response = client.chat.completions.create(
466
- model="granite-4.2-30b",
467
  messages=[{"role": "user", "content": "Explain the Riemann hypothesis in simple terms."}],
468
  temperature=1.0,
469
  top_p=0.95,
470
  max_tokens=8192,
471
  )
472
 
 
473
  print(response.choices[0].message.content)
474
  ```
475
 
@@ -498,7 +496,7 @@ tools = [
498
  ]
499
 
500
  response = client.chat.completions.create(
501
- model="granite-4.2-30b",
502
  messages=[{"role": "user", "content": "What's the weather like in Boston right now?"}],
503
  tools=tools,
504
  temperature=1.0,
@@ -508,7 +506,8 @@ response = client.chat.completions.create(
508
 
509
  print(response.choices[0].message.tool_calls)
510
  ```
511
- -->
 
512
 
513
  ---
514
 
 
434
  print(response.choices[0].message.tool_calls)
435
  ```
436
 
 
437
  ## Serving with SGLang
438
 
439
+ Granite-4.2-30B can also be served with [SGLang](https://github.com/sgl-project/sglang) (v0.5.18+) for high-throughput inference.
 
 
440
 
441
+ > **Reasoning parser:** Use `--reasoning-parser auto`, which resolves to the built-in `nemotron_3` parser for this checkpoint. It separates the thinking trace into `reasoning_content` and the final answer into `content`, and it handles all three thinking modes (`enable_thinking=True/False`, `low_effort=True`) described in [Thinking Modes](#thinking-modes).
442
+ > **Tool calling parser:** Use `--tool-call-parser auto`, which resolves to `qwen3_coder` for this checkpoint.
443
 
444
  ### Starting the Server
445
 
 
448
  --model-path ibm-granite/granite-4.2-30b \
449
  --dtype bfloat16 \
450
  --context-length 131072 \
451
+ --reasoning-parser auto \
452
+ --tool-call-parser auto
453
  ```
454
 
455
  ### OpenAI-Compatible API Usage
 
460
  client = OpenAI(base_url="http://localhost:30000/v1", api_key="unused")
461
 
462
  response = client.chat.completions.create(
463
+ model="ibm-granite/granite-4.2-30b",
464
  messages=[{"role": "user", "content": "Explain the Riemann hypothesis in simple terms."}],
465
  temperature=1.0,
466
  top_p=0.95,
467
  max_tokens=8192,
468
  )
469
 
470
+ print(response.choices[0].message.reasoning_content)
471
  print(response.choices[0].message.content)
472
  ```
473
 
 
496
  ]
497
 
498
  response = client.chat.completions.create(
499
+ model="ibm-granite/granite-4.2-30b",
500
  messages=[{"role": "user", "content": "What's the weather like in Boston right now?"}],
501
  tools=tools,
502
  temperature=1.0,
 
506
 
507
  print(response.choices[0].message.tool_calls)
508
  ```
509
+
510
+ For a full deployment recipe (Docker, H200/B200 launch matrix, thinking-mode examples, and benchmark data), see the [SGLang Granite 4.2 cookbook](https://docs.sglang.io/cookbook/autoregressive/IBM/Granite-4.2).
511
 
512
  ---
513