3 Serve projected inputs with vLLM
The inference client builds the entire prompt in the language model’s embedding space. It renders the native GLM chat template, looks up text embedding rows, projects the scientific features, and replaces the designated payload spans. vLLM receives the result as prompt_embeds on /v1/completions.
Serve the matching backbone
Use the model snapshot declared by base_model in the selected checkpoint. The client needs that same snapshot locally for the tokenizer and input embedding table. The example uses eight-way tensor parallelism. Set it for the hardware serving the backbone.
Send a crystal prompt
Prepare a tensor of shape [num_atoms, 64] with the CHGNet 0.3.0 states described in the JARVIS task guide. Preserve atom order. Use the checkpoint from the CPU chapter and pass the feature file to the crystal client.
The client sends the matrix serialized with PyTorch and encoded as Base64. The default question asks for formation energy per atom in eV/atom. Use --question to pass another question.
Build a session for variable-length inputs
evalkit.glm_prompt_embeds provides two adapters. GlmProjectorPrompt takes a fixed question and payload layout at construction and reuses their text embeddings. GlmProjectorSession reuses the projector, tokenizer and embedding lookup while rendering the question and payload spans for each request.
For multiple objects, concatenate the feature rows in object order and pass their lengths as payload_tokens, for example [3, 5] for eight rows. If the checkpoint uses atom_numbering, the chat prompt renders numbered payload positions. To supply labels for those positions, pass payload_labels grouped per object. Follow the checkpoint configuration for discrete or side inputs. If the projector needs counts, the adapter uses the per-object lengths unless the caller supplies counts explicitly.
The evaluation chapter shows how to save generation results and score them alongside frozen references.