A pattern: use LLMs for a rough and ready version.
A quick and dirty, good enough answer on demand.
The more that procedure is depended on, the more you factor out common cases into normal, run-of-the-mill, easy-to-execute code.
As time goes on, you fall through to the overflow "rely on the LLM" less and less often.
This allows a comprehensively good enough system that can get more efficient over time with use.