Our model maps from text descriptions of a structure to Python code which uses the Pymatgen package to generate the desired structure. This means that each 'data point' is composed of three objects: a text description, the Pymatgen code that generates the structure, and the CIF file, see Figure . The model is trained to map from text to the code and CIF, and is graded on the similarity between the original and generated serialized structures. This approach is inspired by the Toolformer 27 as a way to teach LLMs to use Pymatgen code to build the crystal structure, see Fig- . The idea is to populate the dataset with Pymatgen calls. The relationships between text and crystal structure ("text-CIF") is expanded to include code which generates the structure ("text -code -CIF"). This is for the ultimate goal of mapping from a text description of a structure in prompt for an LLM to generate the Pymatgen code and the output of its execution, i.e., the structure CIF.