In conclusion, this study introduces an efficient approach for determining crystal structures from powder X-ray diffraction patterns. It goes beyond existing generative AI applications focused on scalar properties by facilitating structure generation and demonstrating the potential of using spectral data, such as XRD. The DiffractGPT model is capable of predicting material properties with high accuracy, particularly when the chemical elements of the materials are known. Notably, DiffractGPT outperforms conventional machine learning models, such as gradient boosting and convolution neural network, in predicting lattice constants while also providing the option to generate complete crystal structures. Additionally, the training process for DiffractGPT is straightforward, fast and relatively easy to learn, thereby bridging the gap between the computational, data science, and experimental communities. As a complementary tool, we offer a framework that matches experimental XRD patterns with existing databases, incorporating automated background subtraction.