> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m-star.org/llms.txt
> Use this file to discover all available pages before exploring further.

# GLM-5.2 and GLM-5.3-Flash

> Size an eight-GPU deployment and choose standard, long-context or greedy speculative decoding.

Both GLM checkpoints serve text-only chat on eight GPUs. Pick `glm52` for GLM-5.2 FP8 or `glm5_next` for GLM-5.3-Flash. The latter combines MLA with recurrent Kimi Delta Attention (KDA), so its concurrency depends on both KV pages and KDA slots. The default `glm5_next_tp8.yaml` caps concurrent requests at 64 to fit its recurrent-state pool.

## Install and start

The GLM-5.2 default is sized for eight 141 GB GPUs and roughly 750 GB of weights. The GLM-5.3-Flash default is sized for eight 80 GB GPUs and roughly 306 GB of weights. For local weights set `model_kwargs.checkpoint_path`.

### `glm52`

Text → text. The default `glm52_tp8.yaml` uses 8 GPUs. The [weights](https://huggingface.co/zai-org/GLM-5.2-FP8) use MIT.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[glm]"
mstar serve glm52
```

[Send the request](#reply).

### `glm5_next`

Text → text. The default `glm5_next_tp8.yaml` uses 8 GPUs. The [weights](https://huggingface.co/zai-org/GLM-5.3-Flash) use MIT.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[glm]"
mstar serve glm5_next
```

[Send the request](#reply).

## Send a request

Run either client example in a second terminal after `/health` returns 200.

### Generate text

Read the text answer from the response.

**Python SDK**

```python theme={null}
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
print(client.generate(
    text='Write a short explanation of a solar eclipse.',
    output_modalities=('text',),
).text)
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  --form-string 'text=Write a short explanation of a solar eclipse.' \
  --form-string output_modalities=text \
  --form-string streaming=false \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
text = b"".join(base64.b64decode(chunk["data"]) for chunk in outputs["text"])
print(text.decode())
'
```

## Deployment configs

| File | GPUs | Parallelism | When to use |
| - | - | - | - |
| `configs/glm52_tp8.yaml` | 8 | TP8 | The default: contexts up to 2048 tokens, captured decode. |
| `configs/glm52_tp8_mtp.yaml` | 8 | TP8 | MTP drafting with 3 draft tokens per step. Greedy only. |
| `configs/glm52_tp8_longctx.yaml` | 8 | TP8 | Eager DSA decode to 8192 tokens, with at most 24 concurrent requests. |
| `configs/glm5_next_tp8.yaml` | 8 | TP8 | The default: contexts up to 2048 tokens. |
| `configs/glm5_next_tp8_mtp.yaml` | 8 | TP8 | MTP drafting with 3 draft tokens per step. Greedy only. |

To use an alternative, pass `--config configs/<file>` after the launcher name. From a wheel installation, [copy the shipped YAML](https://docs.m-star.org/serving.md#custom-configs) and pass its local path.

## Settings and defaults

Deployment keys under `model_kwargs`:

| Knob | Model | Default | Effect |
| - | - | - | - |
| `kernels` | `glm52` | `auto` | `auto` runs the tuned kernels, among them the fused fp8 MoE that lets decode capture. `reference` runs the numerics anchor, eager. |
| `moe_quant_kernel` | `glm5_next` | `reference`; `auto` in the shipped configs | The same choice for GLM-5.3-Flash's MoE. |
| `mtp_num_draft_tokens` | both | 0 | Draft tokens per decode step from the checkpoint's MTP layer. |
| `dsa_long_context` | `glm52` | `false` | Serve past `index_topk` (2048) up to `model_kwargs.max_seq_len`. `glm5_next` refuses it. |
| `prefill_graphs` | `glm5_next` | `false`; `true` in the shipped configs | Capture prefill per batch size and token bucket. `false` keeps it eager. |
| `checkpoint_path` | both | | A local checkpoint directory. |

Request knobs: `temperature`, `top_p`, `top_k`, `min_p`, `repetition_penalty`, `penalize_prompt` and `ignore_eos`. Sampling defaults to the checkpoints' temperature 1.0 and top\_p 0.95, read from `generation_config.json` when it is cached.

## Limits

* Contexts are held to `index_topk` (2048 tokens), where dense MLA computes exactly what the sparse attention does. A request with no `max_tokens` runs to the room its prompt leaves. On `glm5_next`, a `max_tokens` above 2048 is a 400, and under MTP so is one past the room the prompt leaves.
* With `dsa_long_context`, a prompt must still fit in 2048 tokens; decode runs past it. The path is eager, and it cannot be combined with MTP.
* With MTP drafting, a request with a `temperature` above 0 or a repetition penalty is refused.
* A `min_p` above 0 is refused, since neither checkpoint sets one.
* Neither model reports logprobs; a request that sets `return_logprobs` is refused.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.