Building fast and scalable LLM interactions with FSM-inspired prompt engineering