Just came across
https://dspy.ai/ while researching
GEPA. Seems to be a very flexible and programmable "LLMs as code" runtime. Sort of a functional abstraction over LLMs. Its got some very good credentials using it, it allowed things like optimising the prompt.