Inference examples and channel guide
The examples/ directory provides three runnable client workflows covering standalone single-task serving, unified nine-modality serving, and raw-signal feature extraction plus benchmark scoring:
| Example | Scope | Key features |
|---|---|---|
examples/vllm_cif.py | Standalone crystal (cif/jarvis) client | Self-contained (load_projector.py + modeling_projector.py), no evalkit/trainkit install required |
examples/vllm_projector.py | Unified 9-modality client | Uses GlmProjectorSession; supports discrete, side, counts, atom_numbering, payload_labels, multi-object payloads, and --sample-dir |
examples/neu06/ | Full SciTS NEU06 benchmark loop | Raw EEG extraction (reve_features.py), resumable batched generation (generate_neu06.py), and CPU scoring |
Install client dependencies
From the repository root, install the client requirements alongside evalkit and trainkit, download any task projector, and start a matching vLLM server with --enable-prompt-embeds as shown in the vLLM serving chapter:
Run directly from public training samples (--sample-dir)
Two-row sage-training-data-v1 slices for all nine verified modalities are hosted at internlm/Sage-SciPerception-Training. After downloading a slice, vllm_projector.py automatically loads nodes.npy, offsets.npy, optional modality.npy (discrete) or side.npy (side), payload_labels, and question.
Run --dry-run first to verify projector loading, channel shapes, and prompt assembly on CPU without starting vLLM:
Drop --dry-run to send the assembled prompt_embeds to a running vLLM endpoint:
Input shapes and extra channels across all 9 modalities
When supplying your own prepared arrays with --features, match the input channels declared in the checkpoint’s config.json:
| Task | Projector ID | --features shape | Extra CLI flags |
|---|---|---|---|
| Crystal formation energy | glm-5.3-flash/cif/jarvis | [num_atoms, 64] | — |
| ECG classification | glm-5.3-flash/ecg/phu01 | [360, 768] | — |
| EEG sleep staging | glm-5.3-flash/eeg/neu06 | [34, 512] | See Full NEU06 walkthrough below |
| DNA splice classification | glm-5.3-flash/dna/splice | [1, 3] | — |
| Protein structure ranking | glm-5.3-flash/protein-struct/psr | [<=256, 384] | — |
| XRD crystal system | glm-5.3-flash/xrd/simxrd | [110, 512] | — |
| Molecular spectra | glm-5.3-flash/spectra/qm9s | [347, 50] | --discrete modality.npy ([347, 1], values 0/1/2) |
| RNA family classification | glm-5.3-flash/rna/ncrna | [len_seq, 640] | --side side.npy ([len_seq, 13] broadcast per nucleotide) |
| Protein interface sites | glm-5.3-flash/protein-seq/mpbind | [len_win, 1280] | --side side.npy ([len_win, 2]) and optional --payload-labels |
The examples below cover discrete, side, payload_labels, and multi-object inputs:
Full SciTS NEU06 walkthrough (raw EEG to EvalKit)
examples/neu06/ evaluates the released glm-5.3-flash/eeg/neu06 projector on SciTS NEU06: 1,024 single-channel Fpz-Cz EEG segments of 30 seconds labelled Wake, N1, N2, N3, or REM. The released v0.1.0 scores are 72.01% Macro-F1 / 76.46% Accuracy; an independent rerun with these scripts reaches 71.82% Macro-F1 / 76.46% Accuracy across all 1,024 items (per-item predictions of the released run are not available).
Pinned inputs
| Input | Source | Revision | License |
|---|---|---|---|
| SciTS | OpenTSLab/SciTS | 6ce690e904898cc8fd9014ea2e5bebdfa749c1d2 | CC BY-NC-SA 4.0 |
| REVE-base | brain-bzh/reve-base | 33841986f6cc1438d9dcdbca5a2137d60f6007d9 | REVE Responsible Use License v1.0 |
positions.json | brain-bzh/reve-positions | befa5b57a455b77cf302daf610c2e9ed8140bace | Not stated upstream |
| GLM-5.3-Flash-BF16 | zai-org/GLM-5.3-Flash-BF16 | f9fed3bbc82291073373d67452e9f25317ef7577 | See upstream |
| NEU06 projector | internlm/Sage-SciPerception | 7c228fc03394027fed19bda1ff26388394b0031a | Apache-2.0 |
Score existing predictions on CPU
Scoring an existing responses.jsonl (eval_id and content per line) requires only Python 3.12+ and uv:
Extract REVE features, serve, generate, and score
Prepare the client environment on CPU, download the pinned inputs, and extract features with reve_features.py:
Start the language model with vLLM 0.32.0 on eight GPUs (the exact arguments of the rerun):
Run generate_neu06.py and score with EvalKit (greedy decoding, up to 8,192 output tokens; add --limit 16 with --only-responded to try a small batch first):