Model reference · open weights
glm-4-voice-of-reason is an open-weight language model from kyutai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | kyutai |
|---|---|
| Type | Language models |
| Task | Omni (any→any) |
| Parameters (lead) | 9.5B |
| Runs with | transformers |
| Based on | THUDM/glm-4-voice-9b |
| Released | 2026-08-04 |
| Popularity | 0 downloads / month |
| Licence | Commercial licence needed |
About
A speech-to-speech model that reasons before it speaks. GLM-4-Voice-9B trained with reinforcement learning against a binary LLM judge on math word problems — no supervised finetuning stage, the reasoning behaviour is learned from the reward alone.
Scores 0.706 on GSM8K (1310 test items, written channel, gpt-4o-2024-11-20 as judge).
The audio front end is GLM-4-Voice's, unchanged and not in this repo, so clone it for the speech tokenizer:
git clone https://github.com/THUDM/GLM-4-Voice
uv init glm-of-reason && cd glm-of-reason
uv add "transformers>=4.44,<4.48" torch torchaudio accelerate tiktoken soundfile
tiktoken is needed by the tokenizer's remote code and soundfile by torchaudio to read your
file; both fail late and unhelpfully if missing. Save the script below as demo.py, point AUDIO
at your wav — anything torchaudio can read, any sample rate — and run uv run demo.py:
import sys, torch
sys.path.insert(0, "../GLM-4-Voice") # the clone, next to the project
from transformers import AutoModel, AutoTokenizer, WhisperFeatureExtractor
from speech_tokenizer.modeling_whisper import WhisperVQEncoder
from speech_tokenizer.utils import extract_speech_token
AUDIO = "question.wav" # <-- your spoken question
REPO = "kyutai/glm-4-voice-of-reason-9b"
SYSTEM = (
"User will provide you with a speech instruction. Do it step by step. "
"First, think about the instruction and respond in a interleaved manner, "
"with 13 text token followed by 26 audio tokens. "
)
tokenizer = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
model = AutoModel.from_pretrained(
REPO, torch_dtype=torch.bfloat16, device_map="cuda", trust_remote_code=True
).eval()
whisper = WhisperVQEncoder.from_pretrained("THUDM/glm-4-voice-tokenizer").eval().to("cuda")
features = WhisperFeatureExtractor.from_pretrained("THUDM/glm-4-voice-tokenizer")
audio_tokens = extract_speech_token(whisper, features, [AUDIO])[0]
user = "" + "".join(f"" for t in audio_tokens) + ""
prompt = f"\n{SYSTEM}\n{user}streaming_transcription\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
out = model.generate(
**inputs,
max_new_tokens=1000,
do_sample=False,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.convert_tokens_to_ids(""),
)
new = out[0, inputs.input_ids.shape[1]:].tolist()
audio_offset = tokenizer.convert_tokens_to_ids("")
text = tokenizer.decode([t for t in new if t < audio_offset], skip_special_tokens=True)
speech_tokens = [t - audio_offset for t in new if t >= audio_offset]
print(text)
There is no hidden channel here: the model reasons in the answer it speaks, step by step, so text
is the whole response. Its
stitch sibling keeps the reasoning
unspoken instead, wrapped in [SOPR] ... [EOPR].
speech_tokens are the audio codes of that answer; feed them to
THUDM/glm-4-voice-decoder to get a waveform,
or run the full duplex demo from the GLM-4-Voice repo with --model-path pointing here.
This script was run as printed, on one H100, with transformers 4.47.1 and torch 2.8.0. Pick a
torch build that matches your driver: the newest wheel needs a newer CUDA than many clusters run.
Inherited from GLM-4-Voice; see the license link above.
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys glm-4-voice-of-reason for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (glm-4-voice-of-reason below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-4-voice-of-reason","messages":[{"role":"user","content":"Hello"}]}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.