In this paper, we propose LMST - an approach for Large Language Model (LLM) based conversion of the PyTorch code of an ML model into Solidity. Beyond mere correctness, we try to achieve gas cost optimization in the translation process, while taking into consideration the capabilities and limitations of the Ethereum Virtual Machine. We have also developed a proof of concept decentralized application for verifying the accuracy claims of the underlying ML model. An extensive set of experiments demonstrate the feasibility of deploying ML models on blockchains through automated code translation using LLMs.