This is the multi-page printable view of this section.
Reference
Technical references for the checkpoint configuration, Python loading helpers, CPU evaluation CLI, and release metadata.
- config.json — Top-level checkpoint metadata,
projectorarchitecture fields, andscientific_inputs. - load_projector API — CLI and Python helpers for downloading and loading released checkpoints.
- scip-eval CLI — Command-line flags,
summary.json/scores.jsonloutputs, and Python scoring entry points. - License & citation — Apache License 2.0 terms, upstream notices, and BibTeX citation.
1 - config.json
Every released component directory contains projector.safetensors and a config.json following format_version: "sage-projector-v1".
Top-level fields
| Field | Description |
|---|---|
format_version | Schema identifier, currently "sage-projector-v1". |
component_type | Component kind, "scientific_projector". |
task | Task identifier matching the repository index (e.g., "cif/jarvis", "eeg/neu06"). |
weights | Weight filename in the same directory, "projector.safetensors". |
projector | Architecture specification read by modeling_projector.build (see below). |
output_dim | Target language-model embedding width (e.g., 4096). |
base_model | Object with repo_id, revision, dtype, and training_fingerprint. |
prompt | Prompt rendering layout: system, names, template_kwargs, include_reasoning, and atom_numbering. |
scientific_inputs | Array of input specs with encoder, preprocessing, representation (feature_dim, modality, rows, maximum_tokens), scientific_readout, and side_features_per_object. |
training_step | Integer training step of the exported checkpoint. |
training | Optional provenance block written by TrainKit exports (step, export, xtuner_revision, initialized_from, trainable_parameters, learning rate, sizing, manifest revision, and dataset.json / features.json provenance). |
projector block fields
All nine currently released checkpoints use kind: "atom". Across the released checkpoints and modeling_projector.build, the following fields apply:
| Field | Scope | Description |
|---|---|---|
id | Common (atom) | Architecture identifier (e.g., "scientific-cif-positions"). |
kind | Common | "atom", "atom-set", or lead projector fallback when neither is set. |
modality | Common (atom) | Modality identifier (e.g., "cif", "eeg", "spectra"). |
feature_dim | Common | Input scientific feature dimension per token or atom. |
tokens | Lead / atom | null for atom checkpoints; integer slot count for LeadProjector. |
hidden_dim | Common (atom / Lead) | Hidden width of the MLP stack. |
index_dim | Common (atom / atom-set) | Learned positional embedding width (atom_index). |
max_atoms | Common (atom / atom-set) | Maximum number of position slots in atom_index. |
discrete_sizes, discrete_dim | Optional (atom) | Per-atom discrete embedding table sizes and embedding dimension (e.g., spectra/qm9s: [3], 16). |
side_dim, side_hidden_dim | Optional (atom) | Per-object side-feature width and MLP hidden width (e.g., protein-seq/mpbind: 2 / 128; rna/ncrna: 13 / 128). |
task_head_outputs | Optional | Auxiliary head output width (protein-seq/mpbind and protein-struct/psr: 1). |
readout_classes, readout_uses_side | Optional (atom) | Pretrained scientific classification readout count and side-channel flag (protein-seq/mpbind: 1, false). |
output_scale, depth, block_mult, block_exit_norm | Optional | Output L2 norm scaling and residual MLP block options. |
graph_layers, graph_hidden_dim | Optional (atom) | Bond-message residual layers over graph edges and bond types. |
context_layers, context_dim, context_heads | Optional (atom) | Per-object Transformer context residual options. |
model_dim, layers, heads, ffn_dim | atom-set | Transformer encoder parameters for AtomSetProjector. |
Example (cif/jarvis/config.json)
2 - load_projector API
load_projector.py and modeling_projector.py live at the root of the repository and provide both a CLI downloader and Python loading helpers.
CLI downloader
| Argument / option | Default | Description |
|---|---|---|
projector_id | — (required) | Component ID in backbone/modality/task form from the root HF config.json (e.g., glm-5.3-flash/cif/jarvis). |
--repo-id | internlm/Sage-SciPerception | Hugging Face repository ID. |
--revision | main | Branch, tag, or commit revision to resolve from. |
--local-dir | None | Optional target directory where the root config.json and component files are materialized. |
The command prints the resolved local component directory path to stdout.
Python functions (load_projector.py)
download_projector
Downloads the root config.json at revision, looks up index["projectors"][projector_id], and pins the subsequent config.json and weights downloads to the exact resolved snapshot (index_path.parent.name). When local_dir is provided, the root config.json is also written under local_dir. Returns the component directory Path.
load_projector
Reads config.json from directory, instantiates the module with modeling_projector.build(config["projector"], config["output_dim"]), loads config["weights"] via safetensors.torch.load_file(..., device="cpu") with strict=True, moves the module to device, sets .requires_grad_(False).eval(), and returns (model, config).
Module helpers (modeling_projector.py)
| Helper | Description |
|---|---|
build(spec, output_dim, *, train_core=False, train_side_only=False) -> nn.Module | Instantiates AtomProjector, AtomSetProjector, or LeadProjector from config["projector"] and attaches optional heads (task_head, readout, side, graph, context). |
load_initial(model, state) | Loads an initial non-auxiliary core state dict into an AtomProjector, verifying that any optional prefix (graph., task_head., side., context., readout.) is either completely present or completely absent. |
3 - scip-eval CLI
scip-eval is the console entry point of EvalKit. Scoring runs on CPU with Python 3.12+ and uv, and needs neither torch, transformers, nor network access.
Global usage
--dataset is accepted as an alias for --task. The current package version is 0.1.0.
scip-eval score options
| Option | Required | Description |
|---|---|---|
--task, --dataset | Yes | Registered dataset task ID from evalkit.datasets.DATASETS: atom3d-psr, beacon-ncrna, gue-splice, llm4mat-jarvis, mpbind-ba1, qm9s-allspectra, scits-neu06, scits-phu01, simxrd-ol. See Registered datasets. |
--references | Yes | Path to the frozen dataset reference file or directory (e.g., SciTS meta_data.jsonl). |
--responses | Yes | Path to predictions JSONL containing eval_id, content, and optional status / run_id. |
--out-dir | No | Directory where summary.json and scores.jsonl are written. |
--only-responded | No | Score only frozen IDs that appear in --responses, marking scope as a subset. By default all frozen IDs are scored, with absent IDs treated as empty content. |
--workers | No | Worker processes for datasets with parallel metrics such as qm9s-allspectra (default: 1). |
Most datasets require only the Python 3.12 standard library on CPU; optional runtime extras apply to atom3d-psr (scipy, with lmdb only for raw LMDB input extraction) and qm9s-allspectra (rdkit, myopic-mces, pulp). The command prints summary.json to stdout.
Output files
When --out-dir is given, evalkit.score.write_outputs writes two files. Envelope fields (task, dataset, protocol, source, references_sha256, scope, responses, run) are shared, while metric keys and per-item fields follow the selected dataset protocol (for scits-neu06, shown below):
summary.json: containstask,dataset,protocol,source,classes,references_sha256,rules,scope,responses(path,unique_ids,superseded_records,unexpected_ids),run(bound,run_id,unbound_records),rows,macro_f1,accuracy,correct,invalid,missing,statuses, andper_class.scores.jsonl: one JSON object per scored item witheval_id,reference,prediction,valid,correct, andstatus.
Python API
evalkit.contract.read_predictions enforces run consistency: if a JSONL file mixes records from multiple run_id values, or mixes bound and unbound records, scoring fails instead of aggregating across runs.
TrainKit also exposes scip-train preflight for measuring token counts, XTuner packing, and collator alignment on CPU before training (scip-train neu06-preflight remains available as an alias). See the Training guide.
4 - License & citation
License
Sage-SciPerception is released under the Apache License 2.0 (Apache-2.0). See the full license text in LICENSE in the repository.
Upstream datasets, base language models, and scientific encoders remain governed by their own licenses — for example, OpenTSLab/SciTS (CC-BY-NC-SA-4.0) and brain-bzh/reve-base (REVE Responsible Use License v1.0).
Citation
If you use Sage-SciPerception in your work, please cite it using the metadata in CITATION.cff: