liveBook · Manning

Runtime prompt resolution

As explained in Machine Learning Platform Engineering

Runtime prompt resolution is the pattern of retrieving a deployed prompt and its configuration during request processing rather than embedding the prompt in application code.

Runtime prompt resolution retrieves a deployed prompt and its configuration during request processing instead of embedding behavioral instructions in application code. This separates stable authentication and model integration from changeable prompt behavior, enabling updates without application restarts or code deployments. section 13.1.2

A production implementation typically:

  • Initializes the LLM with essential authentication and integration settings while deferring model, temperature, and token limits to managed configuration. section 13.1.2
  • Fetches the production-labeled prompt, applies its configuration, compiles runtime variables such as context and query, and records the prompt version with the response. section 13.1.2
  • Falls back to a boundary prompt when processing fails, returning helpful guidance instead of a cryptic error. section 13.1.2
Listing 13.5 Dynamic prompt fetching and configuration
class DakkaBotCore:
    async def process_query(self, query: str) -> Dict[str, Any]:
        try:
            docs = ...
            context = ...
            prompt_obj = self.langfuse.get_prompt(
                "dakkabot-system",  #1
                type="chat",
                label="production"  #2
            )

            prompt_config = prompt_obj.config    #3
            self.llm.model = prompt_config.get(   #3
                "model", "gemini-2.5-flash")       #3
            self.llm.temperature = prompt_config.get(  #3
                "temperature", 0.0)    #3

Inspect the request-time retrieval and configuration flow that applies the production prompt to the LLM. section 13.1.2

How Machine Learning Platform Engineering covers it

How deep it goes
Explains initialization, retrieval, configuration, compilation, version tracking, and fallback handling, but does not detail deployment automation.
Examples
Uses Langfuse-managed DakkaBot prompts, production labels, Gemini configuration, compiled context and queries, and a boundary fallback prompt.
What you can do after
Apply it via Langfuse to retrieve, configure, compile, track, and safely fail over managed prompts during requests.
How it connects
Connects prompt management with runtime configuration, A/B testing, audit trails, and graceful error handling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.