BuildRiot
Sign in

Article · AI

SGLang 0.5.22 adds Apple Silicon to its standard PyTorch runner

SGLang 0.5.22 adds Apple Silicon support through its standard PyTorch backend alongside MLX. This guide outlines a local prototype and tests for application compatibility, memory use, caching, and concurrency, with clear limits on what Mac results establish.

A miniature laptop under a warm desk lamp exposes blue and lavender chip bridges, paper requests, parallel replies, a cache drawer, and a memory gauge.
Illustration: BuildRiot (AI-generated)

Key takeaway

A Mac can help catch serving integration failures before deployment if the application's own tests pass. Local results can establish specific behaviors, but production capacity and distributed execution still need testing on the deployment configuration.

What the standard runner supports

SGLang announced standard PyTorch backend support for Apple Silicon in version 0.5.22 on October 19, 2026. The change makes a Mac a plausible place to exercise application requests before deploying elsewhere. Its value depends on which behaviors a local test reproduces, from response parsing to cache reuse. Sources: SGLang on GitHub

An earlier contributor report described both Torch/MPS and MLX serving on a Mac. The new implementation integrates Apple support into the standard runner through PyTorch’s Metal Performance Shaders, or MPS, device path. It uses native Torch attention, PyTorch sampling, eager execution, and disabled overlap scheduling. Those choices set the boundaries for a local prototype. Sources: SGLang on GitHub, GitHub Gist

The table below summarizes the implementation’s execution choices and exclusions. Low-rank adaptation, or LoRA, has a backend restriction rather than a blanket prohibition. Any production workflow that depends on an excluded feature needs another environment for that portion of testing. Sources: SGLang on GitHub

Table

Apple PyTorch runner capabilities and restrictions

AreaApple runner behavior
Attention and samplingNative Torch attention; PyTorch sampling
ExecutionEager execution; overlap scheduling disabled
ModelsQuantized weights and multimodal models rejected
OptimizationSpeculative decoding and torch.compile rejected
DistributionDisaggregated serving rejected; tensor, pipeline, and data parallel sizes each restricted to one
Key-value cacheAutomatic or BF16 data type; HND layout rejected
LoRARestricted by backend, not prohibited outright
The implementation limits which production configurations a Mac can exercise.Source: SGLang on GitHub

Pin the installation and establish a baseline

Record the Mac chip, GPU core count, physical memory, macOS build, power mode, Python version, and background memory pressure. SGLang 0.5.22 requires Python 3.11 or newer. PyPI lists uploads dated October 16, 2026, and six Linux wheels; that file list does not establish a macOS wheel installation route. SGLang-Omni documents a source installation using version 0.5.22 and the all_mps extra, though its installer also handles audio dependencies. Sources: SGLang on GitHub, SGLang-Omni, PyPI

The commands below form an untested reproduction recipe; the benchmark results later in this guide are contributor measurements without independent reproduction. The source installation follows the release and extra documented by SGLang-Omni. Save dependency resolution and build failures, and keep the release pinned rather than silently switching branches. Sources: SGLang-Omni

git clone --branch v0.5.22 --depth 1 https://github.com/sgl-project/sglang.git
cd sglang
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e './python[all_mps]'
python -m pip freeze > environment.txt

Check whether PyTorch exposes an MPS device before launching. The candidate launch follows the implementation’s validation setup, selecting Torch, Qwen3-0.6B, and a static memory fraction of 0.6. Before measuring, replace the model identifier with a downloaded snapshot pinned to a recorded revision. Preserve startup logs and resolved arguments so later runs can be compared. Sources: SGLang on GitHub

python -c 'import torch; print(torch.__version__); print(torch.backends.mps.is_available())'
SGLANG_USE_MLX=0 python -m sglang.launch_server \
  --model-path Qwen/Qwen3-0.6B \
  --device mps \
  --mem-fraction-static 0.6 \
  --host 127.0.0.1 \
  --port 30000

Test application behavior before throughput

Start with a small request through the interface the application uses. The earlier contributor example demonstrates the Chat Completions route, making it a useful test target for this runner. Capture the response status, schema, model identifier, token usage, and finish reason. A successful response alone does not establish compatibility. Sources: GitHub Gist

curl --fail-with-body http://127.0.0.1:30000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "Qwen/Qwen3-0.6B",
    "messages": [
      {"role": "user", "content": "Return the word ready."}
    ],
    "temperature": 0,
    "max_tokens": 32,
    "stream": false
  }'

Run the same fixture against production, matching the model, tokenizer, conversation template, and precision wherever possible. If those differ, assess transport compatibility separately from generated content. Use the proposed checks below according to the application’s dependencies. These are tests to perform, not promises that every feature works.

Table

Proposed application compatibility checks

TestCapturePurpose
Discovery and completionStatus, schema, model identifiers, usage, finish reasonClient integration
StreamingEvents, deltas, termination, usageStream parsing
Conversation historyRendered template and responseMessage formatting
Stops and token limitsTermination and finish reasonGeneration control
Sampling parametersOutput distributions and validation errorsParameter effects
Structured JSONParsing and schema checksConstraint enforcement
Tool callsNames, IDs, arguments, continuationTool compatibility
Log probabilitiesShape, token alignment, finite valuesScoring behavior
Bad requestsErrors for invalid inputsFailure handling
CancellationCapacity after disconnectResource recovery
Concurrent sessionsDistinct prompts and request IDsResponse isolation
Repeated prefixesCache telemetry and cold/warm latencyCache reuse
Each check tests a particular behavior under the chosen configuration.

A valid JSON response alone does not establish schema enforcement. Likewise, an accepted sampling parameter does not show that the runner applied it. Test difficult schemas, measurable parameter changes, and malformed requests. Keep unsupported-configuration startup checks separate from valid serving runs, and check that failures are clear and prompt.

Measure memory throughout serving

The implementation sizes memory using Metal’s recommended budget and driver allocations. An idle process reading therefore gives an incomplete picture of whether a workload fits. Measure startup and request peaks alongside steady-state behavior. The proposed sequence below also checks whether memory use recovers after traffic stops. Sources: SGLang on GitHub

  1. Measure the idle machine before launching the server.
  2. Capture startup, post-load idle, first-request, and warmed-up memory use.
  3. Increase input lengths within the configured context limit.
  4. Repeat with increasing request concurrency.
  5. Compare unique prefixes with a shared prefix.
  6. Run sustained mixed traffic with cancellations, then measure recovery during idle.

Capture process-tree resident set size, system memory pressure, swap changes, runtime allocation counters, and configured token capacity. Preserve actual request lengths so comparisons reflect the work performed. Keep accounting definitions separate and check for overlap before adding counters together. Allocator instrumentation must observe the server worker; a separate Python monitoring process would measure its own allocator state.

Separate throughput from user latency

The implementation contributor reported 72.94 output tokens per second for Qwen3-0.6B on an M4 Pro with 48 GB of memory. The workload used 40 requests, 256 input tokens, 128 output tokens, and concurrency eight. Median time to first token was 186.48 milliseconds, and median time per output token was 104.33 milliseconds. Aggregate output rate answers a different question from how long an individual user waits. Sources: SGLang on GitHub

SGLang’s indexed benchmark guide describes concurrency controls, compatible chat backends, and detailed output. Check the installed benchmark’s help output before using the candidate command below. Treat it as a proposed baseline, then repeat with higher concurrency and separate output files. Confirm actual token lengths instead of assuming every request reaches its output limit. Sources: SGLang

python -m sglang.bench_serving \
  --backend sglang-oai-chat \
  --host 127.0.0.1 --port 30000 \
  --model Qwen/Qwen3-0.6B \
  --dataset-name random \
  --random-input-len 256 \
  --random-output-len 128 \
  --random-range-ratio 1 \
  --num-prompts 200 \
  --max-concurrency 1 \
  --output-file mac-c1.jsonl \
  --output-details

Exclude warmup explicitly and repeat the measurements. Report successful requests, failures, timeouts, actual token counts, elapsed time, and output throughput. Include typical and tail latency for the first token and complete response, plus latency between tokens. Keep failures in the denominator and avoid strong tail-latency conclusions from small samples.

Next, mix short and long prompts and add controlled arrival rates to expose queue growth. Separate cold-cache runs from shared-prefix runs while recording power conditions and memory pressure. Client concurrency alone does not establish simultaneous GPU execution. Use logs or instrumentation to distinguish queueing from effective batching.

Define what a passing Mac test establishes

Treat the Mac as a functional staging environment once the application’s own contract tests pass. The implementation’s generation and radix-cache reuse test supports including cache behavior in that checklist. A useful result identifies exactly which request formats, stream parsers, errors, and cancellation behaviors match production. Sources: SGLang on GitHub

Match backend comparisons to the release and workload. An earlier M1 report used 60 input tokens and 10 output tokens for its Torch-versus-MLX comparison. Its older implementation and short workload do not establish a performance gap for version 0.5.22. Choose a backend against the application’s required operations, measured memory peaks, and latency budget. Sources: GitHub Gist

Save a compatibility record with the pinned environment, model revision, passing tests, failures, and workload limits. Test structured outputs, tool calls, log probabilities, and LoRA wherever the application depends on them. Keep production capacity and distributed execution tests on the deployment configuration they are meant to qualify.

Attribution

Sources

  1. 1SGLang on GitHubSGLang v0.5.22 release announcementSource published (UTC)
  2. 2SGLang on GitHubAdd an Apple Silicon MPS platform to the standard Torch model runner
  3. 3SGLang-OmniInstallation — Apple Silicon
  4. 4PyPIsglang 0.5.22Source published (UTC)
  5. 5GitHub GistAccelerating SGLang Inference on macOS: 5× Faster with Native MLX
  6. 6SGLangBench Serving Guide

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on AI

All AI stories

Review · AI

Resend launches Inboxes for shared, programmable email workflows

Resend describes Inboxes as shared, programmable email inboxes where teams and connected agents can work on conversations. The company announced it on October 22, 2026. It says Inboxes adds conversation management to email receiving infrastructure introduced in 2025. According to Resend, developers can create addresses on their own domains, retrieve conversations, reply within threads, and respond to webhook events. The company also describes assignments, internal notes, and collaborative drafts. Built-in agents have configurable instructions and permitted actions, according to Resend.

Resend

Review · AI

Kimi K3.1 Pro: hosted coding model with lower published rates than K3

Moonshot AI’s Kimi K3.1 Pro has lower published input and output rates than Kimi K3. Moonshot describes Pro as further post-training of K3. It claims a one-million-token context window and improvements in coding and agent tasks. Vercel lists Pro on AI Gateway with a release date of October 23, 2026. It documents AI SDK, Chat Completions, Responses and Anthropic Messages access. Vercel lists vision, tool use and structured outputs for Pro. Hosted access is available; Moonshot promises downloadable weights “by Nov 4.”

Moonshot AI