Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

Reference

Configuration schema, Python download/load API, evaluation CLI, license, and citation.

Technical references for the checkpoint configuration, Python loading helpers, CPU evaluation CLI, and release metadata.

  • config.json — Top-level checkpoint metadata, projector architecture fields, and scientific_inputs.
  • load_projector API — CLI and Python helpers for downloading and loading released checkpoints.
  • scip-eval CLI — Command-line flags, summary.json / scores.jsonl outputs, and Python scoring entry points.
  • License & citation — Apache License 2.0 terms, upstream notices, and BibTeX citation.

1 - config.json

Schema for released sage-projector-v1 checkpoint configurations and TrainKit exports.

Every released component directory contains projector.safetensors and a config.json following format_version: "sage-projector-v1".

Top-level fields

FieldDescription
format_versionSchema identifier, currently "sage-projector-v1".
component_typeComponent kind, "scientific_projector".
taskTask identifier matching the repository index (e.g., "cif/jarvis", "eeg/neu06").
weightsWeight filename in the same directory, "projector.safetensors".
projectorArchitecture specification read by modeling_projector.build (see below).
output_dimTarget language-model embedding width (e.g., 4096).
base_modelObject with repo_id, revision, dtype, and training_fingerprint.
promptPrompt rendering layout: system, names, template_kwargs, include_reasoning, and atom_numbering.
scientific_inputsArray of input specs with encoder, preprocessing, representation (feature_dim, modality, rows, maximum_tokens), scientific_readout, and side_features_per_object.
training_stepInteger training step of the exported checkpoint.
trainingOptional 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:

FieldScopeDescription
idCommon (atom)Architecture identifier (e.g., "scientific-cif-positions").
kindCommon"atom", "atom-set", or lead projector fallback when neither is set.
modalityCommon (atom)Modality identifier (e.g., "cif", "eeg", "spectra").
feature_dimCommonInput scientific feature dimension per token or atom.
tokensLead / atomnull for atom checkpoints; integer slot count for LeadProjector.
hidden_dimCommon (atom / Lead)Hidden width of the MLP stack.
index_dimCommon (atom / atom-set)Learned positional embedding width (atom_index).
max_atomsCommon (atom / atom-set)Maximum number of position slots in atom_index.
discrete_sizes, discrete_dimOptional (atom)Per-atom discrete embedding table sizes and embedding dimension (e.g., spectra/qm9s: [3], 16).
side_dim, side_hidden_dimOptional (atom)Per-object side-feature width and MLP hidden width (e.g., protein-seq/mpbind: 2 / 128; rna/ncrna: 13 / 128).
task_head_outputsOptionalAuxiliary head output width (protein-seq/mpbind and protein-struct/psr: 1).
readout_classes, readout_uses_sideOptional (atom)Pretrained scientific classification readout count and side-channel flag (protein-seq/mpbind: 1, false).
output_scale, depth, block_mult, block_exit_normOptionalOutput L2 norm scaling and residual MLP block options.
graph_layers, graph_hidden_dimOptional (atom)Bond-message residual layers over graph edges and bond types.
context_layers, context_dim, context_headsOptional (atom)Per-object Transformer context residual options.
model_dim, layers, heads, ffn_dimatom-setTransformer encoder parameters for AtomSetProjector.

Example (cif/jarvis/config.json)

{
  "format_version": "sage-projector-v1",
  "component_type": "scientific_projector",
  "task": "cif/jarvis",
  "weights": "projector.safetensors",
  "projector": {
    "hidden_dim": 1024,
    "id": "scientific-cif-positions",
    "kind": "atom",
    "modality": "cif",
    "feature_dim": 64,
    "tokens": null,
    "index_dim": 32,
    "max_atoms": 512
  },
  "output_dim": 4096,
  "base_model": {
    "repo_id": "zai-org/GLM-5.3-Flash-BF16",
    "revision": "f9fed3bbc82291073373d67452e9f25317ef7577",
    "dtype": "bfloat16",
    "training_fingerprint": "5113ec01897c403098c40c38c897d9abb67222ec5caca80a862129037b30e6ea"
  },
  "prompt": {
    "system": "You are reading one crystal. Answer from the supplied scientific payload. Give brief reasoning and then the requested answer format.",
    "names": [["crystal"], ["First crystal", "Second crystal"]],
    "template_kwargs": { "reasoning_effort": "low" },
    "include_reasoning": true,
    "atom_numbering": false
  },
  "scientific_inputs": [
    {
      "encoder": {
        "name": "chgnet-0.3.0",
        "checkpoint_sha256": "d14ab7c0f093efe64b60a7bcd540bca10e74fb7f46c86108a079af60524659d1",
        "states": "one 64-dimensional state per atom entering the energy MLP; 6/3 angstrom cutoffs"
      },
      "preprocessing": null,
      "representation": {
        "feature_dim": 64,
        "modality": "cif",
        "rows": 60698,
        "maximum_tokens": 140
      },
      "scientific_readout": null,
      "side_features_per_object": false
    }
  ],
  "training_step": 2822
}

2 - load_projector API

CLI and Python helpers in load_projector.py and modeling_projector.py.

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

python load_projector.py <projector_id> [--repo-id REPO_ID] [--revision REVISION] [--local-dir PATH]
Argument / optionDefaultDescription
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-idinternlm/Sage-SciPerceptionHugging Face repository ID.
--revisionmainBranch, tag, or commit revision to resolve from.
--local-dirNoneOptional 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

download_projector(
    projector_id,
    repo_id="internlm/Sage-SciPerception",
    revision="main",
    local_dir=None,
    cache_dir=None,
) -> Path

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

load_projector(directory, device="cpu") -> tuple[nn.Module, dict]

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).

from load_projector import download_projector, load_projector

component_dir = download_projector("glm-5.3-flash/cif/jarvis", local_dir="./checkpoints")
projector, config = load_projector(component_dir, device="cpu")

Module helpers (modeling_projector.py)

HelperDescription
build(spec, output_dim, *, train_core=False, train_side_only=False) -> nn.ModuleInstantiates 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

Command-line flags, output schemas, and Python scoring entry points for EvalKit.

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

uv run --project evalkit scip-eval --version
uv run --project evalkit scip-eval score --task <TASK> --references <PATH> --responses <PATH> [--out-dir <PATH>] [--only-responded] [--workers <N>]

--dataset is accepted as an alias for --task. The current package version is 0.1.0.

scip-eval score options

OptionRequiredDescription
--task, --datasetYesRegistered 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.
--referencesYesPath to the frozen dataset reference file or directory (e.g., SciTS meta_data.jsonl).
--responsesYesPath to predictions JSONL containing eval_id, content, and optional status / run_id.
--out-dirNoDirectory where summary.json and scores.jsonl are written.
--only-respondedNoScore 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.
--workersNoWorker 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: contains task, 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, and per_class.
  • scores.jsonl: one JSON object per scored item with eval_id, reference, prediction, valid, correct, and status.

Python API

from pathlib import Path
from evalkit.score import score_files, write_outputs

result = score_files(
    "scits-neu06",
    Path("/path/to/SciTS/meta_data.jsonl"),
    Path("/path/to/run/responses.jsonl"),
    only_responded=False,
    workers=1,
)
write_outputs(result, Path("/path/to/run/score"))

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.

Training preflight CLI

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

Apache License 2.0 terms, upstream notices, and BibTeX 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:

@misc{sage_sciperception,
  author       = {{InternLM}},
  title        = {{Sage-SciPerception}},
  version      = {0.1.0},
  note         = {GitHub repository},
  year         = {2026},
  url          = {https://github.com/InternLM/Sage-SciPerception}
}